Highlight active menu point

Michel Mäder shared this question 3 years ago
Answered

I try to highlight an active menu point in an website, without any additional elements.


Would there be a way solving the problem with an action? E.g. onPageLoad -> Change Style -> Condition: « if 'Pagetitle' = 'Home'» ore something like this?

Comments (4)

photo
1

Hello Michel,


One way to accomplish such a task is to set a variable to the appropriate value upon page load. After doing so, you may add an event that checks the value of the variable to determine the menu item to highlight.


Sincerely,


Luisa

photo
1

Dear Luisa


Thank you very much for your answer!


Unfortunately I'm not yet common in using variables this way (I tried hard today, but I failed). May I ask you to give me a little example? this would be great!


thank you very much!


best regards,


Michel

photo
1

Hello Michel,


We would be more than happy to provide an example to aid in clarification. Firstly, this example uses a master to allow reuse of the navigational bar easily. In addition, there are three screens set up (home, about, contact) to help demonstrate the behavior desired. The following list describes the needed events / variable:


1. The variable 'page' is established by navigating to the variable tab and selecting the '+' character (done through event builder).


2. Each screen (home, about, contact) has an on load event of type set value for a variable named 'page' (home page sets value to 'home', etc).


3. An element of the master has an on load event for each menu item, checking whether the variable is equal to the set screen name.


Attached are images to provide further guidance. If you would like access to the actual prototype file, you may email us at jim.support@justinmind.com as this system does not allow such attachments.


Sincerely,


Luisa


25e7bc234bdb08ad365f2876d979d222

photo
1

Dear Luisa


Thank you so much for the detailed example!:)


It helped me a lot to achieve my goal and it helps me to understand the way variables can be used!:)


Warm regards,


Michel