- Posts: 222
- Thank you received: 10
Ask the community, share ideas, and connect with other LimeSurvey users!
tpartner wrote: Copy nav_bar.twig to your extended theme directory (using the same file structure as that in vanilla). Then changes in that file will apply regardless of theme dependencies.
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>