Actions

Translations

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

From LimeSurvey Manual

No edit summary
No edit summary
Line 1: Line 1:
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.
De knop '''Kopieer naar lokaal thema en wijzigingen opslaan''' doet wat het zegt. Als je iets in het bestand wijzigt dan wordt de wijziging in dat bestand opgeslagen.
<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>
Als je naar de map upload/templates/extends_monochrome/views/, gaat, dan zie je dat daar maar een bestand in staat, het bestand  layout_global.twig met de tekst “TEST”.
Als je naar de map upload/themas/extends_monochrome/views/, gaat, dan zie je dat daar maar een bestand in staat, het bestand  layout_global.twig met de tekst “TEST”.
[[File:Tree with layout global arrow.png|center|''Het bestand is aanwezig in je sjabloon'']]
[[File:Tree with layout global arrow.png|center|''Het bestand is aanwezig in je thema'']]
<br><br>
<br><br>
We voegen nu een afbeelding toe in plaats van een tekst.  Klik op de link ''tip'':
We voegen nu een afbeelding toe in plaats van een tekst.  Klik op de link ''tip'':

Revision as of 19:42, 14 May 2019

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 thema 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


Als je naar de map upload/themas/extends_monochrome/views/, gaat, dan zie je dat daar maar een bestand in staat, het bestand layout_global.twig met de tekst “TEST”.

Het bestand is aanwezig in je thema
Het bestand is aanwezig in je thema



We voegen nu een afbeelding toe in plaats van een tekst. Klik op de link tip:
Om een afbeelding in een twig-bestand te gebruiken: {{ image('./files/myfile.png', 'alt-text for my file', {"class": "myclass"}) }}
Je hebt natuurlijk de Twig-documentatie al eens een keer gelezen en je weet dan ook dat bij {{ }} de inhoud tussen de haakjes, dus hier het resultaat van de function image( ) op het scherm wordt getoond.