Add title-name to html-title-tag?

Opening the published title in a browser, the browser shows page names as they are used for the title-tag in html.

Can I add the lectora-title to the title-tag?

When naming the module "OSA_02_MST" (Title-Options / Name) the browser should show "OSA_02_MST: Start" not only "Start". Renaming the pages is not an option, because of the menu used.

(See screenshot for explanation.)

lectora_page-title.png

Discussion (3)

By the way: using JavaScript in a main action to rewrite the page title for every page is not the solution I am searching for:

document.title = "OSA-MST: " + VarCurrentPageName.getValue();

Because rewriting happens at the client side after processing the page. Web server statistics still lists pages - even from different modules - as "Start" without the name of the module "OSA-MST: Start".

Finally: JavaScript will do the job. Combining my name changing script an the Piwik tracking code, I can force the name changing before the tracking code is processed (I hope so).

The first object im my title explorer is a header script:

undefined

... goes here ...

But: you have to have an action using CurrentPageName and CurrentTitelName prior this script, otherweise the variable will not be present for the header script (why?).

Thanks for listening.

But: you have to have an action using CurrentPageName and CurrentTitelName prior this script, otherweise the variable will not be present for the header script (why?).
Lectora only initiates variables that are used in the page for some reason. This is the case with using any variable and JavaScript in Lectora.

There are a couple of ways to initialize the variable:

1. use it in an action on the page. Even using it in a condition will do. So you can create a dummy action that does nothing on the title level and add ALL required variables to its condition.

2. Set it as a "Required variable" for a HTML External Object. This is my preferred method. I use an HTML Ext Object set to Meta tags to include all my external scripts and CSS rules. It is located on the title level, so I also set all variables as Required for that object and then they're initialized throughout the title.

Once you know of that limitation, you just do it without thinking twice, so it isn't a big nuisance. But I still reported this to Trivantis and asked them if this behaviour could be changed, especially that it isn't the case in Lectora Online, where all variables are accessible at all times. Hopefully it'll make it into one of the future releases.

Discussions have been disabled for this post