Page 1 of 1

Menu with clickable categories

Posted: Wed Mar 17, 2021 1:23 pm
by 4ctive
Hi Hopki,
Hi Everyone,

I have build a menu with categories and nodes. The menu lists all categories and if you hover with the mouse on the category it lists the corresponding nodes. By clicking on the nodes it opens the next panorama (hotspot url). That works very well so far.
What I tried to implement is that I can also click on the category to open the first node of this category. But unfortunately I am not able to bring it to work. I made a click event on the textbox which is inside the category cloner with the following elements: mouse click; open next panorama; $(hu). That leads to not be able to open the nodes from the node cloner. Every time i click on a node (from the node cloner, not the category cloner) it opens the first panorama of the category and not the panorama from the corresponding hotspot url.

I have attached the menu.

Any help or suggestions for implementing is very much appreciated.

Greetings,
Benjamin

Re: Menu with clickable categories

Posted: Fri Mar 19, 2021 9:14 am
by 4ctive
Hi @Hopki,

do you have any idea?

Re: Menu with clickable categories

Posted: Fri Mar 19, 2021 12:52 pm
by Hopki
Hi Benjamin,
Firstly to tidy things up I added an action filter to the mouse click, open next panorama action in the node_Txt text box.
The action filter, Active = false, stops reloads of the same node.

The problem is how the menu is made.
Actions bubble up, if you have a parent element with an action and a child element with an action, then as you click the child element, the parent action will be triggered.
In this case, always opening the first node of the category.

So to fix the problem you need a way to disable the action in the cat_txt text box once you are in that category.
To do this add a new variable, I used var_set_ctag, text variable and enter the value for the tag for the opening category, in this case: Derma-Clinic
Select cat_txt, then add an action filter to the Mouse Click Open Next Panorama action. The filter is:

Code: Select all

*var_set_ctag ≠ $(ctag)
I also added

Code: Select all

Active = false
Again this prevents unnecessary reloads of the same node.

Now add a second action, Mouse Click, Set Variable Vale, var_set_ctag, = $(ctg)

So what this will do is on click of the category you open the first node of that category and then you set the variable to the cloner tag for the category you are now in.
Th reopen Next panorama action can no longer trigger as variable ctag now equals the cloners tag. The action filter will only allow the action to trigger if it is different, so when selecting a different category.

Regards

Re: Menu with clickable categories

Posted: Mon Mar 22, 2021 10:48 am
by 4ctive
Hi Hopki,

thank you so much for your quick reply!
I will have a look at this this week, unfortunately I am travelling at the moment.

BR,
Benjamin

Re: Menu with clickable categories

Posted: Tue Mar 23, 2021 4:24 pm
by 4ctive
Hopki,
thank you so much! Everything works absolutely amazing! Thanks for your help, I really do appreciate your work here in this forum.

Re: Menu with clickable categories

Posted: Tue Mar 23, 2021 6:29 pm
by Hopki
Hi Benjamin,
Just happy to help.
Regards,

Re: Menu with clickable categories

Posted: Wed Mar 24, 2021 1:46 pm
by 4ctive
Hi Hopki,

I have an additional question: I am trying to build the exact same menu but not with the titles of the categories and nodes but with the node images.
Do you have an Idea how I can do this or a tipp how I can start? The table in the category cloner is only for text as far as I could figure it out. So what I am looking for is a possibility to show the first image of the selected categories (just like the cloner does with the table argument).