Actions

Translations

New Template System in LS3.x/19/nl: Difference between revisions

From LimeSurvey Manual

(Created page with "De knop '''Kopieer naar lokaal sjabloon en wijzigingen opslaan''' doet wat het zegt. Als je iets in het bestand wijzigt dan wordt de wijziging in dat bestand opgeslagen. <br>...")
 
No edit summary
Line 2: Line 2:
<br>
<br>
Als je klikt op het bestand layout_global.twig, en net voor de regel met ''{% block content %}'''' de tekst “TEST” toevoegt en dan op de knop tikt, dan zie je dat het keyword bij dit bestand is gewijzigd van “inherited” in “local”, de knoptekst is nu ook weer '''Bewaar wijzigingen'''.  
Als je klikt op het bestand layout_global.twig, en net voor de regel met ''{% block content %}'''' de tekst “TEST” toevoegt en dan op de knop tikt, dan zie je dat het keyword bij dit bestand is gewijzigd van “inherited” in “local”, de knoptekst is nu ook weer '''Bewaar wijzigingen'''.  
[[File:After edition.png|center|''net na het klikken op de knop''|]]
[[File:After edition.png|center|''net na het klikken op de knop'']]
<br>
<br>
If you open a file explorer and go to the directory upload/templates/extends_monochrome/views/, you will see that it contains only one file, the file layout_global.twig and that the string “TEST” is there.
If you open a file explorer and go to the directory upload/templates/extends_monochrome/views/, you will see that it contains only one file, the file layout_global.twig and that the string “TEST” is there.

Revision as of 12:41, 31 March 2018

Message definition (New Template System in LS3.x)
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>
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'']]
<br>
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 theme'']]
<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:
<br>
To use a picture in a .twig file:
'''{{ image('./files/myfile.png', 'alt-text for my file', {"class": "myclass"}) }}'''
<br>
If you have read the Twig documentation (and you should have done so at this point), you know that '''&#123;&#123; function( ) }}<nowiki />''' will echo the result of a function on screen. Here, the function is image( ).

De knop Kopieer naar lokaal sjabloon en wijzigingen opslaan doet wat het zegt. Als je iets in het bestand wijzigt dan wordt de wijziging in dat bestand opgeslagen.
Als je klikt op het bestand layout_global.twig, en net voor de regel met {% block content %}'' de tekst “TEST” toevoegt en dan op de knop tikt, dan zie je dat het keyword bij dit bestand is gewijzigd van “inherited” in “local”, de knoptekst is nu ook weer Bewaar wijzigingen.

net na het klikken op de knop
net na het klikken op de knop


If you open a file explorer and go to the directory upload/templates/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 the file is present in your template
Now the file is present in your template



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( ).