Bootstrap Top Navbar Issues   [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
GD-Steven
New member
 
Topic author
Posts: 1
Likes: 1 post
Liked in: 0 post
Joined: Thu May 25, 2017 11:29 am
Info

Bootstrap Top Navbar Issues

by GD-Steven » Thu May 25, 2017 11:51 am

Hi,

I'm new to Panotour and I'm trying to figure out how to customise the Boostrap Top Navbar Template.

I want certain PanoGroups that the name contains a particular string to be a simple list item that links to the first of the group instead of a dropdown with all the elements shown.

I have tried checking the name of the PanoGroup and if it contains a particular substring then create a list item, this would happen after the if group.isExplicit statement.

For example,
Code: Select all
{% if group.isExplicit %}
    {% if "groupsingle" in  group.description.name %}
         ......Create list item with the group name and first pano link
    {% else %}
        .......Create the select dropdown (the code that is already there)
    {% endif %}
    .....Rest of the normal code
{% endif %}

However, when I have tried building the project after this change, it would return saying "if statement improperly formatted".

I have checked the documentation and have tried the if statement with particular strings i.e
Code: Select all
{% if "abc" in  "abcdef" %}


Does anyone see what I am doing wrong? Or is there a different method to do what I am trying to do? Or some in-built function that I am missing?

User avatar
360-compunics-com-ni
Member
 
Posts: 417
Likes: 15 posts
Liked in: 163 posts
Joined: Wed Dec 17, 2014 12:37 am
Location: León, Nicaragua
Info

Re: Bootstrap Top Navbar Issues

by 360-compunics-com-ni » Thu May 25, 2017 9:50 pm

Not sure which Django version introduced the "in" operator, but i suppose it's because of this that the string comparison does not work as expected. Maybe someone from Kolor can verify this - the plugin documentation links to version 1.1 of the Django builtins, which is from 2009.
Out now: DeviceCheck for PTP plugins! https://www.kolor.com/forum/viewtopic.php?f=40&t=37446

Want to know how clients use your tours? Google Analytics Track Events plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=34442

Add actions to your hotspots: Hotspot Actionlist plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=35829

User avatar
bdd
Kolor Team
 
Posts: 2788
Likes: 14 posts
Liked in: 126 posts
Joined: Tue Jan 18, 2011 4:05 pm
Info

Re: Bootstrap Top Navbar Issues  [SOLVED]

by bdd » Mon May 29, 2017 9:39 am

Sorry, the "in" django operator is not implemented in the grantlee library used by Panotour 2.5.7 .

Grantlee syntax is a Django like syntax, but it's an old one, and it is a simplified one.

http://www.grantlee.org/apidox/differences_django.html

We will see if we can update Grantlee, or if we can add this operator by ourself in a future version .

Gérald

2 people like this post.


Who is online

Users browsing this forum: No registered users and 1 guest