Javscript function for panos within GroupID  

This sub-forum is for discussing and reporting bugs on any content that is not available by default in Panotour, so this concerns custom HTML templates, extra plugins (both Kolor-provided and third-party), etc...

Ce sous-forum a été créé pour discuter et/ou rapporter des bugs sur tout contenu qui n'est pas disponible par défaut dans Panotour, donc cela concerne les templates HTML customisés, plugins supplémentaires, etc...
no avatar
Topic author
Posts: 20
Likes: 4 posts
Liked in: 5 posts
Joined: Mon Apr 25, 2016 1:24 pm

Javscript function for panos within GroupID

by mikepostons » Wed Mar 01, 2017 3:19 pm

Hi guys,

need a bit of help. I'm building a custom template and looking for a way to hide/show a div based on group. I used the Debug Plugin to get the group IDs, but now looking at a way of targeting the JavaScript based on which group the panorama is in.

The current code I have is:

Code: Select all
function updatePanorama(panoid) {
{% if project.panoGroups.count %}
      {% for group in project.panoGroups %}
         {% if group.isExplicit %}
            {% for pano in group.panos %}

                                        /* action for non group pano */

            {% endfor %}

            {% else %}
               {% for pano in group.panos %}

               /* action for non group pano */

            {% endfor %}
         {% endif %}
      {% endfor %}
   {% endif %}

But obviously this is currently targeting panos in all groups. Looking for something something along the lines of:

if pano has groupID of 'panogroup1411' then show div with ID of #exampleDiv

This would be a useful snippet of code to have for many people. Hoping someone with experience of the syntax can offer some advice. Thanks in advance.

Who is online

Users browsing this forum: No registered users and 1 guest