How to create an action on a course title button that displays page specific tex

I want to create a title button that when clicked will display page specific text, rather than creating a page specific button that does this. I am thinking I could use a variable that will find the page specific text but I can not figure out how to do this.

Any ideas?

Discussion (10)

There are a couple of ways I can think of. Why do you want that functionality? What specifically are you trying to accomplish that requires a title level button and not a page level button?

Is there a dynamic aspect to this? You mention "find the page specific text". Can the text on that page change? Is there a reason you don't put the text in a variable to begin with?

Easy. Create a custom variable "MySpecificText". On Title level, create a button that displays message containing that variable, or changes a text box to this variable, or what have you.

Now on each individual page, set the variable value to page specific text. Voila.

The text is the audio transcript for the page

The button is a main navigation button they click to display transcript.

The reason I want to do this is to make the coding and updating more efficient in the future. This is a long 3 hour course.

Thoughts?

and...thanks for the input!

I was trying to do it this way but I got confused on how to set the variable value on each page? Could you explain further this step?

Thanks!

You'd need the button and the textfield on title level. Add an action to the textfield:

On: Page show

Action: Change ContentsTarget: This object

Value: VAR(Your_CC_Variable)

On each page add an action to the page:

On: Show

Action: Modify variable

Target: Your_CC_Variable

Type: Set as equal

Value: Insert the respective text

You should think about whether this the more efficient way to do it instead of having separate textfields and buttons on each page, because values from actions / variables are not exported, in case you'd want it to be translated. I don't think these values are easier to maintain than separate textfields.

Tim

I did it this way before. It was okay but you have to remember that there is no formatting in variables, so you can't have e.g. bold text in your CC text box.

Format variables - http://community.trivantis.com/forums/topic/formatting-inline-variables/

Darrel, in your example you are not formatting a variable. You are formatting the whole span. Try creating this subtitle using a variable:

"Hello and welcome to the Absolutely Awesome Course!"

Without JS, of course. You can do anything with JS but that is not the point of Lectora and seemingly not what @lamcewen is looking for.

I just meant to say, you either have a separate textfield containing the text on each page or you have an action containing all the text on each page... I'd normally advise to use the textfield. Pasting button and textfield from page to page isn't more effort than only copying the action.

Thank you everyone. I have it figured out now and appreciate your collective thoughts!

Discussions have been disabled for this post