Menu with clickable categories

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
4ctive
Posts: 35
Joined: Mon Dec 16, 2019 10:07 am

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
Attachments
Main_Menu_clickable_category.ggsk
(47.38 KiB) Downloaded 133 times
Best Regards,
Benjamin
4ctive
Posts: 35
Joined: Mon Dec 16, 2019 10:07 am

Hi @Hopki,

do you have any idea?
Best Regards,
Benjamin
User avatar
Hopki
Gnome
Posts: 13004
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

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
Attachments
Main_Menu_clickable_category.ggsk
(47.61 KiB) Downloaded 138 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
4ctive
Posts: 35
Joined: Mon Dec 16, 2019 10:07 am

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
Best Regards,
Benjamin
4ctive
Posts: 35
Joined: Mon Dec 16, 2019 10:07 am

Hopki,
thank you so much! Everything works absolutely amazing! Thanks for your help, I really do appreciate your work here in this forum.
Best Regards,
Benjamin
User avatar
Hopki
Gnome
Posts: 13004
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Benjamin,
Just happy to help.
Regards,
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
4ctive
Posts: 35
Joined: Mon Dec 16, 2019 10:07 am

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).
Best Regards,
Benjamin
Post Reply