Actions

Translations

New Template System in LS3.x/20/en: Difference between revisions

From LimeSurvey Manual

(Importing a new version from external source)
 
(Importing a new version from external source)
 
Line 4: Line 4:
<br>
<br>
You should use the function image() for two reasons:
You should use the function image() for two reasons:
* The function image loops through the template to find the image. If the template you’re working on is extended to another template, and if you copy the file to where you inserted the picture locally, but that picture is not copied in the local template, it will loop through the template inheritance tree to find where that picture is.
* The function image loops through the theme to find the image. If the theme you’re working on is extended to another theme, and if you copy the file to where you inserted the picture locally, but that picture is not copied in the local theme, it will loop through the theme inheritance tree to find where that picture is.
* It will use the asset manager, so it will improve the performance of your template. See the Yii Asset Manager documentation for more information about it: http://www.yiiframework.com/wiki/148/understanding-assets/
* It will use the asset manager, so it will improve the performance of your theme. See the Yii Asset Manager documentation for more information about it: http://www.yiiframework.com/wiki/148/understanding-assets/

Latest revision as of 20:15, 12 June 2019

Message definition (New Template System in LS3.x)
<div class="simplebox">[[File:help.png]]  If you’re curious to know what it does, you can find it in the code here (version of RC3): [https://github.com/LimeSurvey/LimeSurvey/blob/f3737a75e428f604d68d2e5ba958f3eba3eba2e1/application/core/LS_Twig_Extension.php#L219-L237 image() function in RC3]
If you don’t understand the code: don’t worry, you don’t need to know how it works, but why to use it and how to use it.
</div>
<br>
You should use the function image() for two reasons:
* The function image loops through the theme to find the image. If the theme you’re working on is extended to another theme, and if you copy the file to where you inserted the picture locally, but that picture is not copied in the local theme, it will loop through the theme inheritance tree to find where that picture is.
* It will use the asset manager, so it will improve the performance of your theme. See the Yii Asset Manager documentation for more information about it: http://www.yiiframework.com/wiki/148/understanding-assets/
If you’re curious to know what it does, you can find it in the code here (version of RC3): image() function in RC3

If you don’t understand the code: don’t worry, you don’t need to know how it works, but why to use it and how to use it.


You should use the function image() for two reasons:

  • The function image loops through the theme to find the image. If the theme you’re working on is extended to another theme, and if you copy the file to where you inserted the picture locally, but that picture is not copied in the local theme, it will loop through the theme inheritance tree to find where that picture is.
  • It will use the asset manager, so it will improve the performance of your theme. See the Yii Asset Manager documentation for more information about it: http://www.yiiframework.com/wiki/148/understanding-assets/