- Posts: 14454
- Thank you received: 4392
Ask the community, share ideas, and connect with other LimeSurvey users!
it didn't come to my mind to use it.{% if( aSurveyInfo.options.brandlogo == "on") %}
tpartner wrote: No, you should not be doing anything with the core vanilla or bootswatch theme directories. They will be over-written on updating.
I am responding from my phone and memory this week so I may make some mistakes on the file structure but...
My understanding is that you have extended (copied) bootswatch. This should create a directory:
/upload/themes/survey/yourThemeName/
Now the theme dependency/inheritance ladder is:
- vanilla
- bootswatch
- yourThemeName
So, if you copy nav_bar.twig into...
/upload/themes/survey/yourThemeName/views/subviews/header/
...it will automatically override any copy of that file in the parent themes (bootswatch and vanilla).
You may not be able to see that new file in the template editor but any changes made in a plain-text editor and uploaded via FTP will be applied.
tpartner wrote: You can use an IF() statement in the twig file so only one image (depending on language) is loaded. This will reduce server load and browser load-time. I'll give an example next week when I get back to the world.
I don't know. Contact support and ask there. As far as I am concerned all twig files that now replace the old .pstpl files should be available in the theme editor. (but maybe they are still working on that)Can this be done when you use LS in their cloud and not installed on your server?
tpartner wrote:
I don't know. Contact support and ask there. As far as I am concerned all twig files that now replace the old .pstpl files should be available in the theme editor. (but maybe they are still working on that)Can this be done when you use LS in their cloud and not installed on your server?
tpartner wrote: Yes but my statement "all twig files that now replace the old .pstpl files should be available in the theme editor" still stands. In other words, if it was previously possible to edit an element in the GUI, it should still be possible.
<file type="view" role="subview">./subviews/navigation/clearall_links.twig</file>
LouisGac wrote:
tpartner wrote: Yes but my statement "all twig files that now replace the old .pstpl files should be available in the theme editor" still stands. In other words, if it was previously possible to edit an element in the GUI, it should still be possible.
yes we should add a new "screen" with all twig files.
For now, if you want to add a twig file in the ThemeEditor list:
1. Open the config.xml of your theme.
2. In the engine>template_editor section
3. Find the screen that interest you. For exemple, for the welcome page:
github.com/LimeSurvey/LimeSurvey/blob/b3...config.xml#L119-L137
4. Here, just add the twig files you want. For example:Code:<file type="view" role="subview">./subviews/navigation/clearall_links.twig</file>
LouisGac wrote: krosser: if you're a limeSurvey Pro user I can do it live for you
{# Logo option #} {% if( aSurveyInfo.options.brandlogo == "on") %} <div class="{{ aSurveyInfo.class.navbarbrand }} logo-container hidden-xs" {{ aSurveyInfo.attr.navbarbrand }} > {% if( aSurveyInfo.surveyls_language == "en") %} {{ image('./files/logo_en.png', 'English logo', {"class": "logo-en"}) }} {% elseif( aSurveyInfo.surveyls_language == "fr") %} {{ image('./files/logo_fr.png', 'French logo', {"class": "logo-fr"}) }} {% else %} {{ image('./files/logo_default.png', 'Default logo', {"class": "logo-default"}) }} {% endif %} </div> {% else %} <div class="{{ aSurveyInfo.class.navbarbrand }}" {{ aSurveyInfo.attr.navbarbrand }} > {{ aSurveyInfo.name }} </div> {% endif %}
<div class="{{ aSurveyInfo.class.navbarbrand }} logo-container hidden-xs" {{ aSurveyInfo.attr.navbarbrand }} > {#{{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {"class": "logo img-responsive"}) }}#} {{ image('./files/logo-eng.png', 'alt-text for my file', {"class": "logo-en"}) }} {{ image('./files/logo-fr.png', 'alt-text for my file', {"class": "logo-fr"}) }} </div>
It looks like you did not upload the images to the correct location or with the wrong names.Unfortunately, this code did not work for me. Tried it in Vanilla and Bootswatch and it does not show any logos.