Current Pano Name / Description   [SOLVED] - View the solution

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
mikepostons
Member
 
Topic author
Posts: 20
Likes: 4 posts
Liked in: 5 posts
Joined: Mon Apr 25, 2016 1:24 pm
Info

Current Pano Name / Description

by mikepostons » Tue Nov 15, 2016 1:58 pm

Hi guys,

hopefully this is simple to do. Basically I'm customising a HTML template and I want to have the pano name / description appear in the bottom corner. The code i've tried is:

Code: Select all
<header>
   {% for group in project.panoGroups %}
      {% for pano in group.panos %}
         <h1>{{pano.description.name}}</h1>
      {% endfor %}
   {% endfor %}
</header>


But this just pulls a list of all the pano names. So how do I get it to show just the current pano name? Is there a templating tag that I need to wrap this in?

Many thanks in advance. Mike

User avatar
Annis
Kolor Team
 
Posts: 6062
Likes: 801 posts
Liked in: 444 posts
Joined: Mon Aug 12, 2013 12:47 pm
Location: France
Info

Re: Current Pano Name / Description  [SOLVED]

by Annis » Tue Nov 15, 2016 2:15 pm

Have a look at the HTML templates on this page: http://www.kolor.com/wiki-en/action/vie ... _Templates

Some of them display the current Pano name and description (like the Bootstrap Dark on Light with Project Colors - Responsive template), you should be able to find the code you need from them.

You might need to use the plugin that comes with the template with your own template to access the description in the template.

no avatar
mikepostons
Member
 
Topic author
Posts: 20
Likes: 4 posts
Liked in: 5 posts
Joined: Mon Apr 25, 2016 1:24 pm
Info

Re: Current Pano Name / Description

by mikepostons » Tue Nov 15, 2016 3:03 pm

Thanks for the info Annis, I did look at one of the other templates and couldn't see the code. I have found it now though.

For everyone's future reference, this is what you need to add to the HTML template index file:

Code: Select all
<h1 class="panorama-title"></h1>
<p class="panorama-desc"></p>


Code: Select all
<script>
// Dynamic Pano Title and Description
   function updatePanorama(panoid) {

   window.history.pushState(null, null, "#s=" + panoid);

   var panotourPlayer = getTourPlayer();
   var groupid = panotourPlayer.get("scene["+panoid+"].group");
   var titleid = panotourPlayer.get("scene["+panoid+"].titleid");            

   //HTML tags with this class (panorama-title) will display the current panorama title
   jQuery('.panorama-title').html(ktools.I18N.getInstance().getMessage(titleid));

   //HTML tags with this class (panorama-desc) will display the current panorama description
   var descriptionid = panotourPlayer.get("scene["+panoid+"].descriptionid");
      if (descriptionid != "") {
         jQuery('.panorama-desc').show();
         jQuery('.panorama-desc').html(ktools.I18N.getInstance().getMessage(descriptionid));               
      }else {
         jQuery('.panorama-desc').hide();
      }
               
   }
</script>


You will need the Bootstarp external plugin installed as well.

Annis likes this post.


Who is online

Users browsing this forum: No registered users and 2 guests

cron