node in URL

Q&A about the latest versions
Post Reply
AleCorreia
Posts: 3
Joined: Mon Feb 08, 2021 1:40 pm

Hi all!!!

How can I make the node name appear after index.html?

I know that I can call a specific node by passing the #node parameter, but I need the opposite, that as I move through the panorama, the node number or another identifier variable appears in the URL for tracking purposes.

Tks! :D
User avatar
k.ary.n
Gnome
Posts: 615
Joined: Wed Aug 15, 2007 1:02 pm

Yes. You can add the name/ID in Custom Node ID in User Data.

https://ggnome.com/doc/dna/#custom-node-id
AleCorreia
Posts: 3
Joined: Mon Feb 08, 2021 1:40 pm

Hello, thanks for the help!

I tried everything and the number of the node does not appear in the browser url :(

I have already activated the show ID of the node in the advanced settings and I have already activated the direct access to the node in the HTML output, what can I be doing wrong? I've tried everything lol
User avatar
Hopki
Gnome
Posts: 13015
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
You can show the node id in the browser address bar.
In this example, the tour is in node3.

1.png
1.png (21.78 KiB) Viewed 3511 times

To make this work you need to add a container to your skin and give it the action.

2.png
2.png (33.72 KiB) Viewed 3511 times

For the code just copy and paste the following in the URL text field:

Code: Select all

javascript: history.replaceState({}, player.userdata.title, location.href.replace(location.hash,"") + '#' + player.getCurrentNode());

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/
ismarker
Posts: 26
Joined: Fri Dec 09, 2022 5:07 pm

Hi,

Is there a way to get the custom node name in the url?

I would imagine player.getCurrentCustomNode()); or something like that.

I can't find anything suitable at https://ggnome.com/doc/javascript-api/
User avatar
Hopki
Gnome
Posts: 13015
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
Yes you would use: player.userdata.customnodeid.
Put this in a Node Changed, Go To URL action with

Code: Select all

javascript: history.replaceState({}, player.userdata.title, location.href.replace(location.hash,"") + '#' + player.userdata.customnodeid);
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/
ismarker
Posts: 26
Joined: Fri Dec 09, 2022 5:07 pm

Fantastic. Thank you!

Is this documented somewhere?
User avatar
Hopki
Gnome
Posts: 13015
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Have you seen out Javascript API page?
https://ggnome.com/doc/pano2vr/referenc ... cript-api/
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/
ismarker
Posts: 26
Joined: Fri Dec 09, 2022 5:07 pm

Nope, I must have missed that one. Thanks again!
Post Reply