Page 1 of 1

Bootstrap Top Navbar Issues

PostPosted: Thu May 25, 2017 11:51 am
by GD-Steven
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?

Re: Bootstrap Top Navbar Issues

PostPosted: Thu May 25, 2017 9:50 pm
by 360-compunics-com-ni
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.

Re: Bootstrap Top Navbar Issues  [SOLVED]

PostPosted: Mon May 29, 2017 9:39 am
by bdd
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