element IDs not visible in HTML?

Q&A about the latest versions
Post Reply
hromain
Posts: 42
Joined: Wed Apr 11, 2018 12:12 pm

Hello,

I know that the skin editor allows you to name each skin element with a unique ID. However, upon investigating an exported project with Chrome's dev tools, I don't see the element IDs anywhere in the HTML (I do see the classes, but no IDs). Is there some kind of export setting I need to select in order to make the IDs visible in the code? Having unique element IDs is one of the major guidelines for web accessibility standards, and I'm hoping to have this project align.

Thanks!
User avatar
Hopki
Gnome
Posts: 13029
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
For skin IDs you need to look in the skin.js file not the HTML page.
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/
User avatar
thomas
Chief Gnome
Posts: 2613
Joined: Fri Sep 01, 2006 3:56 pm
Location: Vienna, Austria
Contact:

Currently, we don't set the IDs as they may not be unique; for example, a hotspot template or a cloned element appears multiple times in the DOM.

You can also embed multiple panoramas on a single HTML page, which would make this worse. That is also why we prefer classes for custom styling.

If you only need the ID for certain elements, you could use, for example, the action - Start - Goto Url

Code: Select all

javascript:me._text_1.id="Text1";
or you could use a code block to do the same thing for more elements.

As Martin said, you can look at the skin.js file to get an idea of how the skin is assembled, and maybe you can find a better solution.
MfG, Thomas
hromain
Posts: 42
Joined: Wed Apr 11, 2018 12:12 pm

Thanks for the insight, Thomas; I can definitely understand the logic there. Would you mind explaining a bit more about how to set the IDs for certain elements? I know how to set an action on Start, but I’m not sure how to use the Go To URL action to pull the ID from the skin.js file...
Post Reply