1. Create a custom variable called _ShortPageName
2. On title level, add the following actions:
2.1. On Show > Modify Variable > _ShortPageName > Set to “CurrentPageName”
var pageName = VarCurrentPageName.getValue();
var firstWord = pageName.split(” “);
Voila, now the _ShortPageName contains the first word (before space) of your page name. Working demo attached.
This post has received 2 votes up.
This reply was modified 4 years, 2 months ago by Daryl Fleary.
I should have said I am doing this in Lectora Online so I cant open the AWT file. (Is there some way to convert it)
I will place this Action in an Action Group and at the top of my course. The Action Group runs every page. This will save having to customise the action to write the first word of page name to a variable.
I did attempt to create an action as above. But I was not able to get it working.
In Debug the action and JS are being fired.
Action [RunJS_On_CurrentPgeName->_ShortPageName on ActGrp] fired!
Titles created in Lectora v12 are not compatible with Lectora Online 2.0. The newer button, shape, and formatting features are not yet supported in Lectora Online. Our developers are working on bringing them back together for the next version.