Forum Discussion
Storyline 360: Variables in the built-in player Menu
I like to use master slide title placeholders for my slides, which, when populated on a slide, will automatically name the slide the same title, and in turn automatically be used in the built-in Table of Contents Menu in the player.
I also like to use variables in my slide titles. However, these variables do not show up in the Menu - they render as %my_variable%.
I don't need this variable to adjust while people interact with the slide (the variable doesn't change while on the slide), I just need the variable to render the text value.
Example: I have a 200 slide file, and slides 51-150 have titles of "Step 1," "Step 2," "Step 3" etc. all the way to Step 100.
I don't want to have to manually type that out, especially if we end up inserting a new slide/step on slide 52. That would mean I'd have to manually update slide titles for slides 52-151.
Instead, I create a variable that represents the step and insert it into the slide title (%current_step_number%). I set current_step_number to Project.slideNumber - 50 to represent the current step number. The slide title renders nicely on the slide, but not in the Menu. In the Menu, slides 51-150 all say "Step %current_step_number%" which is not helpful to learners.
Is there a way around this, or is there something I'm missing that I could use instead?
- PhilMayorSuper Hero
I would say feature request, but you could successfully argue a variable in the menu is a bug
- MicheleBuddieCommunity Member
Thanks Phil and Nedim! Your explanation makes sense since the Menu itself wouldn't show a unique number even if it could show variables. And Nedim thanks for showing where the Menu text is stored in the html.
In order for what I want to work without JavaScript it sounds like it would be two separate requests for Articulate, correct?
One request would be the ability for variable to show in the Menu and another request would be for a built-in variable that represents the number of the slide in the structure of the storyline course rather than the current slide number? (Or maybe that exists already and I just missed it?)
Would you say both of these requests are feature requests vs bug fixes? If so, do either of you know where I should go to request them?
Hi MicheleBuddie!
Glad to see Phil and Nedim have been helping you!
I'm happy to relay your feature requests to our product team. For now, as Nedim shared, this type of design functionality is not supported, unless implementing Javascript. We'll be sure to notify you if these enhancements make it to our product roadmap.
- MicheleBuddieCommunity Member
Thanks for the reply! Is this the only way to suggest a feature request, or is there a location I should go to ask for a feature request? How do you decide which feature requests to add to the product roadmap? Is it based on votes? If so, how do I vote for a feature request I'd like to see implemented?
- NedimCommunity Member
This is definitely a feature request, and I won’t argue whether it’s a bug or not.
In Storyline, whatever we define as the slide title is automatically assigned to the Project.SlideTitle variable. Since this variable is slide-specific, it can only hold one value at a time, reflecting the title of the currently active slide.
If Storyline allowed us to pass a custom variable (or even the Project.SlideTitle variable itself) to the menu, the menu would display only one title throughout, rather than dynamically updating per slide. In such a case, the %% symbols used for variables would simply be treated as plain text, rather than placeholders for dynamic values.
The key issue is that when the menu loads, it loads all slide titles at once, rather than updating based on the current slide. This means that no matter which slide you are on when the menu is generated, Project.SlideTitle will always reflect only the title of the current slide, rather than dynamically changing for each menu entry as it only display one value at a time.
In an ideal scenario, Project.SlideTitle should function as an array containing all slide titles, indexed according to their order in the project.
This way, instead of holding just one value (the current slide's title), it would store all titles, making it easier to reference slide names dynamically. Of course, everything above is just my opinion, and I have no way to prove this concept.
To dynamically change link items in the menu to different text values, you can try running the script below, executed on the master slide. In your scenario, you can modify the if condition to if (index > 50 && index < 151) and see what it does.const links = document.querySelectorAll('.linkText'); let linkNumber = 1; links.forEach((link, index) => { if (index > 2 && index < 7) { const isScene = link.closest('[data-is-scene]'); if (!isScene) { link.textContent = `Step ${linkNumber}`; linkNumber++; } } });
Advanced JavaScript programmers would likely find a simpler way to achieve this or even directly connect it to project variables, such as Project.SlideTitle or a custom variable set to the same value.
- NedimCommunity Member
I absolutely agree with Phil. He has clearly explained what would happen when using a custom "currentStepVariable" to change something that is dynamically predefined within Storyline. This isn't a bug; it's a result of modifying the default Storyline settings. However, I do support the feature request.
If you carefully examine the HTML menu structure, you'll notice that the title items in the menu (including the Scene title) are each a span element with a class of 'linkText'. The title text inside a span element is what actually needs to be updated dynamically, ensuring that the title text does not change to the same value when the menu is loaded and that Scene title names are not affected. You can achieve this only with JavaScript executed on the master slide.Example:
All my slides are named "Untitled." I executed JavaScript on the master slide to ensure that only slides 3, 4, 5, and 6 are renamed to Step 3, Step 4, Step 5, and Step 6, respectively. This solution does not require any custom Storyline variables or built-in Project.SlideNumber variable. - PhilMayorSuper Hero
I would be nice for variables to show in the menu. Even if this was fixed it, I don't think it would work for you, as the current step number must change on each slide, so you would have 100 slides in the menu that said 'Slide 1', and then when you change to step 2 all slides would change to 'Step 2'
- PhilMayorSuper Hero
No this isn't possible, and as you are using the same variable then it would just display one value each time you hit the slide.
- MicheleBuddieCommunity Member
Thanks for the confirmation it isn't possible! It works so nicely on the slide itself (the number increments/decrements and shows correctly). I'm not sure if my request to change this would be logged as a bug fix or a feature request. I'm leaning toward bug fix but if any Staff want to point me in the correct direction to get this change implemented, I will follow whichever approach is recommended.