Forum Academy Marketplace Showcase Pricing Features

[solved] Issue with Custom states and element conditional

I would like to show/hide elements on a header when the user presses the menu but it does not work when the page is loaded.

Here is the workflow:

1- The user selects a menu item, in the workflow, I set the selected menu state to the right state and go the appropriate page.
2- When the page the new page is loaded, I was expecting an element with the some conditional to be shown as the condition is true.

When I debugged, I noticed that the condition was empty when the page loaded even though there was a condition. I was expecting the condition to be executed.

My goal was to be able to highlight the menu based on user selection. If you know a better to do this, please let me know.

Any clue.

Any clue?

If you don’t share a link people can’t really help.

Fine. I will create an example in forum_app

States don’t pass between pages. You if want to pass something between pages you might want to look at passing as data or use URL parameters.

You might also look at:

1 Like

Thanks, I will give a try

Thanks @Kfawcett, it worked :slight_smile:

1 Like