New Template System in LS3.x/19/en: Difference between revisions
From LimeSurvey Manual
(Importing a new version from external source) |
(Importing a new version from external source) |
||
Line 1: | Line 1: | ||
The button '''Copy to local | The button '''Copy to local theme and save changes''' will do exactly what it says: if you edit anything inside the file and then click on that button, it will copy the file to the theme you’re editing, and save your changes. | ||
<br> | <br> | ||
For example: click on the file layout_global.twig, then just before the block content ( {% block content %}) add the text “TEST” and click the button. You can see that the label of the file changed from “inherited” to “local” and now the button is a simple button '''save changes'''. | For example: click on the file layout_global.twig, then just before the block content ( {% block content %}) add the text “TEST” and click the button. You can see that the label of the file changed from “inherited” to “local” and now the button is a simple button '''save changes'''. | ||
[[File:After edition.png|center|''just after clicking on the button'']] | [[File:After edition.png|center|''just after clicking on the button'']] | ||
<br> | <br> | ||
If you open a file explorer and go to the directory upload/ | If you open a file explorer and go to the directory upload/themes/extends_monochrome/views/, you will see that it contains only one file, the file layout_global.twig and that the string “TEST” is there. | ||
[[File:Tree with layout global arrow.png|center|''Now the file is present in your | [[File:Tree with layout global arrow.png|center|''Now the file is present in your theme'']] | ||
<br><br> | <br><br> | ||
Now instead of addind a random text, we will add a picture. If you click on the tip link, it will tell you: | Now instead of addind a random text, we will add a picture. If you click on the tip link, it will tell you: |
Latest revision as of 20:15, 12 June 2019
The button Copy to local theme and save changes will do exactly what it says: if you edit anything inside the file and then click on that button, it will copy the file to the theme you’re editing, and save your changes.
For example: click on the file layout_global.twig, then just before the block content ( {% block content %}) add the text “TEST” and click the button. You can see that the label of the file changed from “inherited” to “local” and now the button is a simple button save changes.
If you open a file explorer and go to the directory upload/themes/extends_monochrome/views/, you will see that it contains only one file, the file layout_global.twig and that the string “TEST” is there.
Now instead of addind a random text, we will add a picture. If you click on the tip link, it will tell you:
To use a picture in a .twig file:
{{ image('./files/myfile.png', 'alt-text for my file', {"class": "myclass"}) }}
If you have read the Twig documentation (and you should have done so at this point), you know that {{ function( ) }} will echo the result of a function on screen. Here, the function is image( ).