Resource title in site description along with current page name.

Is there a way to have the title of a resource, in the site description when publishing for web along with the current page that you are on, so that is it easily understandable as a bookmark or when you have multiple tabs open?

Discussion (6)

Sure. Add conditional action on Title level:

On Show > Execute JavaScript >

document.title = VarCurrentTitleName.value + ' - ' + document.title[/CODE]

Conditon: IF "CurrentTitleName" DOES NOT CONTAIN "abcdefghijk" (a rubbish string so that the condition never fires, we don't need it to fire). This is required to make sure the Current Title Name variable is made available by Lectora.

This will change the page title to e.g. "Risk Management 101 - Learning Objectives".[CODE]document.title = VarCurrentTitleName.value + ' - ' + document.title[/CODE]


Conditon: IF "CurrentTitleName" DOES NOT CONTAIN "abcdefghijk" (a rubbish string so that the condition never fires, we don't need it to fire). This is required to make sure the Current Title Name variable is made available by Lectora.


This will change the page title to e.g. "Risk Management 101 - Learning Objectives".

@ssneg 63697 wrote:

Sure. Add conditional action on Title level:

On Show > Execute JavaScript >

document.title = VarCurrentTitleName.value + ' - ' + document.title[/CODE]

Conditon: IF "CurrentTitleName" contains "" (empty string) -- this is required to make sure the Current Title Name variable is made available by Lectora.

This will change the page title to e.g. "Risk Management 101 - Learning Objectives".

Thanks,

Is that to be put on every page?

Thing is I can't see why this doesn't happen when you publish a resource.[CODE]document.title = VarCurrentTitleName.value + ' - ' + document.title[/CODE]


Conditon: IF "CurrentTitleName" contains "" (empty string) -- this is required to make sure the Current Title Name variable is made available by Lectora.


This will change the page title to e.g. "Risk Management 101 - Learning Objectives".


Thanks,


Is that to be put on every page?


Thing is I can't see why this doesn't happen when you publish a resource.

It has to be added on the title level. This way it will be inherited on every page automatically.

ssneg,


I tried your suggestion and it didn't work for me. I double-checked for typos and set it up as described. I didn't get any errors, and nothing changed. Am I missing something?


Thanks!

ssneg's suggestion worked after I changed the condition to: IF "CurrentTitleName" DOES NOT CONTAIN "" (empty string)


This little bit of info was useful JIT for a project! Thanks.

@michelle_m 63819 wrote:

ssneg's suggestion worked after I changed the condition to: IF "CurrentTitleName" DOES NOT CONTAIN "" (empty string)


This little bit of info was useful JIT for a project! Thanks.



Thanks for letting me know that the expression is evaluated this way! Interesting. Apparently, empty strings are full of surprises, so it is safer to use a [variable1 DOES NOT CONTAIN "rubbit string of characters"] condition that will never fire. I changed my original post above to reflect that.

Discussions have been disabled for this post