Forum Discussion
Hiding a TOC entry based on a variable
Can I hide a TOC entry depending on a variable in Storyline?
I urgently need this feature for a training course.
Thank you for your help.
Hi Nedim, thanks for your offer.
I think I've found a simple solution. To hide the TOC entry "NEW", I simply put this script in a trigger linked to my variable:
let NEW = document.querySelector(‘[data-slide-title=“NEW”]’); NEW.closest(“li”).style.display = “none”;
5 Replies
- JudyNolletSuper Hero
You can customize the built-in Menu before you publish a course. But Storyline doesn't have a way to change it afterward.
That can be done with JavaScript. I can't help with that. However, Nedim provided an example in this discussion.
- ChristophSchmolCommunity Member
Thanks, Judy.
I'm looking for a way to hide the TOC item "XYZ" in the built-in menu if a variable "V" is false. If it's true, the TOC is supposed to be shown in full.The thread you've mentioned appears to discuss a similar request. Unfortunately, Nedim has never made his JavaScript solution available to the public.
- NedimCommunity Member
The reason I did not post my JavaScript solution directly in this thread is that every scenario is different, and adjustments are usually required to make the solution work properly for a specific use case.
I left my private email address so anyone interested can contact me directly if they need additional details, a more detailed explanation, or assistance implementing the solution. If someone is not familiar with JavaScript, I can also help by adapting or building the solution for them.
As with this thread, there may be others who find the discussion useful and can determine whether the approach fits their own requirements. If you contact me privately, we can often move things along more quickly since I tend to check my personal email more frequently than the notifications that arrive in my business email.
I do not charge for my assistance or the work I share (believe it or not), although anyone who finds value in my help is welcome to support me through my Buy Me a Coffee page.
Of course, you can also continue the discussion here. If you do, please provide additional details about your specific scenario or share a mock-up file along with clear instructions. Depending on the complexity of the project, it may take some time to review because my JS solutions are not simply "vibe-coded." I usually spend time examining the Storyline structure to identify opportunities for improvement and ensure the solution is flexible enough to be adapted for different requirements.
Let me know how you would like to proceed, and I'll do my best to help.
- ChristophSchmolCommunity Member
Hi Nedim, thanks for your offer.
I think I've found a simple solution. To hide the TOC entry "NEW", I simply put this script in a trigger linked to my variable:
let NEW = document.querySelector(‘[data-slide-title=“NEW”]’); NEW.closest(“li”).style.display = “none”;- NedimCommunity Member
It's an excellent solution. Glad you solved it.
Related Content
- 6 months ago