<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.limesurvey.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=LouisGac</id>
	<title>LimeSurvey Manual - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.limesurvey.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=LouisGac"/>
	<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/Special:Contributions/LouisGac"/>
	<updated>2026-08-15T19:23:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=132485</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=132485"/>
		<updated>2018-12-20T10:30:30Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The manifest config.xml */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration.  So each time you modify the manifest of a theme, you must uninstall and reinstall it (or just reset it). Because this process is annoying while developing a theme you can force the direct usage of the XML file rather than the DB entries. To do so, in config.phpn turn on debug mode and &#039;force_xmlsettings_for_survey_rendering&#039; to true.&lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;extends&amp;gt;parent_theme&amp;lt;/extends&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &lt;br /&gt;
* &#039;&#039;&#039;extends&#039;&#039;&#039;: optional, it defines the parent themes. So if any file is not present in this theme (twig/js/css/jpg, etc) it will look for it in the parent theme&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you extended one of the the 3 core themes (Vanilla, Bootswatch, Fruity), you can change the &amp;quot;extends&amp;quot; value from one parent theme to the other. Of course, you&#039;ll have to reset the theme. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/ajaxify.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/theme.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/ajaxify.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/custom.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extends your theme via the theme editor, all those files will be inherited in his theme. The keywords refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]   Remember you can set in config.php &#039;force_xmlsettings_for_survey_rendering&#039; so configuration is read from XML instead of DB (no reset needed). This will make easier to test the modifications of the XML files, and will avoid you to uninstall/reinstall theme at each modification of the XML &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Inheritance tips  =====&lt;br /&gt;
As explained before, the &amp;quot;add&amp;quot; keyword can refer to a file being in one of the mother theme. So you can &amp;quot;add&amp;quot; a file in this section, and still not having this file in your theme, but in one of its parents theme. The engine will look into all its parent themes and will use the first one it finds. If it can&#039;t find the file, and debug mode is on in config, and js frontend debug mode is on in global setting, a message in console will warn you. Eg: if we add in a my_theme: &amp;lt;add&amp;gt;css/unexisting.css&amp;lt;/add&amp;gt;, in the console we&#039;ll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 (¯`·._.·(¯`·._.· Theme Configuration Error  ·._.·´¯)·._.·´¯) &lt;br /&gt;
&lt;br /&gt;
Can&#039;t find file &#039;css/unexisting.css&#039; defined in theme &#039;my_theme&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the debug mode is off, then no error at all will be seen. The engine will just ignore the wrong add statements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== When to use add, when to use replace, when can I just leave it to the parent theme?  =====&lt;br /&gt;
&lt;br /&gt;
First: add and replace are the very same keyword. You can use the one or the other, the engine will just do the same. They are distinct for human readers, so they understand what was your intention. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To make it clear, let&#039;s take the Fruity example. Here its css file section:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/variations/sea_green.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/animate.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you look to the custom.css file in fruity, it is exactly the same as the vanilla one. We could delete the custom.css file inside fruity, the one of vanilla would loaded. We could remove the statement &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; from the Fruity manifest, the statement from vanilla will be used, and the vanilla custom.css would be loaded. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So why do we use the statement  &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; inside the fruity manifest?  The answer is easy: because we want the end user to be able to extend the fruity theme, to modify the file in his local theme, and to load this modified file from his inherited theme.  To understand, just extend fruity and have a look to the extended theme. THe extended theme doesn&#039;t even have the file custom.css. So the one of fruity will be used. But: if the user create this file in the extended theme (by clicking on &amp;quot;extend&amp;quot; in the theme editor), then this file will be loaded from his theme. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So in general: &lt;br /&gt;
if you create a theme from scratch not extending any theme, just use the add statement to add your css/js files. Easy peasy.&lt;br /&gt;
if you create a theme extending another theme, and you don&#039;t want the users to be able to extends the css/js file from the mother theme: don&#039;t use the add statement in your manifest. THe files will still be loaded from the mother theme configuration.&lt;br /&gt;
if you create a theme extending another theme, and you want to replace a file from the mother theme: use the replace keyword (the add keyword will have the same result)&lt;br /&gt;
if you create a theme extending another theme, if you don&#039;t replace a given file from css/js, but you want the users to be able to extend this file: then use the &amp;quot;replace&amp;quot; statement in your manifest for this file. Even if you don&#039;t replace the file, by using the keyword replace in the manifest: you allow the user to do it if he wants to do it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only this very last case needs a bit of mental gymnastic ot understand, all the other cases are trivial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. Those files will be loaded only when the twig file is asked. If you want the users to be able to inherit those JS/Css files from the theme editor, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== The remove keyword  =====&lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Files you should not remove:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;jquery-3.1.1.min.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;jquery-migrate-3.0.0.min.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;survey.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;moment-with-locales.min.js&#039;&#039;&#039; : needed for date question type (and some other i think)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;em_javascript.js&#039;&#039;&#039; : needed for all Expression Manager javascript&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=132484</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=132484"/>
		<updated>2018-12-20T10:30:19Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The manifest config.xml */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration.  So each time you modify the manifest of a theme, you must uninstall and reinstall it (or just reset it). Because this process is annoying while developing a theme you can force the direct usage of the XML file rather than the DB entries. To do so, in config.phpn turn on debug mode and &#039;force_xmlsettings_for_survey_rendering&#039; to true.&lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;extends&amp;gt;parent_theme&amp;lt;/extends&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &lt;br /&gt;
* &#039;&#039;&#039;extends&#039;&#039;&#039;: optional, it defines the parent themes. So if any file is not present in this theme (twig/js/css/jpg, etc) it will look for it in the parent theme&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you extended one of the the 3 core themes (Vanilla, Bootswatch, Fruity), you can change the &amp;quot;extends&amp;quot; value from one parent theme to the other. Of course, you&#039;ll have to reset the theme. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/ajaxify.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/theme.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/ajaxify.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/custom.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extends your theme via the theme editor, all those files will be inherited in his theme. The keywords refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]   Remember you can set in config.php &#039;force_xmlsettings_for_survey_rendering&#039; so configuration is read from XML instead of DB (no reset needed). This will make easier to test the modifications of the XML files, and will avoid you to uninstall/reinstall theme at each modification of the XML &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Inheritance tips  =====&lt;br /&gt;
As explained before, the &amp;quot;add&amp;quot; keyword can refer to a file being in one of the mother theme. So you can &amp;quot;add&amp;quot; a file in this section, and still not having this file in your theme, but in one of its parents theme. The engine will look into all its parent themes and will use the first one it finds. If it can&#039;t find the file, and debug mode is on in config, and js frontend debug mode is on in global setting, a message in console will warn you. Eg: if we add in a my_theme: &amp;lt;add&amp;gt;css/unexisting.css&amp;lt;/add&amp;gt;, in the console we&#039;ll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 (¯`·._.·(¯`·._.· Theme Configuration Error  ·._.·´¯)·._.·´¯) &lt;br /&gt;
&lt;br /&gt;
Can&#039;t find file &#039;css/unexisting.css&#039; defined in theme &#039;my_theme&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the debug mode is off, then no error at all will be seen. The engine will just ignore the wrong add statements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== When to use add, when to use replace, when can I just leave it to the parent theme?  =====&lt;br /&gt;
&lt;br /&gt;
First: add and replace are the very same keyword. You can use the one or the other, the engine will just do the same. They are distinct for human readers, so they understand what was your intention. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To make it clear, let&#039;s take the Fruity example. Here its css file section:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/variations/sea_green.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/animate.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you look to the custom.css file in fruity, it is exactly the same as the vanilla one. We could delete the custom.css file inside fruity, the one of vanilla would loaded. We could remove the statement &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; from the Fruity manifest, the statement from vanilla will be used, and the vanilla custom.css would be loaded. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So why do we use the statement  &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; inside the fruity manifest?  The answer is easy: because we want the end user to be able to extend the fruity theme, to modify the file in his local theme, and to load this modified file from his inherited theme.  To understand, just extend fruity and have a look to the extended theme. THe extended theme doesn&#039;t even have the file custom.css. So the one of fruity will be used. But: if the user create this file in the extended theme (by clicking on &amp;quot;extend&amp;quot; in the theme editor), then this file will be loaded from his theme. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So in general: &lt;br /&gt;
if you create a theme from scratch not extending any theme, just use the add statement to add your css/js files. Easy peasy.&lt;br /&gt;
if you create a theme extending another theme, and you don&#039;t want the users to be able to extends the css/js file from the mother theme: don&#039;t use the add statement in your manifest. THe files will still be loaded from the mother theme configuration.&lt;br /&gt;
if you create a theme extending another theme, and you want to replace a file from the mother theme: use the replace keyword (the add keyword will have the same result)&lt;br /&gt;
if you create a theme extending another theme, if you don&#039;t replace a given file from css/js, but you want the users to be able to extend this file: then use the &amp;quot;replace&amp;quot; statement in your manifest for this file. Even if you don&#039;t replace the file, by using the keyword replace in the manifest: you allow the user to do it if he wants to do it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only this very last case needs a bit of mental gymnastic ot understand, all the other cases are trivial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. Those files will be loaded only when the twig file is asked. If you want the users to be able to inherit those JS/Css files from the theme editor, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== The remove keyword  =====&lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Files you should not remove:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;jquery-3.1.1.min.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;jquery-migrate-3.0.0.min.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;survey.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;moment-with-locales.min.js&#039;&#039;&#039; : needed for date question type (and some other i think)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;em_javascript.js&#039;&#039;&#039; : needed for all Expression Manager javascript&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=132483</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=132483"/>
		<updated>2018-12-20T10:24:41Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The metadata section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration.  So each time you modify the manifest of a theme, you must uninstall and reinstall it (or just reset it). Because this process is annoying while developing a theme you can force the direct usage of the XML file rather than the DB entries. To do so, in config.phpn turn on debug mode and &#039;force_xmlsettings_for_survey_rendering&#039; to true.&lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
        &amp;lt;extends&amp;gt;parent_theme&amp;lt;/extends&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &lt;br /&gt;
* &#039;&#039;&#039;extends&#039;&#039;&#039;: optional, it defines the parent themes. So if any file is not present in this theme (twig/js/css/jpg, etc) it will look for it in the parent theme&lt;br /&gt;
&amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/ajaxify.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/theme.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/ajaxify.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/custom.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extends your theme via the theme editor, all those files will be inherited in his theme. The keywords refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]   Remember you can set in config.php &#039;force_xmlsettings_for_survey_rendering&#039; so configuration is read from XML instead of DB (no reset needed). This will make easier to test the modifications of the XML files, and will avoid you to uninstall/reinstall theme at each modification of the XML &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Inheritance tips  =====&lt;br /&gt;
As explained before, the &amp;quot;add&amp;quot; keyword can refer to a file being in one of the mother theme. So you can &amp;quot;add&amp;quot; a file in this section, and still not having this file in your theme, but in one of its parents theme. The engine will look into all its parent themes and will use the first one it finds. If it can&#039;t find the file, and debug mode is on in config, and js frontend debug mode is on in global setting, a message in console will warn you. Eg: if we add in a my_theme: &amp;lt;add&amp;gt;css/unexisting.css&amp;lt;/add&amp;gt;, in the console we&#039;ll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 (¯`·._.·(¯`·._.· Theme Configuration Error  ·._.·´¯)·._.·´¯) &lt;br /&gt;
&lt;br /&gt;
Can&#039;t find file &#039;css/unexisting.css&#039; defined in theme &#039;my_theme&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the debug mode is off, then no error at all will be seen. The engine will just ignore the wrong add statements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== When to use add, when to use replace, when can I just leave it to the parent theme?  =====&lt;br /&gt;
&lt;br /&gt;
First: add and replace are the very same keyword. You can use the one or the other, the engine will just do the same. They are distinct for human readers, so they understand what was your intention. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To make it clear, let&#039;s take the Fruity example. Here its css file section:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/variations/sea_green.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/animate.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you look to the custom.css file in fruity, it is exactly the same as the vanilla one. We could delete the custom.css file inside fruity, the one of vanilla would loaded. We could remove the statement &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; from the Fruity manifest, the statement from vanilla will be used, and the vanilla custom.css would be loaded. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So why do we use the statement  &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; inside the fruity manifest?  The answer is easy: because we want the end user to be able to extend the fruity theme, to modify the file in his local theme, and to load this modified file from his inherited theme.  To understand, just extend fruity and have a look to the extended theme. THe extended theme doesn&#039;t even have the file custom.css. So the one of fruity will be used. But: if the user create this file in the extended theme (by clicking on &amp;quot;extend&amp;quot; in the theme editor), then this file will be loaded from his theme. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So in general: &lt;br /&gt;
if you create a theme from scratch not extending any theme, just use the add statement to add your css/js files. Easy peasy.&lt;br /&gt;
if you create a theme extending another theme, and you don&#039;t want the users to be able to extends the css/js file from the mother theme: don&#039;t use the add statement in your manifest. THe files will still be loaded from the mother theme configuration.&lt;br /&gt;
if you create a theme extending another theme, and you want to replace a file from the mother theme: use the replace keyword (the add keyword will have the same result)&lt;br /&gt;
if you create a theme extending another theme, if you don&#039;t replace a given file from css/js, but you want the users to be able to extend this file: then use the &amp;quot;replace&amp;quot; statement in your manifest for this file. Even if you don&#039;t replace the file, by using the keyword replace in the manifest: you allow the user to do it if he wants to do it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only this very last case needs a bit of mental gymnastic ot understand, all the other cases are trivial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. Those files will be loaded only when the twig file is asked. If you want the users to be able to inherit those JS/Css files from the theme editor, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== The remove keyword  =====&lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Files you should not remove:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;jquery-3.1.1.min.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;jquery-migrate-3.0.0.min.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;survey.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;moment-with-locales.min.js&#039;&#039;&#039; : needed for date question type (and some other i think)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;em_javascript.js&#039;&#039;&#039; : needed for all Expression Manager javascript&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=132146</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=132146"/>
		<updated>2018-12-04T16:47:28Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The remove keyword */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration.  So each time you modify the manifest of a theme, you must uninstall and reinstall it (or just reset it). Because this process is annoying while developing a theme you can force the direct usage of the XML file rather than the DB entries. To do so, in config.phpn turn on debug mode and &#039;force_xmlsettings_for_survey_rendering&#039; to true.&lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/ajaxify.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/theme.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/ajaxify.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/custom.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extends your theme via the theme editor, all those files will be inherited in his theme. The keywords refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]   Remember you can set in config.php &#039;force_xmlsettings_for_survey_rendering&#039; so configuration is read from XML instead of DB (no reset needed). This will make easier to test the modifications of the XML files, and will avoid you to uninstall/reinstall theme at each modification of the XML &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Inheritance tips  =====&lt;br /&gt;
As explained before, the &amp;quot;add&amp;quot; keyword can refer to a file being in one of the mother theme. So you can &amp;quot;add&amp;quot; a file in this section, and still not having this file in your theme, but in one of its parents theme. The engine will look into all its parent themes and will use the first one it finds. If it can&#039;t find the file, and debug mode is on in config, and js frontend debug mode is on in global setting, a message in console will warn you. Eg: if we add in a my_theme: &amp;lt;add&amp;gt;css/unexisting.css&amp;lt;/add&amp;gt;, in the console we&#039;ll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 (¯`·._.·(¯`·._.· Theme Configuration Error  ·._.·´¯)·._.·´¯) &lt;br /&gt;
&lt;br /&gt;
Can&#039;t find file &#039;css/unexisting.css&#039; defined in theme &#039;my_theme&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the debug mode is off, then no error at all will be seen. The engine will just ignore the wrong add statements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== When to use add, when to use replace, when can I just leave it to the parent theme?  =====&lt;br /&gt;
&lt;br /&gt;
First: add and replace are the very same keyword. You can use the one or the other, the engine will just do the same. They are distinct for human readers, so they understand what was your intention. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To make it clear, let&#039;s take the Fruity example. Here its css file section:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/variations/sea_green.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/animate.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you look to the custom.css file in fruity, it is exactly the same as the vanilla one. We could delete the custom.css file inside fruity, the one of vanilla would loaded. We could remove the statement &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; from the Fruity manifest, the statement from vanilla will be used, and the vanilla custom.css would be loaded. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So why do we use the statement  &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; inside the fruity manifest?  The answer is easy: because we want the end user to be able to extend the fruity theme, to modify the file in his local theme, and to load this modified file from his inherited theme.  To understand, just extend fruity and have a look to the extended theme. THe extended theme doesn&#039;t even have the file custom.css. So the one of fruity will be used. But: if the user create this file in the extended theme (by clicking on &amp;quot;extend&amp;quot; in the theme editor), then this file will be loaded from his theme. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So in general: &lt;br /&gt;
if you create a theme from scratch not extending any theme, just use the add statement to add your css/js files. Easy peasy.&lt;br /&gt;
if you create a theme extending another theme, and you don&#039;t want the users to be able to extends the css/js file from the mother theme: don&#039;t use the add statement in your manifest. THe files will still be loaded from the mother theme configuration.&lt;br /&gt;
if you create a theme extending another theme, and you want to replace a file from the mother theme: use the replace keyword (the add keyword will have the same result)&lt;br /&gt;
if you create a theme extending another theme, if you don&#039;t replace a given file from css/js, but you want the users to be able to extend this file: then use the &amp;quot;replace&amp;quot; statement in your manifest for this file. Even if you don&#039;t replace the file, by using the keyword replace in the manifest: you allow the user to do it if he wants to do it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only this very last case needs a bit of mental gymnastic ot understand, all the other cases are trivial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. Those files will be loaded only when the twig file is asked. If you want the users to be able to inherit those JS/Css files from the theme editor, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== The remove keyword  =====&lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Files you should not remove:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;jquery-3.1.1.min.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;jquery-migrate-3.0.0.min.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;survey.js&#039;&#039;&#039; : needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;moment-with-locales.min.js&#039;&#039;&#039; : needed for date question type (and some other i think)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;em_javascript.js&#039;&#039;&#039; : needed for all Expression Manager javascript&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122178</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122178"/>
		<updated>2018-08-13T14:41:20Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The files section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration.  So each time you modify the manifest of a theme, you must uninstall and reinstall it (or just reset it). Because this process is annoying while developing a theme you can force the direct usage of the XML file rather than the DB entries. To do so, in config.phpn turn on debug mode and &#039;force_xmlsettings_for_survey_rendering&#039; to true.&lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/ajaxify.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/theme.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/ajaxify.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;scripts/custom.js&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extends your theme via the theme editor, all those files will be inherited in his theme. The keywords refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]   Remember you can set in config.php &#039;force_xmlsettings_for_survey_rendering&#039; so configuration is read from XML instead of DB (no reset needed). This will make easier to test the modifications of the XML files, and will avoid you to uninstall/reinstall theme at each modification of the XML &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Inheritance tips  =====&lt;br /&gt;
As explained before, the &amp;quot;add&amp;quot; keyword can refer to a file being in one of the mother theme. So you can &amp;quot;add&amp;quot; a file in this section, and still not having this file in your theme, but in one of its parents theme. The engine will look into all its parent themes and will use the first one it finds. If it can&#039;t find the file, and debug mode is on in config, and js frontend debug mode is on in global setting, a message in console will warn you. Eg: if we add in a my_theme: &amp;lt;add&amp;gt;css/unexisting.css&amp;lt;/add&amp;gt;, in the console we&#039;ll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 (¯`·._.·(¯`·._.· Theme Configuration Error  ·._.·´¯)·._.·´¯) &lt;br /&gt;
&lt;br /&gt;
Can&#039;t find file &#039;css/unexisting.css&#039; defined in theme &#039;my_theme&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the debug mode is off, then no error at all will be seen. The engine will just ignore the wrong add statements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== When to use add, when to use replace, when can I just leave it to the parent theme?  =====&lt;br /&gt;
&lt;br /&gt;
First: add and replace are the very same keyword. You can use the one or the other, the engine will just do the same. They are distinct for human readers, so they understand what was your intention. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To make it clear, let&#039;s take the Fruity example. Here its css file section:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/variations/sea_green.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/animate.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you look to the custom.css file in fruity, it is exactly the same as the vanilla one. We could delete the custom.css file inside fruity, the one of vanilla would loaded. We could remove the statement &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; from the Fruity manifest, the statement from vanilla will be used, and the vanilla custom.css would be loaded. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So why do we use the statement  &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; inside the fruity manifest?  The answer is easy: because we want the end user to be able to extend the fruity theme, to modify the file in his local theme, and to load this modified file from his inherited theme.  To understand, just extend fruity and have a look to the extended theme. THe extended theme doesn&#039;t even have the file custom.css. So the one of fruity will be used. But: if the user create this file in the extended theme (by clicking on &amp;quot;extend&amp;quot; in the theme editor), then this file will be loaded from his theme. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So in general: &lt;br /&gt;
if you create a theme from scratch not extending any theme, just use the add statement to add your css/js files. Easy peasy.&lt;br /&gt;
if you create a theme extending another theme, and you don&#039;t want the users to be able to extends the css/js file from the mother theme: don&#039;t use the add statement in your manifest. THe files will still be loaded from the mother theme configuration.&lt;br /&gt;
if you create a theme extending another theme, and you want to replace a file from the mother theme: use the replace keyword (the add keyword will have the same result)&lt;br /&gt;
if you create a theme extending another theme, if you don&#039;t replace a given file from css/js, but you want the users to be able to extend this file: then use the &amp;quot;replace&amp;quot; statement in your manifest for this file. Even if you don&#039;t replace the file, by using the keyword replace in the manifest: you allow the user to do it if he wants to do it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only this very last case needs a bit of mental gymnastic ot understand, all the other cases are trivial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. Those files will be loaded only when the twig file is asked. If you want the users to be able to inherit those JS/Css files from the theme editor, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== The remove keyword  =====&lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122177</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122177"/>
		<updated>2018-08-13T13:05:22Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* When to use add, when to use replace, when can I just leave it to the parent theme? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration.  So each time you modify the manifest of a theme, you must uninstall and reinstall it (or just reset it). Because this process is annoying while developing a theme you can force the direct usage of the XML file rather than the DB entries. To do so, in config.phpn turn on debug mode and &#039;force_xmlsettings_for_survey_rendering&#039; to true.&lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extends your theme via the theme editor, all those files will be inherited in his theme. The keywords refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]   Remember you can set in config.php &#039;force_xmlsettings_for_survey_rendering&#039; so configuration is read from XML instead of DB (no reset needed). This will make easier to test the modifications of the XML files, and will avoid you to uninstall/reinstall theme at each modification of the XML &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Inheritance tips  =====&lt;br /&gt;
As explained before, the &amp;quot;add&amp;quot; keyword can refer to a file being in one of the mother theme. So you can &amp;quot;add&amp;quot; a file in this section, and still not having this file in your theme, but in one of its parents theme. The engine will look into all its parent themes and will use the first one it finds. If it can&#039;t find the file, and debug mode is on in config, and js frontend debug mode is on in global setting, a message in console will warn you. Eg: if we add in a my_theme: &amp;lt;add&amp;gt;css/unexisting.css&amp;lt;/add&amp;gt;, in the console we&#039;ll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 (¯`·._.·(¯`·._.· Theme Configuration Error  ·._.·´¯)·._.·´¯) &lt;br /&gt;
&lt;br /&gt;
Can&#039;t find file &#039;css/unexisting.css&#039; defined in theme &#039;my_theme&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the debug mode is off, then no error at all will be seen. The engine will just ignore the wrong add statements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== When to use add, when to use replace, when can I just leave it to the parent theme?  =====&lt;br /&gt;
&lt;br /&gt;
First: add and replace are the very same keyword. You can use the one or the other, the engine will just do the same. They are distinct for human readers, so they understand what was your intention. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To make it clear, let&#039;s take the Fruity example. Here its css file section:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/variations/sea_green.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/animate.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you look to the custom.css file in fruity, it is exactly the same as the vanilla one. We could delete the custom.css file inside fruity, the one of vanilla would loaded. We could remove the statement &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; from the Fruity manifest, the statement from vanilla will be used, and the vanilla custom.css would be loaded. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So why do we use the statement  &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; inside the fruity manifest?  The answer is easy: because we want the end user to be able to extend the fruity theme, to modify the file in his local theme, and to load this modified file from his inherited theme.  To understand, just extend fruity and have a look to the extended theme. THe extended theme doesn&#039;t even have the file custom.css. So the one of fruity will be used. But: if the user create this file in the extended theme (by clicking on &amp;quot;extend&amp;quot; in the theme editor), then this file will be loaded from his theme. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So in general: &lt;br /&gt;
if you create a theme from scratch not extending any theme, just use the add statement to add your css/js files. Easy peasy.&lt;br /&gt;
if you create a theme extending another theme, and you don&#039;t want the users to be able to extends the css/js file from the mother theme: don&#039;t use the add statement in your manifest. THe files will still be loaded from the mother theme configuration.&lt;br /&gt;
if you create a theme extending another theme, and you want to replace a file from the mother theme: use the replace keyword (the add keyword will have the same result)&lt;br /&gt;
if you create a theme extending another theme, if you don&#039;t replace a given file from css/js, but you want the users to be able to extend this file: then use the &amp;quot;replace&amp;quot; statement in your manifest for this file. Even if you don&#039;t replace the file, by using the keyword replace in the manifest: you allow the user to do it if he wants to do it.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only this very last case needs a bit of mental gymnastic ot understand, all the other cases are trivial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. Those files will be loaded only when the twig file is asked. If you want the users to be able to inherit those JS/Css files from the theme editor, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== The remove keyword  =====&lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122176</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122176"/>
		<updated>2018-08-13T13:03:54Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The remove keyword */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration.  So each time you modify the manifest of a theme, you must uninstall and reinstall it (or just reset it). Because this process is annoying while developing a theme you can force the direct usage of the XML file rather than the DB entries. To do so, in config.phpn turn on debug mode and &#039;force_xmlsettings_for_survey_rendering&#039; to true.&lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extends your theme via the theme editor, all those files will be inherited in his theme. The keywords refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]   Remember you can set in config.php &#039;force_xmlsettings_for_survey_rendering&#039; so configuration is read from XML instead of DB (no reset needed). This will make easier to test the modifications of the XML files, and will avoid you to uninstall/reinstall theme at each modification of the XML &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Inheritance tips  =====&lt;br /&gt;
As explained before, the &amp;quot;add&amp;quot; keyword can refer to a file being in one of the mother theme. So you can &amp;quot;add&amp;quot; a file in this section, and still not having this file in your theme, but in one of its parents theme. The engine will look into all its parent themes and will use the first one it finds. If it can&#039;t find the file, and debug mode is on in config, and js frontend debug mode is on in global setting, a message in console will warn you. Eg: if we add in a my_theme: &amp;lt;add&amp;gt;css/unexisting.css&amp;lt;/add&amp;gt;, in the console we&#039;ll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 (¯`·._.·(¯`·._.· Theme Configuration Error  ·._.·´¯)·._.·´¯) &lt;br /&gt;
&lt;br /&gt;
Can&#039;t find file &#039;css/unexisting.css&#039; defined in theme &#039;my_theme&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the debug mode is off, then no error at all will be seen. The engine will just ignore the wrong add statements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== When to use add, when to use replace, when can I just leave it to the parent theme?  =====&lt;br /&gt;
&lt;br /&gt;
First: add and replace are the very same keyword. You can use the one or the other, the engine will just do the same. They are distinct for human readers, so they understand what was your intention. &lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. &lt;br /&gt;
&lt;br /&gt;
If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
To make it clear, let&#039;s take the Fruity example. Here its css file section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/variations/sea_green.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/animate.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you look to the custom.css file in fruity, it is exactly the same as the vanilla one. We could delete the custom.css file inside fruity, the one of vanilla would loaded. We could remove the statement &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; from the Fruity manifest, the statement from vanilla will be used, and the vanilla custom.css would be loaded. &lt;br /&gt;
&lt;br /&gt;
So why do we use the statement  &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; inside the fruity manifest?  The answer is easy: because we want the end user to be able to extend the fruity theme, to modify the file in his local theme, and to load this modified file from his inherited theme.  To understand, just extend fruity and have a look to the extended theme. THe extended theme doesn&#039;t even have the file custom.css. So the one of fruity will be used. But: if the user create this file in the extended theme (by clicking on &amp;quot;extend&amp;quot; in the theme editor), then this file will be loaded from his theme. &lt;br /&gt;
&lt;br /&gt;
So in general: &lt;br /&gt;
if you create a theme from scratch not extending any theme, just use the add statement to add your css/js files. Easy peasy.&lt;br /&gt;
if you create a theme extending another theme, and you don&#039;t want the users to be able to extends the css/js file from the mother theme: don&#039;t use the add statement in your manifest. THe files will still be loaded from the mother theme configuration.&lt;br /&gt;
if you create a theme extending another theme, and you want to replace a file from the mother theme: use the replace keyword (the add keyword will have the same result)&lt;br /&gt;
if you create a theme extending another theme, if you don&#039;t replace a given file from css/js, but you want the users to be able to extend this file: then use the &amp;quot;replace&amp;quot; statement in your manifest for this file. Even if you don&#039;t replace the file, by using the keyword replace in the manifest: you allow the user to do it if he wants to do it.  &lt;br /&gt;
&lt;br /&gt;
Only this very last case needs a bit of mental gymnastic ot understand, all the other cases are trivial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. Those files will be loaded only when the twig file is asked. If you want the users to be able to inherit those JS/Css files from the theme editor, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== The remove keyword  =====&lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122175</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122175"/>
		<updated>2018-08-13T12:59:27Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The manifest config.xml */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration.  So each time you modify the manifest of a theme, you must uninstall and reinstall it (or just reset it). Because this process is annoying while developing a theme you can force the direct usage of the XML file rather than the DB entries. To do so, in config.phpn turn on debug mode and &#039;force_xmlsettings_for_survey_rendering&#039; to true.&lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extends your theme via the theme editor, all those files will be inherited in his theme. The keywords refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]   Remember you can set in config.php &#039;force_xmlsettings_for_survey_rendering&#039; so configuration is read from XML instead of DB (no reset needed). This will make easier to test the modifications of the XML files, and will avoid you to uninstall/reinstall theme at each modification of the XML &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Inheritance tips  =====&lt;br /&gt;
As explained before, the &amp;quot;add&amp;quot; keyword can refer to a file being in one of the mother theme. So you can &amp;quot;add&amp;quot; a file in this section, and still not having this file in your theme, but in one of its parents theme. The engine will look into all its parent themes and will use the first one it finds. If it can&#039;t find the file, and debug mode is on in config, and js frontend debug mode is on in global setting, a message in console will warn you. Eg: if we add in a my_theme: &amp;lt;add&amp;gt;css/unexisting.css&amp;lt;/add&amp;gt;, in the console we&#039;ll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 (¯`·._.·(¯`·._.· Theme Configuration Error  ·._.·´¯)·._.·´¯) &lt;br /&gt;
&lt;br /&gt;
Can&#039;t find file &#039;css/unexisting.css&#039; defined in theme &#039;my_theme&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the debug mode is off, then no error at all will be seen. The engine will just ignore the wrong add statements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== When to use add, when to use replace, when can I just leave it to the parent theme?  =====&lt;br /&gt;
&lt;br /&gt;
First: add and replace are the very same keyword. You can use the one or the other, the engine will just do the same. They are distinct for human readers, so they understand what was your intention. &lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. &lt;br /&gt;
&lt;br /&gt;
If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
To make it clear, let&#039;s take the Fruity example. Here its css file section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/variations/sea_green.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/animate.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you look to the custom.css file in fruity, it is exactly the same as the vanilla one. We could delete the custom.css file inside fruity, the one of vanilla would loaded. We could remove the statement &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; from the Fruity manifest, the statement from vanilla will be used, and the vanilla custom.css would be loaded. &lt;br /&gt;
&lt;br /&gt;
So why do we use the statement  &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; inside the fruity manifest?  The answer is easy: because we want the end user to be able to extend the fruity theme, to modify the file in his local theme, and to load this modified file from his inherited theme.  To understand, just extend fruity and have a look to the extended theme. THe extended theme doesn&#039;t even have the file custom.css. So the one of fruity will be used. But: if the user create this file in the extended theme (by clicking on &amp;quot;extend&amp;quot; in the theme editor), then this file will be loaded from his theme. &lt;br /&gt;
&lt;br /&gt;
So in general: &lt;br /&gt;
if you create a theme from scratch not extending any theme, just use the add statement to add your css/js files. Easy peasy.&lt;br /&gt;
if you create a theme extending another theme, and you don&#039;t want the users to be able to extends the css/js file from the mother theme: don&#039;t use the add statement in your manifest. THe files will still be loaded from the mother theme configuration.&lt;br /&gt;
if you create a theme extending another theme, and you want to replace a file from the mother theme: use the replace keyword (the add keyword will have the same result)&lt;br /&gt;
if you create a theme extending another theme, if you don&#039;t replace a given file from css/js, but you want the users to be able to extend this file: then use the &amp;quot;replace&amp;quot; statement in your manifest for this file. Even if you don&#039;t replace the file, by using the keyword replace in the manifest: you allow the user to do it if he wants to do it.  &lt;br /&gt;
&lt;br /&gt;
Only this very last case needs a bit of mental gymnastic ot understand, all the other cases are trivial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. Those files will be loaded only when the twig file is asked. If you want the users to be able to inherit those JS/Css files from the theme editor, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== The remove keyword  =====&lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. But, if the CSS and JS files are inside the Theme itself, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122174</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122174"/>
		<updated>2018-08-13T12:47:15Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* When to use add, when to use replace, when can I just leave it to the parent theme? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extends your theme via the theme editor, all those files will be inherited in his theme. The keywords refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]   Remember you can set in config.php &#039;force_xmlsettings_for_survey_rendering&#039; so configuration is read from XML instead of DB (no reset needed). This will make easier to test the modifications of the XML files, and will avoid you to uninstall/reinstall theme at each modification of the XML &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Inheritance tips  =====&lt;br /&gt;
As explained before, the &amp;quot;add&amp;quot; keyword can refer to a file being in one of the mother theme. So you can &amp;quot;add&amp;quot; a file in this section, and still not having this file in your theme, but in one of its parents theme. The engine will look into all its parent themes and will use the first one it finds. If it can&#039;t find the file, and debug mode is on in config, and js frontend debug mode is on in global setting, a message in console will warn you. Eg: if we add in a my_theme: &amp;lt;add&amp;gt;css/unexisting.css&amp;lt;/add&amp;gt;, in the console we&#039;ll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 (¯`·._.·(¯`·._.· Theme Configuration Error  ·._.·´¯)·._.·´¯) &lt;br /&gt;
&lt;br /&gt;
Can&#039;t find file &#039;css/unexisting.css&#039; defined in theme &#039;my_theme&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the debug mode is off, then no error at all will be seen. The engine will just ignore the wrong add statements.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== When to use add, when to use replace, when can I just leave it to the parent theme?  =====&lt;br /&gt;
&lt;br /&gt;
First: add and replace are the very same keyword. You can use the one or the other, the engine will just do the same. They are distinct for human readers, so they understand what was your intention. &lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. &lt;br /&gt;
&lt;br /&gt;
If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
To make it clear, let&#039;s take the Fruity example. Here its css file section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/variations/sea_green.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/animate.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you look to the custom.css file in fruity, it is exactly the same as the vanilla one. We could delete the custom.css file inside fruity, the one of vanilla would loaded. We could remove the statement &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; from the Fruity manifest, the statement from vanilla will be used, and the vanilla custom.css would be loaded. &lt;br /&gt;
&lt;br /&gt;
So why do we use the statement  &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; inside the fruity manifest?  The answer is easy: because we want the end user to be able to extend the fruity theme, to modify the file in his local theme, and to load this modified file from his inherited theme.  To understand, just extend fruity and have a look to the extended theme. THe extended theme doesn&#039;t even have the file custom.css. So the one of fruity will be used. But: if the user create this file in the extended theme (by clicking on &amp;quot;extend&amp;quot; in the theme editor), then this file will be loaded from his theme. &lt;br /&gt;
&lt;br /&gt;
So in general: &lt;br /&gt;
if you create a theme from scratch not extending any theme, just use the add statement to add your css/js files. Easy peasy.&lt;br /&gt;
if you create a theme extending another theme, and you don&#039;t want the users to be able to extends the css/js file from the mother theme: don&#039;t use the add statement in your manifest. THe files will still be loaded from the mother theme configuration.&lt;br /&gt;
if you create a theme extending another theme, and you want to replace a file from the mother theme: use the replace keyword (the add keyword will have the same result)&lt;br /&gt;
if you create a theme extending another theme, if you don&#039;t replace a given file from css/js, but you want the users to be able to extend this file: then use the &amp;quot;replace&amp;quot; statement in your manifest for this file. Even if you don&#039;t replace the file, by using the keyword replace in the manifest: you allow the user to do it if he wants to do it.  &lt;br /&gt;
&lt;br /&gt;
Only this very last case needs a bit of mental gymnastic ot understand, all the other cases are trivial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. Those files will be loaded only when the twig file is asked. If you want the users to be able to inherit those JS/Css files from the theme editor, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== The remove keyword  =====&lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. But, if the CSS and JS files are inside the Theme itself, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122173</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122173"/>
		<updated>2018-08-13T12:45:05Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Inheritance tips */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extends your theme via the theme editor, all those files will be inherited in his theme. The keywords refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]   Remember you can set in config.php &#039;force_xmlsettings_for_survey_rendering&#039; so configuration is read from XML instead of DB (no reset needed). This will make easier to test the modifications of the XML files, and will avoid you to uninstall/reinstall theme at each modification of the XML &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Inheritance tips  =====&lt;br /&gt;
As explained before, the &amp;quot;add&amp;quot; keyword can refer to a file being in one of the mother theme. So you can &amp;quot;add&amp;quot; a file in this section, and still not having this file in your theme, but in one of its parents theme. The engine will look into all its parent themes and will use the first one it finds. If it can&#039;t find the file, and debug mode is on in config, and js frontend debug mode is on in global setting, a message in console will warn you. Eg: if we add in a my_theme: &amp;lt;add&amp;gt;css/unexisting.css&amp;lt;/add&amp;gt;, in the console we&#039;ll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 (¯`·._.·(¯`·._.· Theme Configuration Error  ·._.·´¯)·._.·´¯) &lt;br /&gt;
&lt;br /&gt;
Can&#039;t find file &#039;css/unexisting.css&#039; defined in theme &#039;my_theme&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the debug mode is off, then no error at all will be seen. The engine will just ignore the wrong add statements.&lt;br /&gt;
&lt;br /&gt;
===== When to use add, when to use replace, when can I just leave it to the parent theme?  =====&lt;br /&gt;
&lt;br /&gt;
First: add and replace are the very same keyword. You can use the one or the other, the engine will just do the same. They are distinct for human readers, so they understand what was your intention. &lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. &lt;br /&gt;
&lt;br /&gt;
If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
To make it clear, let&#039;s take the Fruity example. Here its css file section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/variations/sea_green.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/animate.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you look to the custom.css file in fruity, it is exactly the same as the vanilla one. We could delete the custom.css file inside fruity, the one of vanilla would loaded. We could remove the statement &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; from the Fruity manifest, the statement from vanilla will be used, and the vanilla custom.css would be loaded. &lt;br /&gt;
&lt;br /&gt;
So why do we use the statement  &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; inside the fruity manifest?  The answer is easy: because we want the end user to be able to extend the fruity theme, to modify the file in his local theme, and to load this modified file from his inherited theme.  To understand, just extend fruity and have a look to the extended theme. THe extended theme doesn&#039;t even have the file custom.css. So the one of fruity will be used. But: if the user create this file in the extended theme (by clicking on &amp;quot;extend&amp;quot; in the theme editor), then this file will be loaded from his theme. &lt;br /&gt;
&lt;br /&gt;
So in general: &lt;br /&gt;
if you create a theme from scratch not extending any theme, just use the add statement to add your css/js files. Easy peasy.&lt;br /&gt;
if you create a theme extending another theme, and you don&#039;t want the users to be able to extends the css/js file from the mother theme: don&#039;t use the add statement in your manifest. THe files will still be loaded from the mother theme configuration.&lt;br /&gt;
if you create a theme extending another theme, and you want to replace a file from the mother theme: use the replace keyword (the add keyword will have the same result)&lt;br /&gt;
if you create a theme extending another theme, if you don&#039;t replace a given file from css/js, but you want the users to be able to extend this file: then use the &amp;quot;replace&amp;quot; statement in your manifest for this file. Even if you don&#039;t replace the file, by using the keyword replace in the manifest: you allow the user to do it if he wants to do it.  &lt;br /&gt;
&lt;br /&gt;
Only this very last case needs a bit of mental gymnastic ot understand, all the other cases are trivial. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== The remove keyword  =====&lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. But, if the CSS and JS files are inside the Theme itself, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122172</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122172"/>
		<updated>2018-08-13T12:43:29Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The files section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extends your theme via the theme editor, all those files will be inherited in his theme. The keywords refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]   Remember you can set in config.php &#039;force_xmlsettings_for_survey_rendering&#039; so configuration is read from XML instead of DB (no reset needed). This will make easier to test the modifications of the XML files, and will avoid you to uninstall/reinstall theme at each modification of the XML &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
===== Inheritance tips  =====&lt;br /&gt;
As explained before, the &amp;quot;add&amp;quot; keyword can refer to a file being in one of the mother theme. So you can &amp;quot;add&amp;quot; a file in this section, and still not having this file in your theme, but in one of its parents theme. The engine will look into all its parent themes and will use the first one it finds. If it can&#039;t find the file, and debug mode is on in config, and js frontend debug mode is on in global setting, a message in console will warn you. Eg: if we add in a my_theme: &amp;lt;add&amp;gt;css/unexisting.css&amp;lt;/add&amp;gt;, in the console we&#039;ll see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
 (¯`·._.·(¯`·._.· Theme Configuration Error  ·._.·´¯)·._.·´¯) &lt;br /&gt;
&lt;br /&gt;
Can&#039;t find file &#039;css/unexisting.css&#039; defined in theme &#039;my_theme&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the debug mode is off, then no error at all will be seen. The engine will just ignore the wrong add statements. &lt;br /&gt;
&lt;br /&gt;
===== When to use add, when to use replace, when can I just leave it to the parent theme?  =====&lt;br /&gt;
&lt;br /&gt;
First: add and replace are the very same keyword. You can use the one or the other, the engine will just do the same. They are distinct for human readers, so they understand what was your intention. &lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. &lt;br /&gt;
&lt;br /&gt;
If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
To make it clear, let&#039;s take the Fruity example. Here its css file section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/variations/sea_green.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/animate.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/theme.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
            &amp;lt;replace&amp;gt;css/custom.css&amp;lt;/replace&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you look to the custom.css file in fruity, it is exactly the same as the vanilla one. We could delete the custom.css file inside fruity, the one of vanilla would loaded. We could remove the statement &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; from the Fruity manifest, the statement from vanilla will be used, and the vanilla custom.css would be loaded. &lt;br /&gt;
&lt;br /&gt;
So why do we use the statement  &amp;lt;replace&amp;gt;custom.css&amp;lt;/replace&amp;gt; inside the fruity manifest?  The answer is easy: because we want the end user to be able to extend the fruity theme, to modify the file in his local theme, and to load this modified file from his inherited theme.  To understand, just extend fruity and have a look to the extended theme. THe extended theme doesn&#039;t even have the file custom.css. So the one of fruity will be used. But: if the user create this file in the extended theme (by clicking on &amp;quot;extend&amp;quot; in the theme editor), then this file will be loaded from his theme. &lt;br /&gt;
&lt;br /&gt;
So in general: &lt;br /&gt;
if you create a theme from scratch not extending any theme, just use the add statement to add your css/js files. Easy peasy.&lt;br /&gt;
if you create a theme extending another theme, and you don&#039;t want the users to be able to extends the css/js file from the mother theme: don&#039;t use the add statement in your manifest. THe files will still be loaded from the mother theme configuration.&lt;br /&gt;
if you create a theme extending another theme, and you want to replace a file from the mother theme: use the replace keyword (the add keyword will have the same result)&lt;br /&gt;
if you create a theme extending another theme, if you don&#039;t replace a given file from css/js, but you want the users to be able to extend this file: then use the &amp;quot;replace&amp;quot; statement in your manifest for this file. Even if you don&#039;t replace the file, by using the keyword replace in the manifest: you allow the user to do it if he wants to do it.  &lt;br /&gt;
&lt;br /&gt;
Only this very last case needs a bit of mental gymnastic ot understand, all the other cases are trivial. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== The remove keyword  =====&lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. But, if the CSS and JS files are inside the Theme itself, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122171</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122171"/>
		<updated>2018-08-13T11:50:43Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme. It will be pushed in the table templates_configuration  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. It will be pushed in the table template_configuration, in the field 	files_css, files_js, 	files_print_css as json arrays.  &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extend your theme via the theme editor, all those files will be inherited in his theme. The keyword refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. But, if the CSS and JS files are inside the Theme itself, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== The options section ====&lt;br /&gt;
&lt;br /&gt;
This section is relative to the option of your theme. It will be used to feed the filed &amp;quot;options&amp;quot;  of the table template_configuration as a json array.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122170</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122170"/>
		<updated>2018-08-13T11:44:19Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extend your theme via the theme editor, all those files will be inherited in his theme. The keyword refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &lt;br /&gt;
You can also register CSS and JS files directly from the twig code. But, if the CSS and JS files are inside the Theme itself, remember to use the functions {{registerTemplateCssFile(&#039;my_style.css&#039;)}} and {{registerTemplateScript(&#039;my_script.js&#039;)}}. If you don&#039;t use those functions, your theme may work, but inheritance on it will be broken.  It is the same logic as the {{image(&#039;my_picture.jpg&#039;)}} function&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122169</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122169"/>
		<updated>2018-08-13T11:39:47Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The files section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extend your theme via the theme editor, all those files will be inherited in his theme. The keyword refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122168</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122168"/>
		<updated>2018-08-13T11:39:17Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The files section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extend your theme via the theme editor, all those files will be inherited in his theme. The keyword refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L54-L56&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;&lt;br /&gt;
        &#039;css&#039;=&amp;gt; array(&lt;br /&gt;
            &#039;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to find the exact name to use in the remove tag is to turn asset manager on (turning debug mode off or setting &#039;use_asset_manager&#039;=&amp;gt;true in the config). Then, the path to use will be the one just after the random directory in the tmp directory. For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/tmp/assets/cbc4e3cb/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122167</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122167"/>
		<updated>2018-08-13T11:33:12Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The files section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extend your theme via the theme editor, all those files will be inherited in his theme. The keyword refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;. So the keyword &amp;quot;add&amp;quot; can be used as a &amp;quot;replace&amp;quot; keyword. If you wonder why: this make much easier the automatic generation of inherited theme, copying the file section works out of the box (no need to rename &amp;quot;add&amp;quot; to &amp;quot;replace&amp;quot; when extending one the file). &lt;br /&gt;
&lt;br /&gt;
The remove keyword is available only since 3.14. With this one, you can remove any css/file from any package, even the core ones. It is used in Material Premium Theme to remove the Awseome Bootstrap Checkbox&#039;s files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so you should use the very same syntax as the package&#039;s file (eg: &amp;quot;awesome-bootstrap-checkbox.css&amp;quot; alone without it&#039;s folder path would not work). You&#039;ll find the complete list of core packages and their files in /application/config/packages.php and config/third_party.php:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/third_party.php&lt;br /&gt;
 &lt;br /&gt;
For example, for awesome-bootstrap-checkbox.css:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/config/packages.php#L55&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122166</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122166"/>
		<updated>2018-08-13T11:24:34Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The files section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extend your theme via the theme editor, all those files will be inherited in his theme. The keyword refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;add&#039;&#039;&#039; : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* &#039;&#039;&#039;replace&#039;&#039;&#039;: it will replace the the file of its mother theme&lt;br /&gt;
* &#039;&#039;&#039;remove&#039;&#039;&#039;: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package (since 3.14)&lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122165</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122165"/>
		<updated>2018-08-13T11:23:40Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The files section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. &lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extend your theme via the theme editor, all those files will be inherited in his theme. The keyword refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* add : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* replace: it will replace the the file of its mother theme&lt;br /&gt;
* remove: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package &lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122164</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122164"/>
		<updated>2018-08-13T11:23:00Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The files section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. &lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extend your theme via the theme editor, all those files will be inherited in his theme. The keyword refer to this inheritance system.&lt;br /&gt;
&lt;br /&gt;
Eg: the files section of the Material Premium Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;files&amp;gt;&lt;br /&gt;
        &amp;lt;css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/bootstrap-material-design.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ripples.min.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/ajaxify.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/custom.css&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;remove&amp;gt;awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/remove&amp;gt;&lt;br /&gt;
        &amp;lt;/css&amp;gt;&lt;br /&gt;
        &amp;lt;js&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/theme.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ajaxify.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/material.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/ripples.min.js&amp;lt;/add&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;scripts/custom.js&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/js&amp;gt;&lt;br /&gt;
        &amp;lt;print_css&amp;gt;&lt;br /&gt;
            &amp;lt;add&amp;gt;css/print_theme.css&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/print_css&amp;gt;&lt;br /&gt;
    &amp;lt;/files&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* replace: it will replace the the file of its mother theme&lt;br /&gt;
* remove: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package &lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122163</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122163"/>
		<updated>2018-08-13T11:20:57Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The manifest config.xml */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== The files section ====&lt;br /&gt;
&lt;br /&gt;
This one is an important one. &lt;br /&gt;
&lt;br /&gt;
All the CSS/JS files present in this section will be loaded at the launch of the survey (in ajax mode. If ajax mode is off, then of course all the files are reloaded at each page). &lt;br /&gt;
&lt;br /&gt;
They will be added to a Yii Asset Packet based on the name of the theme. So when Asset Manager is on (debug mode being off), those files will be copied to the tmp directory with the rest of the theme (so you can use relative path in the CSS and JS to reach the image files).  &lt;br /&gt;
About the Asset manager in Yii: https://www.yiiframework.com/wiki/148/understanding-assets &lt;br /&gt;
About packages in Yii: http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&lt;br /&gt;
They will use the inheritance system. It means that if you add a CSS/JS file to a theme, but it&#039;s not present in the theme, then the engine will look into all the mother themes of this theme and will use the first one it finds. So if a user extend your theme via the theme editor, all those files will be inherited in his theme. The keyword refer to this inheritance system:&lt;br /&gt;
&lt;br /&gt;
* add : it will add the file to the theme, and to all its inherited theme&lt;br /&gt;
* replace: it will replace the the file of its mother theme&lt;br /&gt;
* remove: it will remove the file from &#039;&#039;&#039;any&#039;&#039;&#039; package, even the core package &lt;br /&gt;
&lt;br /&gt;
Few remarks on those keywords: &lt;br /&gt;
&lt;br /&gt;
You can&#039;t add a file with the same name as the mother theme: it will always replace it. eg: If you have a file called &amp;quot;my_mother_theme/foo.css&amp;quot; and you add a file called &amp;quot;foo.cs&amp;quot; in the daughter theme, only  &amp;quot;daughter_theme/foo.css&amp;quot; will be added to the theme. If you want to keep &amp;quot;my_mother_theme/foo.css&amp;quot;, just choose another name for &amp;quot;daughter_theme/foo.css&amp;quot;, like &amp;quot;daughter_theme/bar.css&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122162</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122162"/>
		<updated>2018-08-13T11:08:29Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* theme structure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
=== The manifest config.xml ===&lt;br /&gt;
&lt;br /&gt;
The manifest of the theme contains the main informations about your theme. When you install a theme, the content of the manifest will be loaded in the database, in two different tables: template and template_configuration. &lt;br /&gt;
&lt;br /&gt;
==== The metadata section ====&lt;br /&gt;
&lt;br /&gt;
Nothing complex: just the main infos about your theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;metadata&amp;gt;&lt;br /&gt;
        &amp;lt;name&amp;gt;the_name_of_your_theme&amp;lt;/name&amp;gt;&lt;br /&gt;
        &amp;lt;title&amp;gt;The Title of your theme&amp;lt;/title&amp;gt;&lt;br /&gt;
        &amp;lt;creationDate&amp;gt;16/10/2017&amp;lt;/creationDate&amp;gt;&lt;br /&gt;
        &amp;lt;author&amp;gt;Your Name&amp;lt;/author&amp;gt;&lt;br /&gt;
        &amp;lt;authorEmail&amp;gt;your@email.org&amp;lt;/authorEmail&amp;gt;&lt;br /&gt;
        &amp;lt;authorUrl&amp;gt;http://www.yourwebsite.org&amp;lt;/authorUrl&amp;gt;&lt;br /&gt;
        &amp;lt;copyright&amp;gt;Your Copyright &amp;lt;/copyright&amp;gt;&lt;br /&gt;
        &amp;lt;license&amp;gt;Licence of your theme&amp;lt;/license&amp;gt;&lt;br /&gt;
        &amp;lt;version&amp;gt;version of your theme&amp;lt;/version&amp;gt;&lt;br /&gt;
        &amp;lt;apiVersion&amp;gt;3&amp;lt;/apiVersion&amp;gt;&lt;br /&gt;
        &amp;lt;description&amp;gt;Description of your theme&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/metadata&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Few remarks:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039;: will be used as a key in the db. So it must be unique, and it should not have any special chars (no spaces). Note that cases will not be taken in account&lt;br /&gt;
* &#039;&#039;&#039;Title&#039;&#039;&#039;: will be used to display your theme name in the different lists. It can have special chars&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039;: will be used in the main list of survey theme. It can contains special chars, and even HTML code by using &amp;lt;![CDATA[&lt;br /&gt;
&lt;br /&gt;
== Some notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122161</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122161"/>
		<updated>2018-08-13T10:58:42Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
aSurveyInfo.include_content tell you what action is currently going on: showing questions? showing submit result? showing clear all? etc&lt;br /&gt;
As you can see, in vanilla, we create one file to include by action. So if you want to know the list of actions, just check the vanilla&#039;s directory &#039;&#039;&#039;views/subviews/content&#039;&#039;&#039;, and remove the &amp;quot;twig&amp;quot; extension :&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/subviews/content&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;clearall.twig&#039;&#039;&#039;    &lt;br /&gt;
* &#039;&#039;&#039;firstpage.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;load.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;mainrow.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;main.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optin.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;optout.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;outerframe.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;printanswers.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;quotas.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;register.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;save.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit_preview.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;submit.twig&#039;&#039;&#039; &lt;br /&gt;
* &#039;&#039;&#039;userforms.twig&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
If you already created a them for 2.x versions of LimeSurvey, you&#039;ll notice that most of them corresponds to the old pstpl files for limesurvey 2.x. &lt;br /&gt;
Again, there is no obligation for you in your theme to create those files, with those names, in this directory. You could for example just add a giant switch in layout_global.twig with the wanted HTML for each action.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Some notes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122160</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=122160"/>
		<updated>2018-08-13T10:46:06Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new theme system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own themes.&lt;br /&gt;
* Add a picture to your theme&lt;br /&gt;
* Manage theme options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new theme engine system, based on Twig 1.29, Bootstrap, and allowing theme inheritance and theme options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old theme system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A theme designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new theme engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Theme Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==theme list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the theme list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The theme list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the theme: it’s just a picture file called “preview.png” at the root of the theme&lt;br /&gt;
* the “title” of the theme as specified in the manifest (config.xml in the root of the theme)&lt;br /&gt;
* the description of the theme: a string set in its manifest&lt;br /&gt;
* the type of theme: Core theme (provided with LimeSurvey), User theme (added in upload directory), XML theme (not loaded in database)&lt;br /&gt;
* Extends: if the theme extends another theme, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a theme to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a theme in the database&lt;br /&gt;
** Theme editor: it will redirect you to the theme editor&lt;br /&gt;
** Theme option: it will lead you the global configuration of theme options&lt;br /&gt;
&lt;br /&gt;
==Theme Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of theme inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a theme can now inherit from another theme, it can “extend” another theme. This means that the theme directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of themes for your different users without having to maintain a lot of different themes. For example: you can have your own home-made theme, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom theme, all the themes that inherit from it will be updated automatically. Note that the inheritance is recursive: a theme can extend a theme that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core themes of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome theme of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome theme. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/themes/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this theme as a normal one from a survey and it will look exactly like the monochrome theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The theme tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original theme are copied when extending a theme. This is because if you copy a CSS file from the original theme locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current theme path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The theme editor for the extends_monochrome theme looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old theme editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the theme directory and that the file from the original theme will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to theme views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local theme and save changes&#039;&#039;&#039; 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.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your theme&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your theme:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which theme the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the theme option page. As we’ll see later, theme creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the theme options at global level: click on “theme options” in the theme list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the theme&#039;s /options directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options (Broken link)&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a theme to another, and theme providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core themes:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a theme provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome themes use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for theme providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a theme can extend another theme. A theme configuration can also inherit from another theme configuration. It means that for a given theme, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the theme list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of themes than in the theme list, except that here only the option button is visible (theme editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single theme for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core theme. But of course, if you are a theme provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why are my changes not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how it works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %} //Shouldn&#039;t this be &amp;quot;theme&amp;quot; in stead of &amp;quot;template&amp;quot;?&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your theme configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot; (Question: &amp;quot;template_&amp;quot; of &amp;quot;theme_&amp;quot;?) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local theme as described above.&lt;br /&gt;
===Create new theme options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a theme from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon.&lt;br /&gt;
&lt;br /&gt;
For now, just giving few tips.&lt;br /&gt;
&lt;br /&gt;
==theme structure==&lt;br /&gt;
&lt;br /&gt;
=== Files and directories ===&lt;br /&gt;
When you create a Theme from scratch, you don&#039;t need to respect the file/directory structure/css/js from Vanilla. &lt;br /&gt;
The mandatory css/js is added by core (you can still remove it if needed)&lt;br /&gt;
&lt;br /&gt;
The only files your theme must have are the layout files:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;layout_global.twig&#039;&#039;&#039; : render the pages for survey taking&lt;br /&gt;
* &#039;&#039;&#039;layout_survey_list.twig&#039;&#039;&#039; : render the survey list (if this theme is set as default)&lt;br /&gt;
* &#039;&#039;&#039;layout_errors.twig&#039;&#039;&#039; : used to render errors that block survey rendering. ( wrong survey id, empty group in preview group, etc.)&lt;br /&gt;
* &#039;&#039;&#039;layout_user_forms.twig&#039;&#039;&#039;: renders the user forms such as: token (survey participant), and register.&lt;br /&gt;
* &#039;&#039;&#039;layout_print.twig&#039;&#039;&#039; : used to print the survey to pdf&lt;br /&gt;
* &#039;&#039;&#039;layout_printanswers.twig&#039;&#039;&#039;: print the answers&lt;br /&gt;
&lt;br /&gt;
The content of those files, the files they include or not, is entirely up to you. &lt;br /&gt;
All the other files and directories that you find on Vanilla are purely optional, feel free to organize your code the way you want.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] If you read the frontend rendering code, you&#039;ll see that those files names appear directly in it. That&#039;s why they are mandatory. &lt;br /&gt;
Eg: https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/application/helpers/SurveyRuntimeHelper.php#L462&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Content ===&lt;br /&gt;
&lt;br /&gt;
In Vanilla&#039;s layout_global.twig, you&#039;ll see we use a variable called &amp;quot;include_content&amp;quot;  to decide what to show&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/2398dda3b425da1a37d4611cd7963d39ac739987/themes/survey/vanilla/views/layout_global.twig#L114-L115&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
                    {% set sViewContent =  &#039;./subviews/content/&#039; ~ aSurveyInfo.include_content ~ &#039;.twig&#039; %}&lt;br /&gt;
                    {% include &#039;./subviews/content/outerframe.twig&#039; with {&#039;include_content&#039;: sViewContent } %}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Theme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: if you remove the section &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=97046</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=97046"/>
		<updated>2018-04-09T08:12:42Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface= &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor== &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance==== &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface==== &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The resources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ==== &amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list==== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options== &amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
===Advanced options===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
===Simple options=== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Inheritance system=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
====At survey group level==== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====At survey level==== &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example== &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization = &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS/JS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) == &amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
If you&#039;re trying to update the CSS/JS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:45--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
It moves the CSS/JS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css/js file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css/js. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:50--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
Here the CSS links in header when asset manager is off:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
So, when you&#039;re editing CSS/JS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:57--&amp;gt;&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme == &amp;lt;!--T:58--&amp;gt;&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:61--&amp;gt;&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  === &amp;lt;!--T:62--&amp;gt;&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  === &amp;lt;!--T:65--&amp;gt;&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:66--&amp;gt;&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector === &amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!--T:69--&amp;gt;&lt;br /&gt;
&#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:70--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
== Adding theme options to control positioning and display of survey elements  == &amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
This tutorial will show how to add options to an extended theme to display survey elements in various locations. In this case, we will create theme options to show the survey title in two different locations.&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] For the sake of simplicity, we will base the tutorial on an extension of the &amp;quot;bootswatch&amp;quot; theme in LimeSurvey version 3.4.3.&amp;lt;/div&amp;gt;  &lt;br /&gt;
=== Create a custom theme  ===&lt;br /&gt;
#Extend the &amp;quot;bootswatch&amp;quot; theme as described above.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;custom.css&amp;lt;/span&amp;gt; to the local template as described above.&lt;br /&gt;
===Create new template options===&lt;br /&gt;
#Copy the contents of &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/bootswatch/options/&amp;lt;/span&amp;gt; to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/options/options.twig&amp;lt;/span&amp;gt; in an editor and find &amp;quot;{# Bootstrap Bootswatch theme #}&amp;quot;. Directly before its parent  &amp;lt;nowiki&amp;gt;&amp;lt;div class=&#039;row&#039;&amp;gt;&amp;lt;/nowiki&amp;gt; element, add this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Custom survey name in navbar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname1&#039; class=&#039;control-label&#039;&amp;gt;Survey name in navbar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname1&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname1&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
		&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
{# Custom survey name below progress bar #}&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;div class=&#039;col-sm-12 col-md-6&#039;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
				&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
					&amp;lt;label for=&#039;simple_edit_options_surveyname2&#039; class=&#039;control-label&#039;&amp;gt;Survey name below progress bar&amp;lt;/label&amp;gt;&lt;br /&gt;
					&amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
						&amp;lt;div class=&amp;quot;btn-group&amp;quot; data-toggle=&amp;quot;buttons&amp;quot;&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;on&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								Yes&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
							&amp;lt;label class=&amp;quot;btn btn-default&amp;quot;&amp;gt;&lt;br /&gt;
								&amp;lt;input name=&#039;surveyname2&#039; type=&#039;radio&#039; value=&#039;off&#039; class=&#039;selector_option_radio_field &#039; data-id=&#039;simple_edit_options_surveyname2&#039;/&amp;gt;&lt;br /&gt;
								No&lt;br /&gt;
							&amp;lt;/label&amp;gt;&lt;br /&gt;
						&amp;lt;/div&amp;gt;&lt;br /&gt;
					&amp;lt;/div&amp;gt;&lt;br /&gt;
				&amp;lt;/div&amp;gt;&lt;br /&gt;
			&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div class=&#039;row&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;hr/&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/config.xml&amp;lt;/span&amp;gt; and add two items to the &amp;quot;options&amp;quot; block so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;    &amp;lt;options&amp;gt;&lt;br /&gt;
        &amp;lt;ajaxmode&amp;gt;on&amp;lt;/ajaxmode&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;surveyname1&amp;gt;on&amp;lt;/surveyname1&amp;gt;&lt;br /&gt;
        &amp;lt;surveyname2&amp;gt;on&amp;lt;/surveyname2&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#This should give you two new options in the Theme Options screen like this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_1.png]]&lt;br /&gt;
&lt;br /&gt;
===Modifed view for Survey Title in the navbar=== &amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/header/&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/header/nav_bar.twig&amp;lt;/span&amp;gt; and find &amp;quot;{# Logo option #}&amp;quot;. Under that, modify the IF statement for the logo/survey-name, so it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
		{# Logo option #}&lt;br /&gt;
        {% if( aSurveyInfo.options.brandlogo == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }} logo-container&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }}  &amp;gt;&lt;br /&gt;
                {{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {&amp;quot;class&amp;quot;: &amp;quot;logo img-responsive&amp;quot;}) }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&lt;br /&gt;
        {% if( aSurveyInfo.options.surveyname1 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
            &amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.navbarbrand }}&amp;quot;  {{ aSurveyInfo.attr.navbarbrand }} &amp;gt;&lt;br /&gt;
                {{ aSurveyInfo.name }}&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
        {% endif %}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60px;&lt;br /&gt;
    font-size: 32px;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name in navbar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_2.png]]&lt;br /&gt;
===Modifed view for Survey Title under progress bar===&lt;br /&gt;
#Create a new directory &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/views/subviews/survey/group_subviews&amp;lt;/span&amp;gt;.&lt;br /&gt;
#Copy &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; to that new directory.&lt;br /&gt;
#Open &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/themes/survey/vanilla/views/subviews/survey/group_subviews/group_container.twig&amp;lt;/span&amp;gt; and add an &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt; element for the survey name. So it looks like this:&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.groupcontainer }} space-col&amp;quot; {{ aSurveyInfo.attr.groupcontainer }}&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    {# Custom survey name #}&lt;br /&gt;
    {% if( aSurveyInfo.options.surveyname2 == &amp;quot;on&amp;quot;) %}&lt;br /&gt;
    	&amp;lt;h1 class=&amp;quot;custom-survey-name&amp;quot;&amp;gt;{{ aSurveyInfo.name }}&amp;lt;/h1&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Name #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_name.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {# Group Description #}&lt;br /&gt;
    {{ include(&#039;./subviews/survey/group_subviews/group_desc.twig&#039;) }}&lt;br /&gt;
 &lt;br /&gt;
    {#&lt;br /&gt;
        PRESENT THE QUESTIONS&lt;br /&gt;
 &lt;br /&gt;
        This is the main part. It will render each question for this group&lt;br /&gt;
     #}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- PRESENT THE QUESTIONS --&amp;gt;&lt;br /&gt;
    {% for  aQuestion in aGroup.aQuestions %}&lt;br /&gt;
         {{ include(&#039;./subviews/survey/question_container.twig&#039;) }}&lt;br /&gt;
    {% endfor %}&lt;br /&gt;
 &lt;br /&gt;
    &amp;lt;!-- Hidden inputs --&amp;gt;&lt;br /&gt;
    {% if aGroup.show_last_group == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastgroup&#039; value=&#039;{{ aGroup.lastgroup }}&#039; id=&#039;lastgroup&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
 &lt;br /&gt;
    {% if aGroup.show_last_answer == true %}&lt;br /&gt;
        &amp;lt;input type=&#039;hidden&#039; name=&#039;lastanswer&#039; value=&#039;{{ aGroup.lastanswer }}&#039; id=&#039;lastanswer&#039; /&amp;gt;&lt;br /&gt;
    {% endif %}&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Add something like this to &amp;lt;span style=&amp;quot;color: #BA2121;&amp;quot;&amp;gt;/upload/themes/survey/yourThemeName/css/custom.css&amp;lt;/span&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.navbar-brand {&lt;br /&gt;
    line-height: 60ph1.custom-survey-name {&lt;br /&gt;
	margin: 0;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#Toggle the &amp;quot;Survey name below progress bar&amp;quot; theme option to &amp;quot;Yes&amp;quot;&lt;br /&gt;
#You should see this:&amp;lt;br /&amp;gt;[[File:Tutorial_tp_1_3.png]]&lt;br /&gt;
&lt;br /&gt;
===Downloads=== &amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
* Sample extended theme: [[Media:Test_survey_names.zip]]&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch= &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:82--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Teeme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95979</id>
		<title>Theme editor</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95979"/>
		<updated>2018-04-04T11:05:39Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt; &amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
LimeSurvey has an advanced theme and style system providing to developers an efficient way to customize the survey appearance. Since LS3, we&#039;re not speaking anymore about &#039;&#039;&#039;&amp;quot;templates&amp;quot;&#039;&#039;&#039; like in previous versions, but about &#039;&#039;&#039;&amp;quot;themes&amp;quot;&#039;&#039;&#039;. The &#039;&#039;&#039;themes&#039;&#039;&#039; allow control over the look and feel of pages during a survey. A survey administrator can select a default theme that will be used for each survey to further personalize it and improve its look and feel. &#039;&#039;&#039;Themes&#039;&#039;&#039;  come with options that provide to admin without coding skill a simple way to add a logo on the welcome page, to change the background colors, to select a font, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
LimeSurvey comes with 3 themes right out of the box. These initial themes are defined by directories located in the LimeSurvey installation &amp;quot;themes/survey/&amp;quot; directory. Each theme has it&#039;s own directory. Within the main directory of a theme you&#039;ll find a configuration file in XML, and numerous directories containing the views &#039;&#039;themes (.twig)&#039;&#039;&#039;, &#039;&#039;&#039;cascading style sheets (.css)&#039;&#039;&#039;, &#039;&#039;&#039;scripts&#039;&#039;&#039;,  &#039;&#039;&#039;images&#039;&#039;&#039; (&#039;&#039;&#039;.jpg&#039;&#039;&#039; or &#039;&#039;&#039;.png&#039;&#039;&#039;), and maybe others. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Since LimeSurvey 2.50, the theme engine use [http://getbootstrap.com/docs/3.3/ Bootstrap 3]  as CSS framework. Bootstrap 3 being a standard framework, developers will find a lot of documentation, tutorials and forum threads about it on Internet. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since LimeSurvey 3, the theme engine use [https://twig.symfony.com Twig], so the theme developers can change the logic of the survey rendering in a safe and easy way. Twig replace the old system of replacement keywords that was used in the previous versions. The logic that was used to generate the HTML of the keywords are now available inside the theme&#039;s views. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Snippet from Vanilla Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;twig&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.answercontainer }} col-xs-12&amp;quot; {{ aSurveyInfo.attr.answercontainer }}&amp;gt;&lt;br /&gt;
    {# NOTE: If you want to customize the question rendering, use a question theme #}&lt;br /&gt;
    {{ aQuestion.answer | raw }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Themes, being HTML and Twig code, tend to define the positioning and type of text to be displayed and similar structural features of the page. They often reference or include other files. Most of them reference a common cascading style sheets (CSS) file that defines the font style, color, size, background, and similar parameters common to all pages in the survey. Style sheets reference HTML &#039;&#039;&#039;class&#039;&#039;&#039; parameters that are associated with the various types of objects in the HTML code. This allows the style sheet to describe how to display each of the many types of text or other objects that may appear in multiple places. There are unique classes for each question type in LimeSurvey and thus giving detailed control over the appearance of each. Image files, like logos or special progress-bar constructors, may be referenced as well in the Theme file. Finally, special keywords in curly braces are replaced with text defined in the survey for each language translation correspondent (for example, the &#039;Survey Title&#039; or &#039;Question Text&#039; for each language defined).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
If you create a new custom theme, please consider contributing it back to the LimeSurvey community and make it available to others. With your help, we can grow our repository of themes, surveys, and other add-ons to make LimeSurvey even better! &lt;br /&gt;
See our [https://www.limesurvey.org/index.php?option=com_sobipro&amp;amp;sid=55:Templates&amp;amp;Itemid=729 LimeSurvey template repository] where you can share your templates.&lt;br /&gt;
&lt;br /&gt;
=Creating a new theme= &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To be able to create a new theme (or edit an existing theme), you need [[Manage users#Set global permissions for a user|Template Editing user permission]] in LimeSurvey as well as permission to manipulate the files in the underlying operating system hosting your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;Note of Warning:&#039;&#039;&#039;&amp;lt;/span&amp;gt; If you change themes, you could also affect all the pre-existing surveys from your LimeSurvey installation. Themes are an advanced feature that require experience and HTML knowledge in order to make them running smoothly.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
The preferred way to create a new theme is through the &#039;&#039;&#039;Theme Editor&#039;&#039;&#039; (see below), which is located in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; dialog. Some people may like to work directly with theme files so that they can use their favorite text editor instead of the web interface. In this case, still use the Theme Editor to first create your new theme. This will create a new base theme with all the files you need in the &#039;&#039;LimeSurvey_web_root/upload/themes/survey/your_new_template&#039;&#039; directory. From there you can use your text editor to manually adjust the template files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; on unix/linux systems, these theme files will be owned by the group and user where the web server is running (may be &amp;quot;www&amp;quot; for some systems). So, make sure you have enough access to edit these files, When you save them, make sure they don&#039;t change ownership! In this way, you can still use the web Theme Editing interface if needed.&amp;lt;/div&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A number of &#039;public&#039; elements of LimeSurvey can be adjusted by a series of themes. The next section provides a very brief explanation of these templates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
{{Note|Themes files may seem complex. Besides HTML, you might also need to understand CSS, Twig, and JavaScript.}}&lt;br /&gt;
&lt;br /&gt;
=The LimeSurvey Theme editor= &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
To ease the understanding and quick update of a Theme, LimeSurvey provides a &#039;&#039;&#039;Theme Editor&#039;&#039;&#039; in the main &#039;&#039;&#039;administrative&#039;&#039;&#039; toolbar of the application. This Theme Editor is only available to users [[Manage users#Set global permissions for a user|with the Templates permission]] and to superadministrators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:297--&amp;gt;&lt;br /&gt;
{{Alert|title=Attention|text=A theme that is not correctly constructed can make a survey (that uses the respective template) inoperable. }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
The LimeSurvey theme editor allows you to edit the contents of your themes online. To start the Theme Editor: click on &#039;&#039;&#039;Themes&#039;&#039;&#039; link in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; menu, and then click on the &amp;quot;Theme editor&amp;quot;  button next of the theme you want to edit or extend. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:285--&amp;gt;&lt;br /&gt;
[[File:Themes menu.png]]&lt;br /&gt;
[[File:Theme editor button.png|&#039;&#039;The button to access the theme editor for Bootswatch theme&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:286--&amp;gt;&lt;br /&gt;
The template editor page allows you to select the template you would like to edit/view. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:279--&amp;gt;&lt;br /&gt;
[[File:Template-editor-2013-7-10_11_38_16.png|center]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:298--&amp;gt;&lt;br /&gt;
The following options are available:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:280--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Create&#039;&#039;&#039;: Allows you to create a new template. In order not to start from scratch, the template &#039;default&#039; is copied.&lt;br /&gt;
*&#039;&#039;&#039;Import&#039;&#039;&#039;: Allows you to import a template from a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Export&#039;&#039;&#039;: Allows you to export the current template to a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Copy&#039;&#039;&#039;: Allows you to make a new template by copying the current one.&lt;br /&gt;
*&#039;&#039;&#039;Rename&#039;&#039;&#039;: Allows you to change the name of the template. It is generally used after copying or importing a template.&lt;br /&gt;
*&#039;&#039;&#039;Template&#039;&#039;&#039;: It is a drop-down list that shows all the available templates that are located in your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Screen&#039;&#039;&#039;: It is a drop-down list which allows you to choose which particular survey page of that template you want to look at.&lt;br /&gt;
*&#039;&#039;&#039;Return to admin panel&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Import/export/copy a template== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
When you &#039;&#039;&#039;export &#039;&#039;&#039;a template, a ZIP-file archive with all the files your template consists of will be created (.pstpl files, images, css files, ...). You can simply &#039;&#039;&#039;import&#039;&#039;&#039; the exported zip-file into another LimeSurvey installation by using the import feature or you can manually copy the archive into another LimeSurvey installation and extract it into the corresponding [[Theme editor#Template files location|template directory there]]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:288--&amp;gt;&lt;br /&gt;
However, it is preferred to use the LimeSurvey template import/export/copy functions in the template editor.&lt;br /&gt;
&lt;br /&gt;
==Page Structure / Template Use== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;The Welcome Page:&#039;&#039;&#039; startpage.pstpl, welcome.pstpl, privacy.pstpl,  navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Questions Pages:&#039;&#039;&#039; startpage.pstpl, survey.pstpl, startgroup.pstpl, groupdescription.pstpl, question.pstpl, endgroup.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Final Page:&#039;&#039;&#039; startpage.pstpl, assessment.pstpl, completed.pstpl, endpage.pstpl&lt;br /&gt;
&lt;br /&gt;
==Template Files== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The following template files are used to produce your public survey and must exist in any new template folder you create:&lt;br /&gt;
*&#039;&#039;&#039;startpage.pstpl:&#039;&#039;&#039; Produces the start of each html page. It starts at the &amp;quot;&amp;lt;head&amp;gt;&amp;quot; tag, and should not contain the &amp;quot;&amp;lt;html&amp;gt;&amp;quot; tag. This &#039;very beginning&#039; of a standard html page is written by the scripts. Please ensure that your startpage.pstpl files contains a &amp;lt;body&amp;gt; tag. Even though many browsers do not require strict adherence to the W3 HTML standards, the LimeSurvey script needs to find a &amp;lt;body&amp;gt; tag to run certain javascript elements. It is not expected to see many &#039;keywords&#039; used in the startpage.pstpl file. However, you may wish to put the {SURVEYNAME} into the title. The startpage.pstpl file can contain code that ends in the corresponding endpage.pstpl file. For example, you can start a table in this file and close the table in the endpage.pstpl file. The startpage.pstpl and endpage.pstpl files wrap around every possible page used by LimeSurvey.&lt;br /&gt;
*&#039;&#039;&#039;survey.pstpl:&#039;&#039;&#039; This template is the second used on most pages and provides a space to put the survey name and description. This template does not have a corresponding &#039;closing&#039; template, and subsequently you should close all tags opened in this template file (i.e.: don&#039;t leave a table open here because there is nowhere else to close it).&lt;br /&gt;
*&#039;&#039;&#039;welcome.pstpl:&#039;&#039;&#039; This template is only used in the welcome screen (which is also on the main page for &#039;all in one&#039; surveys). You can use this to print out the welcome text, and other information that should be provided in the introduction. Like the &#039;survey.pstpl&#039; file, there is no corresponding &#039;closing&#039; template, so all tags opened in this template file should be closed as well.&lt;br /&gt;
*&#039;&#039;&#039;startgroup.pstpl:&#039;&#039;&#039; This template can provide a &#039;summary&#039; wrap around for questions within a group. It has a matching &#039;endgroup.pstpl&#039; template that can be used to close any opened tags in this file, so you can open a table within this.&lt;br /&gt;
*&#039;&#039;&#039;groupdescription.pstpl:&#039;&#039;&#039; This template file is used to display a description of a group. Please note that in the survey settings (access the &#039;&#039;Presentation &amp;amp; navigation settings&#039;&#039; by clicking on the &#039;&#039;&#039;Presentation&#039;&#039;&#039; tab) you can set if the group description should be shown or not. If not, then this file is not included at all.&lt;br /&gt;
*&#039;&#039;&#039;question.pstpl:&#039;&#039;&#039; This file contains the question, answer, and help text sections of your survey. In the &amp;quot;group by group&amp;quot; and &amp;quot;all in one&amp;quot; surveys, this template is cycled repeatedly with each question. There is no corresponding closing file for this and all tags should be closed.&lt;br /&gt;
*&#039;&#039;&#039;question_start.pstpl:&#039;&#039;&#039; This file contains the individual elements found at the start of a question. It is included within &#039;question.pstpl&#039; via the {QUESTION} keyword. It is intended to allow template designers more control over the layout of a question. This template sits outside the normal templating system and &#039;&#039;&#039;was superseeded (as of LimeSurvey 1.87)&#039;&#039;&#039;. All keywords from this template are now available directly in question.pstpl. &lt;br /&gt;
*&#039;&#039;&#039;completed.pstpl:&#039;&#039;&#039; This page is displayed as the final page when the survey responses have been saved and the survey is over. It can be used to display a &amp;quot;forwarding link&amp;quot; as set in the survey setup.&lt;br /&gt;
*&#039;&#039;&#039;endgroup.pstpl:&#039;&#039;&#039; This file closes the group, and can be used to close off any tags opened in the startgroup.pstpl file&lt;br /&gt;
*&#039;&#039;&#039;navigator.pstpl:&#039;&#039;&#039; This file contains the buttons that navigate through the survey, &amp;quot;next&amp;quot;, &amp;quot;prev&amp;quot;, &amp;quot;last&amp;quot;, &amp;quot;submit&amp;quot;, &amp;quot;save so far&amp;quot;  and the &amp;quot;clear all&amp;quot; link. It is used in all pages except the completed page.&lt;br /&gt;
*&#039;&#039;&#039;printanswers.pstpl:&#039;&#039;&#039; This file has the HTML wrapper necessary for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_group.pstpl:&#039;&#039;&#039; This file is the same as startgroup.pstpl and endgroup.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_question.pstpl:&#039;&#039;&#039; This file is the same as question.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_survey.pstpl:&#039;&#039;&#039; This file is the same as survey.pstpl, but for the print version of the survey.&lt;br /&gt;
&lt;br /&gt;
== CSS and Javascript== &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
Two files that are always used in a template are template.css (for CSS) and template.js (for Javascript).&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATECSS}:&#039;&#039;&#039; Add lines for default css, template.css, and template-rtl.css for rtl language.&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATEJS}:&#039;&#039;&#039; Add lines for default javascript files, template.js, and all js files needed for LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
=== Using Bootstrap=== &amp;lt;!--T:294--&amp;gt;&lt;br /&gt;
LimeSurvey has Bootstrap 3 embedded, so you can style all your templates with the well documented Bootstrap classes.&lt;br /&gt;
For more information please refer to the [https://getbootstrap.com Bootstrap documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:295--&amp;gt;&lt;br /&gt;
The [https://github.com/flatlogic/awesome-bootstrap-checkbox Awesome-Bootstrap-Checkbox] plugin is also included. With it, you can use the typical Bootstrap color-classes (info,warning,danger,etc.) also with the suffix &amp;quot;-checkbox&amp;quot; or &amp;quot;-radio&amp;quot;, though styling checkboxes and radios as you prefer.&lt;br /&gt;
&lt;br /&gt;
=== Replacing default CSS or Javascript=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Some questions use specific files for Javascript or CSS. If you need to replace a function, use a cascading system. For javascript function, the last function read is the function used.&lt;br /&gt;
&lt;br /&gt;
==Other Template Files== &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The &#039;&#039;&#039;privacy.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;invitationemail.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;reminderemail.pstpl&#039;&#039;&#039;, and &#039;&#039;&#039;confirmationemail.pstpl&#039;&#039;&#039; are no longer used by LimeSurvey and defaults are instead set in the applicable language files. The email messages can now be edited on a survey by survey basis.&lt;br /&gt;
&lt;br /&gt;
==Standard Pages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
There are ten standard pages that a survey participant may see in the course of taking or accessing the LimeSurvey application.  Each is constructed from a number of common &#039;&#039;&#039;Template&#039;&#039;&#039; files from the &#039;&#039;&#039;Template&#039;&#039;&#039; specified in the settings of the survey. The table below indicates which template files are used in constructing each of these pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!  &#039;&#039;&#039;Survey Pages/&#039;&#039;&#039;&amp;lt;br /&amp;gt;&#039;&#039;&#039;Template Files&#039;&#039;&#039;!!Survey&amp;lt;br /&amp;gt;List!!Welcome!!Question!!Completed!!Clear All!!Register!!Load!!Save!!Print&amp;lt;br /&amp;gt;Answers!!Print&amp;lt;br /&amp;gt;Survey&lt;br /&gt;
|-&lt;br /&gt;
|SurveyList||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Welcome|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Privacy|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Navigator|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Survey|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|StartGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|GroupDescription|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Question&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|EndGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Assessment|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Completed|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ClearAll|| || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Register|| || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Load|| || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||&lt;br /&gt;
|-&lt;br /&gt;
|Save|| || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| ||&lt;br /&gt;
|-&lt;br /&gt;
|PrintAnswers|| || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||&lt;br /&gt;
|-&lt;br /&gt;
|Print Survey || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Group || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Question || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|StartPage&amp;lt;br /&amp;gt;EndPage&amp;lt;br /&amp;gt;Template.css||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.90+, this replaces question.pstpl AND question_start.pstpl. If you are using an old custom template, you need to add the following line to the beginning of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div {QUESTION_ESSENTIALS} class=&amp;quot;{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;And then add the corresponding closing tag to the end of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.91 and earlier, LimeSurvey js files are not included in the template. In version 2, &#039;&#039;&#039;you have to use {TEMPLATEJS} in one of your template file&#039;&#039;&#039; to add the link to the js file. You can add it in startpage.pstpl or in endpage.pstpl. You can remove the {TEMPLATEURL}/template.js line and you have to replace with {TEMPLATEJS} to update a personal template.&lt;br /&gt;
&lt;br /&gt;
==The File Control Section== &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
In the &amp;quot;file control&amp;quot; window on the left, you can click on one of the template files that is used to compile the page. You can see the &#039;&#039;Screen part&#039;&#039;, JavaScript, and CSS files. The HTML code for that file will then appear in the &amp;quot;Now editing&amp;quot; window in the center. If the template is editable (determined by directory permissions) you can then make any changes and save them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:299--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:File Control Section.png|center]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The &amp;quot;Other files&amp;quot; window shows a list of all other files from the template directory. You can use the right side to &#039;&#039;&#039;upload and select image files (your pics, logos,...) or other files needed to create your template&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:300--&amp;gt;&lt;br /&gt;
Instead of using a link for each picture, utilize the field string {TEMPLATEURL}. So, instead of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;/limesurvey/templates/yourtemplate/files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
You can use {{NewIn|2.50}}:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:287--&amp;gt;&lt;br /&gt;
In LimeSurvey versions before 2.50 use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
A &amp;quot;sample&amp;quot; of the template page you are editing will be visible in the bottom of the screen. There is no way to delete a template from the template editor. This must be done by accessing the underlying directory and deleting manually the files from there. You also have the possibility to select different screen resolutions in order to better evaluate the feel and look of the template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The shipped templates cannot be edited using the template editor. If you want to modify them, create a copy first and edit the copy.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Template files location== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
LimeSurvey stores each of the &#039;standard&#039; templates in their own distinct sub-directory within the &#039;&#039;/templates&#039;&#039; directory that is kept in the public directory with the other LimeSurvey public files. Customized user templates are stored in the &#039;&#039;/upload/templates&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
There should &#039;&#039;&#039;ALWAYS&#039;&#039;&#039; be a &amp;quot;default&amp;quot; directory in the templates directory. This template is used by default and as a fall-back if a template folder doesn&#039;t exist, or can&#039;t be found. It comes installed by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
You can use any image files that you upload into the template management area with the help of this syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{TEMPLATEURL}filename.xyz&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Styling questions with CSS= &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
Styling of questions in CSS has become much easier. Each question type has now a unique class. The mandatory questions have an additional mandatory class. For example, for a non-mandatory question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
and if the question is mandatory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
and if the question is mandatory, but the user didn&#039;t answer it or if there is validation on a question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
and if the question has validation applied, but the user hasn&#039;t answered correctly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question6&amp;quot; class=&amp;quot;text-short input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Global classes for question part== &amp;lt;!--T:273--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:274--&amp;gt;&lt;br /&gt;
These classes are used for each question type. Some question types use only one or two classes, while others may use much more.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:281--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable alternance&amp;quot;&lt;br /&gt;
|+ Global classes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Class name&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Part&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Question type&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Examples&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Note&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question {{ObsoleteIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;p class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;question&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-answers {{NewIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;div class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;ls-answers&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .subquestions-list&lt;br /&gt;
| List of subquestion&lt;br /&gt;
| Multi choice question, array question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;subquestions-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;subquestions-list&amp;quot;&amp;gt;&lt;br /&gt;
| .questions-list is used too&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answers-list&lt;br /&gt;
| List of answers&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;answers-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;answers-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answer-item&lt;br /&gt;
| The answer part: one answer&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;answer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;answer-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .noanswer-item&lt;br /&gt;
| The answer part for no answer&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;noanswer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
| No answer is an answer too, then have double class noanswer-item and answer-item&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question-item&lt;br /&gt;
| The question part: one question&lt;br /&gt;
| Multi text question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;question-item&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;question-item&amp;quot;&amp;gt;&lt;br /&gt;
| Some answers are questions too. Then we have a lot of class=&amp;quot;question-item answer-item&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-list&lt;br /&gt;
| A list of checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;checkbox-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| Some question types use multi-list class, like checkbox with comment: class=&amp;quot;checkbox-list text-list&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of checkbox&lt;br /&gt;
| Array (numbers) with checkbox option&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-item&lt;br /&gt;
| The answer part with a checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;checkbox-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;checkbox-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-list&lt;br /&gt;
| A list of radio item&lt;br /&gt;
| Single choice question, array question type (each row)&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;radio-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;radio-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-array {{NewIn|3.0}}&lt;br /&gt;
| A array of radio item&lt;br /&gt;
| Array question type&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;radio-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-item&lt;br /&gt;
| The answer part with a radio&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;radio-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;radio-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-list&lt;br /&gt;
| A list of text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-item&lt;br /&gt;
| The answer part of a text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;text-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;text-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .numeric-list&lt;br /&gt;
| A list of text input with numeric only answer&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-list&lt;br /&gt;
| A list of text input with numeric only answer (each row)&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-array  {{NewIn|3.0}}&lt;br /&gt;
| The answer part of a numeric input&lt;br /&gt;
| Array of number&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;number-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-list  {{ObsoleteIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;select-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-list  {{NewIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select) (each row)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of dropdown&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-item  {{ObsoleteIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;select-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;select-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-item  {{NewIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;dropdown-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;dropdown-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .hide  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Used for accessibility: hidden with css but read by screenreader, since 2.50 : you can use sr-only from bootstrap&lt;br /&gt;
| Short text question&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;hide&amp;quot;&amp;gt;&lt;br /&gt;
| Can be used for other purposes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is activated&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it, but you can use it too in your template&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden-sr {{NewIn|3.0}}&lt;br /&gt;
| Used for accessibility: hide it if js is activated, but always show if user use a screenreader&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-js-hidden-sr&amp;quot;&amp;gt;&lt;br /&gt;
| Button&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-no-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is not activated&lt;br /&gt;
| Link&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it for inactive link if javascript is not activated&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-label-xs-visibility {{NewIn|3.0}}&lt;br /&gt;
|  Label to be hidden in big screen, but show with little screen (with no more table) and to screenreader&lt;br /&gt;
| label&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| Used for label inside table cell of array question type&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-input-group-extra {{NewIn|3.0}}&lt;br /&gt;
| Same usage of boostrap input-group-addon, but without the border and the background.&lt;br /&gt;
| right suffix&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-input-group-extra&amp;quot;&amp;gt;&lt;br /&gt;
| Used for right and left suffix (global)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=checkbox]&lt;br /&gt;
| Question with checkbox&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;checkbox&amp;quot; class=&amp;quot;checkbox&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=radio]&lt;br /&gt;
| Question with radio&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;radio&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text&lt;br /&gt;
| input[type=text]&lt;br /&gt;
| Question with input text, or textarea&lt;br /&gt;
| &amp;amp;lt;textarea class=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answertext&lt;br /&gt;
| Array question type&lt;br /&gt;
| Answer part of array question type&lt;br /&gt;
| &amp;amp;lt;th class=&amp;quot;answertext&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .col-answers&lt;br /&gt;
| Array question type&lt;br /&gt;
| Column of answers&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .odd .even {{ObsoleteIn|2.50}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for column&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .array1 .array2  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for line&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;array1&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-odd .ls-even  {{NewIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for sub-question and Y axis&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;ls-odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Some example of question part with classes=== &amp;lt;!--T:275--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:276--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Text-short question type:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;question answer-item text-item &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;label class=&amp;quot;hide label&amp;quot; for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Answer&amp;lt;/label&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;50&amp;quot; class=&amp;quot;text  empty&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:277--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Multiple short text&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;subquestions-list questions-list text-list&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li class=&amp;quot;question-item answer-item text-item&amp;quot; id=&amp;quot;javatbdSGQA&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;label for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Some example subquestion&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;span&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;20&amp;quot; class=&amp;quot;text empty&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:282--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Array question type&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;question subquestion-list questions-list &amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;caption class=&amp;quot;hide read&amp;quot;&amp;gt;Some explanation for accessibility.&amp;lt;/caption&amp;gt;&lt;br /&gt;
	&amp;lt;colgroup class=&amp;quot;col-responses&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;50%&amp;quot; class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;25%&amp;quot; class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;13.3%&amp;quot; class=&amp;quot;col-no-answer even&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;/colgroup&amp;gt;&lt;br /&gt;
	&amp;lt;thead&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array1 dontread&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;1&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;No answer&amp;lt;/th&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/thead&amp;gt;&lt;br /&gt;
	&amp;lt;tbody&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array2 answers-list radio-list&amp;quot; id=&amp;quot;javatbdSGQ&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;20%&amp;quot; class=&amp;quot;answertext&amp;quot;&amp;gt;Some example subquestion&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer_cell_001 answer-item radio-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;1&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer-item radio-item noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;No answer&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The full list of question classes== &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Question Type&#039;&#039;&#039;||&#039;&#039;&#039;Question Class&#039;&#039;&#039;||&#039;&#039;&#039;Question ID&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|5 point choice||.choice-5-pt-radio||5&lt;br /&gt;
|-&lt;br /&gt;
|Array (10 point choice)||.array-10-pt||B&lt;br /&gt;
|-&lt;br /&gt;
|Array (5 point choice)||.array-5-pt||A&lt;br /&gt;
|-&lt;br /&gt;
|Array (Flexible Labels) dual scale||.array-flexible-duel-scale ||1&lt;br /&gt;
|-&lt;br /&gt;
|Array (Increase, Same, Decrease)||.array-increase-same-decrease||E&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Numbers)||.array-multi-flexi ||:&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Text)||.array-multi-flexi-text||;&lt;br /&gt;
|-&lt;br /&gt;
|Array (Yes/No/Uncertain)||.array-yes-uncertain-no||C&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels)||.array-flexible-row ||F&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels) by column||.array-flexible-column||H&lt;br /&gt;
|-&lt;br /&gt;
|Boilerplate question||.boilerplate||X&lt;br /&gt;
|-&lt;br /&gt;
|Date||.date||D&lt;br /&gt;
|-&lt;br /&gt;
|Gender||.gender||G&lt;br /&gt;
|-&lt;br /&gt;
|Huge free text||.text-huge||U&lt;br /&gt;
|-&lt;br /&gt;
|Language switch||.language||I&lt;br /&gt;
|-&lt;br /&gt;
|List (dropdown)||.list-dropdown||!&lt;br /&gt;
|-&lt;br /&gt;
|List (radio)||.list-radio||L&lt;br /&gt;
|-&lt;br /&gt;
|List with comment||.list-with-comment||O&lt;br /&gt;
|-&lt;br /&gt;
|Long free text||.text-long||T&lt;br /&gt;
|-&lt;br /&gt;
|Multiple numerical input||.numeric-multi||K&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options||.multiple-opt||M&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options with comments||.multiple-opt-comments||P&lt;br /&gt;
|-&lt;br /&gt;
|Multiple short text||.multiple-short-txt||Q&lt;br /&gt;
|-&lt;br /&gt;
|Numerical input||.numeric||N&lt;br /&gt;
|-&lt;br /&gt;
|Ranking||.ranking||R&lt;br /&gt;
|-&lt;br /&gt;
|Short free text||.text-short||S&lt;br /&gt;
|-&lt;br /&gt;
|Yes/No||.yes-no||Y&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==The full list of validation classes== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Note:  Prior to 1.92, only .mandatory and .input-error classes were available.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
These apply to the help and/or validation tip messages so that each type can be individually styled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
The .hide-tip option and .input-error options interact by default so that you can have validation tips hidden. However, they do appear when there are validation errors and disappear again when those errors are rectified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
All of these are designed to eliminate the need for pop-up alert messages. Instead, tips can appear/disappear as needed and are color-coded to indicate whether the answers pass the validation criteria.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Furthermore, when you first visit a page that has unmet validation criteria, you can color-code the tips in a pleasing color to show which validation criteria have not been met yet; then re-display the page using a harsher color if the person submits the page with lingering validation errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Purpose&#039;&#039;&#039;||&#039;&#039;&#039;CSS Class&#039;&#039;&#039;||&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Mandatory||.mandatory||the question is mandatory&lt;br /&gt;
|-&lt;br /&gt;
|User input error||.input-error||the question had at least one validation error&lt;br /&gt;
|-&lt;br /&gt;
|Hide Tip||.hide-tip||added if you use the hide_tip option&lt;br /&gt;
|-&lt;br /&gt;
|Num answers||.em_num_answers||for for min_answers and max_answers&lt;br /&gt;
|-&lt;br /&gt;
|Value range||.em_value_range||for min/max_num_value_n and multiflexible_min/max&lt;br /&gt;
|-&lt;br /&gt;
|Sum range||.em_sum_range||for min/max/equals_num_value&lt;br /&gt;
|-&lt;br /&gt;
|Regex validation||.em_regex_validation||for regular-expression validation of the question&lt;br /&gt;
|-&lt;br /&gt;
|Question-level validation function||.em_q_fn_validation||for the em_validation_q option&lt;br /&gt;
|-&lt;br /&gt;
|Subquestion-level validation function||.em_sq_fn_validation||for the em_validation_sq option&lt;br /&gt;
|-&lt;br /&gt;
|Other comment mandatory||.em_other_comment_mandatory||for other_comment_mandatory option - shows when &amp;quot;other&amp;quot; is selected but associated comment is missing.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing styles into your custom template== &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
The custom question styles are near the bottom of each template&#039;s CSS file and start with:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;/* --------------------------- START: Question styles  ------------------------------ */&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
If you&#039;re styling your own custom template, you should be able to copy everything after the above one from &#039;&#039;templates/default/template.css&#039;&#039; (for table-based layouts) or &#039;&#039;/templates/limespired/template.css&#039;&#039; (for CSS-based layouts) into your own style sheet without any impact on your other styles.&lt;br /&gt;
&lt;br /&gt;
==Internet Explorer conditional style sheets== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
Because of the marked discrepancies in rendering between IE6 &amp;amp; IE7 and the other browsers, there are special IE conditional style sheets included for each template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_all-versions.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if lt IE 7]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_older-than-7.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8]&amp;gt;&lt;br /&gt;
		&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}ie_fix_8.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You should include the above code within your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; and copies of both the IE style sheets from either &#039;&#039;/templates/default/&#039;&#039; or &#039;&#039;/templates/limespired&#039;&#039; for Tables base layout and CSS based layout respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; If you copy the styles into your own style sheet you will almost certainly need to tweak them.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alternative solution for Internet explorer=== &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
You can put a conditional class for body in startpage.pstpl and use this class in your template.css. This method is used in the citronade template{{ObsoleteIn|2.06}}. Adding a js / no-js class to have javascript / no javascript system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;!--[if lt IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie6 ielt7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie8 ielt9  no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 9 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if gt IE 9]&amp;gt;&amp;lt;!--&amp;gt;&amp;lt;body id=&amp;quot;body&amp;quot; class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} no-js&amp;quot;&amp;gt;&amp;lt;!--&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;script type=&#039;text/javascript&#039;&amp;gt;/*&amp;lt;![CDATA[*/(function(H){ H.className=H.className.replace(/\bno-js\b/,&#039;js&#039;) })(document.getElementsByTagName(&#039;body&#039;)[0]);/*]]&amp;gt;*/&amp;lt;/script&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
And in template.css use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;.ie6{/*specific for internet explorer 6*/}&lt;br /&gt;
.ielt8{/*specific for internet explorer 6 and 7*/}&lt;br /&gt;
.ie{/*specific for all internet explorer */}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Right-to-Left (RTL) Languages and justify== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
The text editor within LimeSurvey is able to format RTL text. However, the editor itself shows the RTL language in a left to right format when justified. This is just an editor display issue. The RTL and justified question or text will display correctly from right to left, even when justified, in your survey or on preview.&lt;br /&gt;
&lt;br /&gt;
==Keywords== &amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:309--&amp;gt;&lt;br /&gt;
{{Deprecated|3.0}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
Keywords within a template file get replaced by the current survey information. They are surrounded by curly brackets, for example: {SURVEYNAME}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
The following strings will be replaced by LimeSurvey when parsing the template file and presenting it to survey users. These field strings will work on almost every template except for the &#039;Completed Page&#039;. (Most of these strings can be found in the common.php file. If it&#039;s not there, look in the index.php file.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!&#039;&#039;&#039;Keyword&#039;&#039;&#039;!!&#039;&#039;&#039;Template files&#039;&#039;&#039;!!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYNAME}||All Files||The survey title&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYDESCRIPTION}||All Files||The survey description&lt;br /&gt;
|-&lt;br /&gt;
|{WELCOME}||All files (mainly for welcome.pstpl)||The survey &#039;welcome&#039; text&lt;br /&gt;
|-&lt;br /&gt;
|{PERCENTCOMPLETE}||survey.pstpl||A small graph showing the percentage of the survey completed&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPNAME}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group name&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPDESCRIPTION}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group description&lt;br /&gt;
|-&lt;br /&gt;
|{NUMBEROFQUESTIONS}||welcome.pstpl||Displays the total number of questions in the survey (just the number)&lt;br /&gt;
|-&lt;br /&gt;
|{THEREAREXQUESTIONS}||welcome.pstpl||Displays the sentence &amp;quot;There are X questions in this survey&amp;quot; - from the relevant language file. The X is replaced with the number of questions. Note that this will also work appropriately for singular or plural. If there is only 1 question, it will print &amp;quot;There is 1 question in this survey&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|{CHECKJAVASCRIPT}||All files (mainly for welcome.pstpl)||Warning message when end-user browser have javascript disabled&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION}||Question.pstpl||(&#039;&#039;&#039;Has been superseeded as of LS1.87&#039;&#039;&#039;) Displays the current question text (The format of {QUESTION} can customised by editing &#039;question_start.pstpl&#039;) Use the following: {QUESTION_TEXT}, {QUESTION_MANDATORY}, {QUESTION_HELP}, {QUESTION_MAN_MESSAGE}, {QUESTION_VALID_MESSAGE}, {QUESTION_INPUT_ERROR_CLASS}, and appropriate wrapping HTML instead of {QUESTION}&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWER}||question.pstpl, print_question.pstpl||presents the answer form for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{SGQ}||question.pstpl, question text||Can be used in the question text itself to reference the input field of the question dynamically by displaying the Survey-Group-Question id for the current question. (as of svn build 9755)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTIONHELP}||question.pstpl, print_question.pstpl||Displays help text (predefined tip for question type) for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CLASS}||question.pstpl, print_question.pstpl||unique class for each question type. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CODE}||question.pstpl, print_question.pstpl||Displays the current question code&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ESSENTIALS}||question.pstpl||the question ID and (if a question is conditional), &#039;style=&amp;quot;display:none;&amp;quot;&#039;. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_HELP}||question.pstp, question_start.pstpl||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TYPE_HELP}||print_question.pstp||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_INPUT_ERROR_CLASS}||question.pstp, question_start.pstpl||Provides a class if there was user input error&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ID}||print_question.pstp||Provides a unique ID for each question to allow styling for specific questions&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TEXT}||question.pstp, print_question.pstp, question_start.pstpl||Displays the text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MANDATORY}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_CLASS}||question.pstpl, print_question.pstpl||class if a question is mandatory. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_NUMBER}||print_question.pstpl||Incremental count of questions.&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_VALID_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated valid help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_SCENARIO}||print_question.pstp||Prints out the &#039;scenario&#039; text for conditional questions.&lt;br /&gt;
|-&lt;br /&gt;
|{NAVIGATOR}||navigator.pstpl||Displays navigation buttons (next, prev, last)&lt;br /&gt;
|-&lt;br /&gt;
|{CLEARALL}||All files (but intended for navigator.pstpl)||Displays the &amp;quot;Exit and Clear Results&amp;quot; link&lt;br /&gt;
|-&lt;br /&gt;
|{COMPLETED}||completed.pstpl||Displays the &#039;completed&#039; message for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{URL}||completed.pstpl||Displays the survey &#039;url&#039; and &#039;url text&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{PRIVACYMESSAGE}||privacy.pstpl||The privacy message is shown if you set your survey to be anonymous. [[Translating LimeSurvey|The text can be edited/translated]] in the language files. This can also be changed manually by editing the privacy.pstpl template you wish to use.&lt;br /&gt;
|-&lt;br /&gt;
|{TEMPLATEURL}||All Files||The URL to the current template location (useful for referencing image files in your template)&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYRESOURCESURL}||All Files||The URL to the current uploaded files for this survey location (useful for referencing image files in your question, group, ....)&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITCOMPLETE}||endpage.pstpl||The statement (from the language files) that tells the user they have completed the survey, and to press the &amp;quot;Submit&amp;quot; button&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITREVIEW}||survey.pstpl||The statement (from the language files) that tells the user they can review/change the answers they have made by clicking &amp;quot;&amp;lt;&amp;lt; prev&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{SAVEDID}||All Files||Displays &#039;Response ID&#039; of user&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|{QUEXMLPDF}||All Files||Displays button to export the queXML PDF of questionnaire including answers entered up until the point that has been completed in the survey.&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:FIRSTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users first name from the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:LASTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users last name from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:EMAIL}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users email from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_1}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_1 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_2}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_2 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWERSCLEARED}||Preferably in navigator.pstpl||The &amp;quot;Answers Cleared&amp;quot; statement from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{RESTART}||clearall.pstpl||URL to restart the survey&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERERROR}||register.pstpl||Shows any error messages in the register page (ie: &amp;quot;You must include an email address&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE1}||register.pstpl||The statement &amp;quot;You must be registered to complete this survey&amp;quot; from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE2}||register.pstpl||Details about registering from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERFORM}||register.pstpl||The actual form for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{SAVE}||Works suitable on navigator.pstpl||Displays the &#039;Save your responses so far&#039; button to offer the user to save and come back later to continue the survey. If the Save option is deactivated in the survey properties the tag will not be shown and ignored.&lt;br /&gt;
|-&lt;br /&gt;
|{LANGUAGECHANGER}||survey.pstpl||Displays a switch in multilingual surveys to change the question.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Input/Buttons== &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
Each &amp;quot;input&amp;quot; type in a survey has been given its own class name, so that you can add CSS to your &amp;quot;startpage.pstpl&amp;quot; file and have some control over the appearance of form buttons and inputs. These class names are as follows:&lt;br /&gt;
*&#039;&#039;&#039;submit&#039;&#039;&#039; (Submit Buttons)&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; (Text Inputs - for short free text, date, and numerical type)&lt;br /&gt;
*&#039;&#039;&#039;answertext&#039;&#039;&#039; (Text of answers)&lt;br /&gt;
*&#039;&#039;&#039;radio&#039;&#039;&#039; (Radio Buttons)&lt;br /&gt;
*&#039;&#039;&#039;checkbox&#039;&#039;&#039; (Check Boxes)&lt;br /&gt;
*&#039;&#039;&#039;select&#039;&#039;&#039; (Select / List Boxes)&lt;br /&gt;
*&#039;&#039;&#039;textarea&#039;&#039;&#039; (Large text inputs - for long free text)&lt;br /&gt;
*&#039;&#039;&#039;clearall&#039;&#039;&#039; (The &amp;quot;Exit and Clear Survey&amp;quot; link)&lt;br /&gt;
*&#039;&#039;&#039;rank&#039;&#039;&#039; (The rank style question. Doesn&#039;t set the colour of the select box or the text boxes, but it does allow the changing of background colour, text colour, size etc., for the rest of the ranking question)&lt;br /&gt;
*&#039;&#039;&#039;graph&#039;&#039;&#039; (The &amp;quot;percentage completed&amp;quot; graph table)&lt;br /&gt;
*&#039;&#039;&#039;innergraph&#039;&#039;&#039; (The table inside the graph table - this contains the 0% and 100% text. Use this for changing the size of this text)&lt;br /&gt;
*&#039;&#039;&#039;question&#039;&#039;&#039; (General settings for any question that is displayed within a table. Generally, you should use this to make sure that their font size and color is the same as you have used elsewhere as a default)&lt;br /&gt;
*&#039;&#039;&#039;mandatory&#039;&#039;&#039;  (Mandatory questions)&lt;br /&gt;
*&#039;&#039;&#039;input-error&#039;&#039;&#039; (User input error - for if a user has made a mistake with a mandatory question or question with validation)&lt;br /&gt;
*&#039;&#039;&#039;array1&#039;&#039;&#039; and &#039;&#039;&#039;array2&#039;&#039;&#039; (These two styles are cycled when presenting the range of answers for an array type question. This allows you to set an alternating background color for these question types. &#039;&#039;&#039;Array1&#039;&#039;&#039; is also used for the column headings in these question types)&lt;br /&gt;
*&#039;&#039;&#039;errormandatory&#039;&#039;&#039; (Sets the color and style of the &amp;quot;This question is mandatory&amp;quot; error message)&lt;br /&gt;
*&#039;&#039;&#039;warningjs&#039;&#039;&#039; (Sets the color and style of the warning message displayed if the participant&#039;s browser has javascript disabled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
There are also some elements that can be accessed using the ID of the element (&#039;&#039;&#039;#ID&#039;&#039;&#039; in CSS):&lt;br /&gt;
*&#039;&#039;&#039;surveycontact&#039;&#039;&#039; (The contact message shown on the start page)&lt;br /&gt;
*&#039;&#039;&#039;tokenmessage&#039;&#039;&#039; (used for messages inside the survey, e.g. the session expired error message)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
Because you can edit all the HTML aspects, there&#039;s no reason to surround your templates with a &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&#039;new_name&#039;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and then define a css for that new_name class.&lt;br /&gt;
&lt;br /&gt;
==Styling the progress bar== &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
The progress bar appearance can be modified with CSS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
To change the background color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-header {&lt;br /&gt;
 background-color: #3300FF;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
To change the border color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-content,&lt;br /&gt;
#progress-wrapper .ui-widget-header {&lt;br /&gt;
 border: 1px solid #FF0000;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Features Available to Developers== &amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
LimeSurvey has integrated some user-made patches that permits some special changes. These very advanced features (generally) require changes to the underlying code base of LimeSurvey and should be done carefully in order not to introduce security holes.&lt;br /&gt;
&lt;br /&gt;
===Support for your own Javascript functions=== &amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Some users may need to run Javascript on the survey pages, but calling &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; in the BODY element made it impossible to do so. This call has been replaced with a small JavaScript function in the HEAD that sniffs for the existence of &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; and &#039;&#039;&#039;template_onload()&#039;&#039;&#039; before calling them. In this way, a template author can create his or her own &#039;&#039;&#039;template_onload()&#039;&#039;&#039; function in the HEAD that replaces the default one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
*Disable XSS filter - in Global settings -&amp;gt; Security, set &amp;quot;Filter HTML for XSS&amp;quot; to No.&lt;br /&gt;
*Enter your script in the source of a question or group description.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:301--&amp;gt;&lt;br /&gt;
{{Note|For further details, see the [[Workarounds: Manipulating a survey at runtime using Javascript#How to use Script (eg. JavaScript etc.) in LimeSurvey|workaround section]].}}&lt;br /&gt;
&lt;br /&gt;
=Videos on Templates= &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
This video will demonstrate the basic and advanced template functions that are available to all LimeSurvey users. This includes changing the appearance of certain forms and inserting custom graphics. Additionally, it will thoroughly walk you through on how to edit and preview specific page templates, importing/exporting templates, modify appearance of questions in the CSS, and customizing survey description page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:302--&amp;gt;&lt;br /&gt;
Video - needed&lt;br /&gt;
&lt;br /&gt;
=Tips &amp;amp; Tricks= &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some language specific element== &amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
If you want to have some language specific sentence in a survey, for example a help at the end of each page, you can add in a .pstl file a sentence and hidding it for other language. If we hide it in the template.css, we can use the pseudo selector :lang, but we use some class for better compatibility.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
Below, there are two help sentences, in French and English. Put this on endpage.pstpl:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;fr&amp;quot; lang=&amp;quot;fr&amp;quot;&amp;gt;Pour de l&#039;aide en direct appelez le 000000&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;For some help, please call 000000&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
and in template.css:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:152--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.lang-fr .en{display:none}&lt;br /&gt;
.lang-en .fr{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change the layout of the survey page== &amp;lt;!--T:155--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:156--&amp;gt;&lt;br /&gt;
After editing and saving a template, it applies to a survey list page only if it is selected from the settings of the survey. To make it the default template, go under the &#039;&#039;&#039;General tab&#039;&#039;&#039; located in the &#039;&#039;&#039;Global settings&#039;&#039;&#039; of your LimeSurvey installation and choose the desired template. From now on, all the templates that use the &amp;quot;default&amp;quot; option as template plus the ones that are going to be newly created, will use the newly selected default template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
To use your current template for this page, you have to change the according setting from &#039;&#039;&#039;Global settings&#039;&#039;&#039;. In older versions, this change can be done by editing the $defaulttemplate setting from the config file: copy this setting from config-defaults.php to config.php which overrides config-defaults.php and edit this setting to &amp;lt;code lang=&amp;quot;html&amp;quot;&amp;gt;$defaulttemplate = &#039;yourtemplatename&#039;;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Import/Export of templates: Mac users== &amp;lt;!--T:158--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;Mac users&amp;lt;/u&amp;gt;, please note that the Mac OSX default archive utility may have problems with zip folders &amp;quot;generated on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:160--&amp;gt;&lt;br /&gt;
A workaround is to unix&#039;es unzip from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
$ unzip template.zip -d template&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:162--&amp;gt;&lt;br /&gt;
Archive: template.zip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
 inflating: template/startpage&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:164--&amp;gt;&lt;br /&gt;
 inflating: ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
Another workaround is to use scripts in their mac-compiled counterparts.&lt;br /&gt;
&lt;br /&gt;
==Replacing the help icon {{ObsoleteIn|2.50}} == &amp;lt;!--T:173--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:174--&amp;gt;&lt;br /&gt;
When a question help text is shown, then an help.gif image is used from the default template folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
You can replace this image by uploading a new help.gif, help.png or help.jpg in your custom template folder. It will then be automatically used instead of the default help icon.&lt;br /&gt;
&lt;br /&gt;
==Replacing an existing logo {{NewIn|2.50}} {{ObsoleteIn|3.0}}== &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:177--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In the &#039;&#039;&#039;default&#039;&#039; Template of 2.50, there is no preembedded logo. Read further our [[#Adding_your_own_logo |wiki on how to add your own logo]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
1. To edit the logo go to the &#039;&#039;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&#039;&#039; file which you can find it here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:179--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t1.PNG|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
2. Click the search button to find occurrences of logo related styles and search for &#039;&#039;logo&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:181--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:2.png|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
4. Edit the main style file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:185--&amp;gt;&lt;br /&gt;
You will see something similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t4.PNG|500px]]&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:187--&amp;gt;&lt;br /&gt;
If you want to change the image, just replace logo.gif with another image link. Example: (&amp;lt;u&amp;gt;logo.png&amp;lt;/u&amp;gt; or &amp;lt;u&amp;gt;logo.jpg&amp;lt;/u&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:188--&amp;gt;&lt;br /&gt;
If you want to change the image size, adjust width and height (in pixels) like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;width:100px; height:100px;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo {{ObsoleteIn|3.0}} == &amp;lt;!--T:190--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
1. Find and open the &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; template file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:192--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:startpage.pstpl.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
2. After this&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; &amp;gt;&amp;lt;div id=&amp;quot;topContainer&amp;quot; class=&amp;quot;jumbotron&amp;quot;&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
add this line to &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;img id=&#039;page_logo&#039; src=&#039;{TEMPLATEURL}/files/logo.png&#039; class=&amp;quot;clearfix pull-right&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
3. To upload your own logo, go to the template editor and upload your logo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:197--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:uploadyourlogo.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:199--&amp;gt;&lt;br /&gt;
To position your logo, please use one of the following css classes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:293--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the left side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:200--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-left&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:204--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the right side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:205--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-right&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:208--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want to center the logo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:209--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix center-block&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the same template with different logos== &amp;lt;!--T:214--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:215--&amp;gt;&lt;br /&gt;
If you want to use the same template for all surveys and just want to change the logo for each survey, you can use the {SID} placeholder in the template .pstpl file and thereby refer to different images:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:216--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;{TEMPLATEURL}files/logoImage-{SID}.png&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the default help to all question (hide_tip) {{ObsoleteIn|1.92}}== &amp;lt;!--T:217--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:218--&amp;gt;&lt;br /&gt;
There are 3 solutions to remove the default help:&lt;br /&gt;
# like a hide_tip attribute but for all question and survey.&lt;br /&gt;
# you can remove the {QUESTIONHELP} and its container from the file question.pstl. However, it can be a bad idea for the screenreader.&lt;br /&gt;
# for the default template and some other, add this at the end of tempate.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:219--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;span.questionhelp{display:none;}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display custom favicon== &amp;lt;!--T:220--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:221--&amp;gt;&lt;br /&gt;
A favicon is the little icon you see in the browser&#039;s address bar, list of bookmarks or tab. You can display your own icon as follows:&lt;br /&gt;
#Create a favicon - google will find you lots of free favicon generators.&lt;br /&gt;
#Name your new favicon &amp;quot;favicon.ico&amp;quot; and place it in your template /files directory.&lt;br /&gt;
#Add the following code to your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; before the &amp;lt;/head&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:222--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Different appearance for survey-/question-pages== &amp;lt;!--T:224--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:226--&amp;gt;&lt;br /&gt;
If you want LimeSurvey to change the appearance of every second page (i.e. of even and odd survey pages), you can use &#039;&#039;&#039;.page-odd&#039;&#039;&#039; class in your CSS file to change the appearance of odd pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:227--&amp;gt;&lt;br /&gt;
An example from default template of LimeSurvey 1.91+:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:228--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.page-odd table.question-group {&lt;br /&gt;
 background-color: #D2F2D3;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:232--&amp;gt;&lt;br /&gt;
If you do &#039;&#039;&#039;not&#039;&#039;&#039; want differentiate even and odd pages, find all instances of &#039;&#039;.page-odd&#039;&#039; in template.css and remove those styles.&lt;br /&gt;
&lt;br /&gt;
==Create a vertical separator  border for dual scale array== &amp;lt;!--T:233--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:234--&amp;gt;&lt;br /&gt;
To create a vertical separator border for a dual scale array, you can add the following lines to your &#039;&#039;&#039;template.css&#039;&#039;&#039;-file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:235--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
table.question thead td.header_separator,&lt;br /&gt;
table.question tbody td.dual_scale_separator&lt;br /&gt;
{&lt;br /&gt;
   border-right:solid 1px #00A8E1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:242--&amp;gt;&lt;br /&gt;
&#039;&#039;header_separator&#039;&#039; is used to adress the separator for the header &amp;quot;td&amp;quot;. The &amp;quot;dual_scale_separator&amp;quot; is used to address the separator column in the dual scale array.&lt;br /&gt;
&lt;br /&gt;
==Hide the survey contact message shown on the start page/survey list {{ObsoleteIn|3.0}} == &amp;lt;!--T:243--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:244--&amp;gt;&lt;br /&gt;
To hide the &amp;quot;Please contact ...&amp;quot; message on the start page (with the survey list), you can add the following to the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.js&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:245--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:246--&amp;gt;&lt;br /&gt;
$(&#039;#surveycontact&#039;).hide(); //Hides the survey contact message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:247--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the survey contact message shown on error messages {{ObsoleteIn|3.0}}== &amp;lt;!--T:248--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:249--&amp;gt;&lt;br /&gt;
If you want to remove the survey contact message from error messages, it&#039;ll be trickier. You can add the function from below. It calls the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.css&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:250--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
removeContactAdressFromMessage(); //Removes the survey contact message from error messages&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:253--&amp;gt;&lt;br /&gt;
and add the following function to your *template.js* file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:254--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
function removeContactAdressFromMessage()&lt;br /&gt;
{&lt;br /&gt;
if ($(&#039;#tokenmessage&#039;).length &amp;gt; 0)&lt;br /&gt;
   {&lt;br /&gt;
   var oldMessage = $(&#039;#tokenmessage&#039;).html();&lt;br /&gt;
   var indexContact = oldMessage.indexOf(&#039;Bitte kontaktieren&#039;);&lt;br /&gt;
   var newMessage = oldMessage.substr(0, indexContact);&lt;br /&gt;
   $(&#039;#tokenmessage&#039;).html(newMessage);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:266--&amp;gt;&lt;br /&gt;
It will probably not work for a survey in English language and has to be extended when used for multilingual surveys. But it&#039;s an idea/tip on how to solve this.&lt;br /&gt;
&lt;br /&gt;
==How to deal with multilingual question attributes {{ObsoleteIn|2.50}}== &amp;lt;!--T:267--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:268--&amp;gt;&lt;br /&gt;
If you have a multilingual survey and e. g. want to use a different string for the &amp;quot;other&amp;quot; field, this could only be done for the base language (until this feature was added at LimeSurvey 2.0). To work around this, paste in the field to change the label for &amp;quot;other&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:269--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;en&amp;quot;&amp;gt;New label&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;fr&amp;quot;&amp;gt;Nouveau label&amp;lt;/span&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:270--&amp;gt;&lt;br /&gt;
Add in the template.css of your template (at &#039;&#039;/limesurvey/upload/templates/&amp;lt;yourtemplatename&amp;gt;/template.css&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:271--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;html:lang(en) .fr{display:none}&lt;br /&gt;
html:lang(fr) .en{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo to the survey list {{ NewIn|3.0}} == &amp;lt;!--T:310--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:311--&amp;gt;&lt;br /&gt;
# First please open the theme editor for the theme you like to use. [[File:OpenThemeEditor.jpg]]&lt;br /&gt;
# We recommend to use fruity, it is our best theme currently. &lt;br /&gt;
# Then extend the theme and give it a name you will recognize. [[File:ExtendTheme.jpg]]&lt;br /&gt;
# In the following view you may upload the logo you want to use. [[File:UploadFileTheme.jpg]]&lt;br /&gt;
# Select the editor screen `Survey List´ in the Screen dropdown in the top right corner. [[File:OpenScreenSurveyList.jpg]]&lt;br /&gt;
# Then select `layout_survey_list.twig´ in the left side menu. [[File:EditLayoutSurveyListTwig.jpg]]&lt;br /&gt;
# In the editor scroll to line 126 and change the marked part to the filename of the image you uploaded to the theme before. [[File:ChangeSurveyListHeaderImageEditor.jpg]]&lt;br /&gt;
# Save your file. [[File:ThemeEditorSaveChanges.jpg]]&lt;br /&gt;
# Change default theme to your extended theme. [[File:ChangeDefaultTheme.jpg]]&lt;br /&gt;
&lt;br /&gt;
=Custom Question Views {{NewIn|3.0}}= &amp;lt;!--T:289--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:290--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; This is a temporary feature to be replaced in the future by question object (it will be very easy to move custom views to question object). It is disabled by default.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:291--&amp;gt;&lt;br /&gt;
As of version 2.5, you can create template-specific custom views for questions and some of their incorporated elements. This is useful if you want to modify the HTML layout of a particular question type for one or more surveys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:292--&amp;gt;&lt;br /&gt;
*In application/config/config.php, find &#039;config&#039;=&amp;gt;array and add this line to the array : &#039;allow_templates_to_overwrite_views&#039;=&amp;gt;1&lt;br /&gt;
*In /{your_template}/config.xml, set &amp;quot;overwrite_question_views&amp;quot; to true&lt;br /&gt;
*Copy application/views/survey/* to template/{your_view_directory}/survey/&lt;br /&gt;
*Note that you only need to copy the files that you intend to modify but the file structure must remain the same as in application/views/survey/&lt;br /&gt;
&lt;br /&gt;
=Insert Custom CSS or JavaScript files for template {{NewIn|2.50}}= &amp;lt;!--T:296--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:303--&amp;gt;&lt;br /&gt;
As of version 2.50, you can use the config.xml file to automatically load plugin files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:304--&amp;gt;&lt;br /&gt;
*Upload your files to the template /css or /scripts folder&lt;br /&gt;
*In /{your_template}/config.xml, add the file paths to the &amp;lt;css&amp;gt; or &amp;lt;js&amp;gt; blocks, something like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;css&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/jquery-ui-custom.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/bootstrap-slider.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:305--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/flat_and_modern.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:306--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/template.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:307--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/myCustomPlugin.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;js&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/template.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/bootstrap-slider.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:308--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;scripts/myCustomPlugin.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/js&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=File:Theme_editor_button.png&amp;diff=95976</id>
		<title>File:Theme editor button.png</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=File:Theme_editor_button.png&amp;diff=95976"/>
		<updated>2018-04-04T11:02:54Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: A screen shot of the theme editor button in Themes List, LS3.5&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A screen shot of the theme editor button in Themes List, LS3.5&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=File:Themes_menu.png&amp;diff=95941</id>
		<title>File:Themes menu.png</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=File:Themes_menu.png&amp;diff=95941"/>
		<updated>2018-04-04T10:57:53Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: screen shot of the menu &amp;quot;Themes&amp;quot;  inside configuration.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;screen shot of the menu &amp;quot;Themes&amp;quot;  inside configuration.&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95914</id>
		<title>Theme editor</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95914"/>
		<updated>2018-04-04T10:44:20Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt; &amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
LimeSurvey has an advanced theme and style system providing to developers an efficient way to customize the survey appearance. Since LS3, we&#039;re not speaking anymore about &#039;&#039;&#039;&amp;quot;templates&amp;quot;&#039;&#039;&#039; like in previous versions, but about &#039;&#039;&#039;&amp;quot;themes&amp;quot;&#039;&#039;&#039;. The &#039;&#039;&#039;themes&#039;&#039;&#039; allow control over the look and feel of pages during a survey. A survey administrator can select a default theme that will be used for each survey to further personalize it and improve its look and feel. &#039;&#039;&#039;Themes&#039;&#039;&#039;  come with options that provide to admin without coding skill a simple way to add a logo on the welcome page, to change the background colors, to select a font, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
LimeSurvey comes with 3 themes right out of the box. These initial themes are defined by directories located in the LimeSurvey installation &amp;quot;themes/survey/&amp;quot; directory. Each theme has it&#039;s own directory. Within the main directory of a theme you&#039;ll find a configuration file in XML, and numerous directories containing the views &#039;&#039;themes (.twig)&#039;&#039;&#039;, &#039;&#039;&#039;cascading style sheets (.css)&#039;&#039;&#039;, &#039;&#039;&#039;scripts&#039;&#039;&#039;,  &#039;&#039;&#039;images&#039;&#039;&#039; (&#039;&#039;&#039;.jpg&#039;&#039;&#039; or &#039;&#039;&#039;.png&#039;&#039;&#039;), and maybe others. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Since LimeSurvey 2.50, the theme engine use [http://getbootstrap.com/docs/3.3/ Bootstrap 3]  as CSS framework. Bootstrap 3 being a standard framework, developers will find a lot of documentation, tutorials and forum threads about it on Internet. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since LimeSurvey 3, the theme engine use [https://twig.symfony.com Twig], so the theme developers can change the logic of the survey rendering in a safe and easy way. Twig replace the old system of replacement keywords that was used in the previous versions. The logic that was used to generate the HTML of the keywords are now available inside the theme&#039;s views. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Snippet from Vanilla Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;twig&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.answercontainer }} col-xs-12&amp;quot; {{ aSurveyInfo.attr.answercontainer }}&amp;gt;&lt;br /&gt;
    {# NOTE: If you want to customize the question rendering, use a question theme #}&lt;br /&gt;
    {{ aQuestion.answer | raw }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Themes, being HTML and Twig code, tend to define the positioning and type of text to be displayed and similar structural features of the page. They often reference or include other files. Most of them reference a common cascading style sheets (CSS) file that defines the font style, color, size, background, and similar parameters common to all pages in the survey. Style sheets reference HTML &#039;&#039;&#039;class&#039;&#039;&#039; parameters that are associated with the various types of objects in the HTML code. This allows the style sheet to describe how to display each of the many types of text or other objects that may appear in multiple places. There are unique classes for each question type in LimeSurvey and thus giving detailed control over the appearance of each. Image files, like logos or special progress-bar constructors, may be referenced as well in the Theme file. Finally, special keywords in curly braces are replaced with text defined in the survey for each language translation correspondent (for example, the &#039;Survey Title&#039; or &#039;Question Text&#039; for each language defined).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
If you create a new custom theme, please consider contributing it back to the LimeSurvey community and make it available to others. With your help, we can grow our repository of themes, surveys, and other add-ons to make LimeSurvey even better! &lt;br /&gt;
See our [https://www.limesurvey.org/index.php?option=com_sobipro&amp;amp;sid=55:Templates&amp;amp;Itemid=729 LimeSurvey template repository] where you can share your templates.&lt;br /&gt;
&lt;br /&gt;
=Creating a new theme= &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To be able to create a new theme (or edit an existing theme), you need [[Manage users#Set global permissions for a user|Template Editing user permission]] in LimeSurvey as well as permission to manipulate the files in the underlying operating system hosting your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;Note of Warning:&#039;&#039;&#039;&amp;lt;/span&amp;gt; If you change themes, you could also affect all the pre-existing surveys from your LimeSurvey installation. Themes are an advanced feature that require experience and HTML knowledge in order to make them running smoothly.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
The preferred way to create a new theme is through the &#039;&#039;&#039;Theme Editor&#039;&#039;&#039; (see below), which is located in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; dialog. Some people may like to work directly with theme files so that they can use their favorite text editor instead of the web interface. In this case, still use the Theme Editor to first create your new theme. This will create a new base theme with all the files you need in the &#039;&#039;LimeSurvey_web_root/upload/themes/survey/your_new_template&#039;&#039; directory. From there you can use your text editor to manually adjust the template files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; on unix/linux systems, these theme files will be owned by the group and user where the web server is running (may be &amp;quot;www&amp;quot; for some systems). So, make sure you have enough access to edit these files, When you save them, make sure they don&#039;t change ownership! In this way, you can still use the web Theme Editing interface if needed.&amp;lt;/div&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A number of &#039;public&#039; elements of LimeSurvey can be adjusted by a series of themes. The next section provides a very brief explanation of these templates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
{{Note|Themes files may seem complex. Besides HTML, you might also need to understand CSS, Twig, and JavaScript.}}&lt;br /&gt;
&lt;br /&gt;
=The LimeSurvey Theme editor= &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
To ease the understanding and quick update of a Theme, LimeSurvey provides a &#039;&#039;&#039;Theme Editor&#039;&#039;&#039; in the main &#039;&#039;&#039;administrative&#039;&#039;&#039; toolbar of the application. This Theme Editor is only available to users [[Manage users#Set global permissions for a user|with the Templates permission]] and to superadministrators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:297--&amp;gt;&lt;br /&gt;
{{Alert|title=Attention|text=A theme that is not correctly constructed can make a survey (that uses the respective template) inoperable. }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
The LimeSurvey theme editor allows you to edit the contents of your themes online. To start the Theme Editor: click on &#039;&#039;&#039;Themes&#039;&#039;&#039; link in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; menu, and then click on the &amp;quot;Theme editor&amp;quot;  button next of the theme you want to edit or extend. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:285--&amp;gt;&lt;br /&gt;
[[File:templates.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:286--&amp;gt;&lt;br /&gt;
The template editor page allows you to select the template you would like to edit/view. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:279--&amp;gt;&lt;br /&gt;
[[File:Template-editor-2013-7-10_11_38_16.png|center]]&lt;br /&gt;
&lt;br /&gt;
==The template menu== &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:298--&amp;gt;&lt;br /&gt;
The following options are available:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:280--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Create&#039;&#039;&#039;: Allows you to create a new template. In order not to start from scratch, the template &#039;default&#039; is copied.&lt;br /&gt;
*&#039;&#039;&#039;Import&#039;&#039;&#039;: Allows you to import a template from a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Export&#039;&#039;&#039;: Allows you to export the current template to a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Copy&#039;&#039;&#039;: Allows you to make a new template by copying the current one.&lt;br /&gt;
*&#039;&#039;&#039;Rename&#039;&#039;&#039;: Allows you to change the name of the template. It is generally used after copying or importing a template.&lt;br /&gt;
*&#039;&#039;&#039;Template&#039;&#039;&#039;: It is a drop-down list that shows all the available templates that are located in your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Screen&#039;&#039;&#039;: It is a drop-down list which allows you to choose which particular survey page of that template you want to look at.&lt;br /&gt;
*&#039;&#039;&#039;Return to admin panel&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Import/export/copy a template== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
When you &#039;&#039;&#039;export &#039;&#039;&#039;a template, a ZIP-file archive with all the files your template consists of will be created (.pstpl files, images, css files, ...). You can simply &#039;&#039;&#039;import&#039;&#039;&#039; the exported zip-file into another LimeSurvey installation by using the import feature or you can manually copy the archive into another LimeSurvey installation and extract it into the corresponding [[Theme editor#Template files location|template directory there]]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:288--&amp;gt;&lt;br /&gt;
However, it is preferred to use the LimeSurvey template import/export/copy functions in the template editor.&lt;br /&gt;
&lt;br /&gt;
==Page Structure / Template Use== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;The Welcome Page:&#039;&#039;&#039; startpage.pstpl, welcome.pstpl, privacy.pstpl,  navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Questions Pages:&#039;&#039;&#039; startpage.pstpl, survey.pstpl, startgroup.pstpl, groupdescription.pstpl, question.pstpl, endgroup.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Final Page:&#039;&#039;&#039; startpage.pstpl, assessment.pstpl, completed.pstpl, endpage.pstpl&lt;br /&gt;
&lt;br /&gt;
==Template Files== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The following template files are used to produce your public survey and must exist in any new template folder you create:&lt;br /&gt;
*&#039;&#039;&#039;startpage.pstpl:&#039;&#039;&#039; Produces the start of each html page. It starts at the &amp;quot;&amp;lt;head&amp;gt;&amp;quot; tag, and should not contain the &amp;quot;&amp;lt;html&amp;gt;&amp;quot; tag. This &#039;very beginning&#039; of a standard html page is written by the scripts. Please ensure that your startpage.pstpl files contains a &amp;lt;body&amp;gt; tag. Even though many browsers do not require strict adherence to the W3 HTML standards, the LimeSurvey script needs to find a &amp;lt;body&amp;gt; tag to run certain javascript elements. It is not expected to see many &#039;keywords&#039; used in the startpage.pstpl file. However, you may wish to put the {SURVEYNAME} into the title. The startpage.pstpl file can contain code that ends in the corresponding endpage.pstpl file. For example, you can start a table in this file and close the table in the endpage.pstpl file. The startpage.pstpl and endpage.pstpl files wrap around every possible page used by LimeSurvey.&lt;br /&gt;
*&#039;&#039;&#039;survey.pstpl:&#039;&#039;&#039; This template is the second used on most pages and provides a space to put the survey name and description. This template does not have a corresponding &#039;closing&#039; template, and subsequently you should close all tags opened in this template file (i.e.: don&#039;t leave a table open here because there is nowhere else to close it).&lt;br /&gt;
*&#039;&#039;&#039;welcome.pstpl:&#039;&#039;&#039; This template is only used in the welcome screen (which is also on the main page for &#039;all in one&#039; surveys). You can use this to print out the welcome text, and other information that should be provided in the introduction. Like the &#039;survey.pstpl&#039; file, there is no corresponding &#039;closing&#039; template, so all tags opened in this template file should be closed as well.&lt;br /&gt;
*&#039;&#039;&#039;startgroup.pstpl:&#039;&#039;&#039; This template can provide a &#039;summary&#039; wrap around for questions within a group. It has a matching &#039;endgroup.pstpl&#039; template that can be used to close any opened tags in this file, so you can open a table within this.&lt;br /&gt;
*&#039;&#039;&#039;groupdescription.pstpl:&#039;&#039;&#039; This template file is used to display a description of a group. Please note that in the survey settings (access the &#039;&#039;Presentation &amp;amp; navigation settings&#039;&#039; by clicking on the &#039;&#039;&#039;Presentation&#039;&#039;&#039; tab) you can set if the group description should be shown or not. If not, then this file is not included at all.&lt;br /&gt;
*&#039;&#039;&#039;question.pstpl:&#039;&#039;&#039; This file contains the question, answer, and help text sections of your survey. In the &amp;quot;group by group&amp;quot; and &amp;quot;all in one&amp;quot; surveys, this template is cycled repeatedly with each question. There is no corresponding closing file for this and all tags should be closed.&lt;br /&gt;
*&#039;&#039;&#039;question_start.pstpl:&#039;&#039;&#039; This file contains the individual elements found at the start of a question. It is included within &#039;question.pstpl&#039; via the {QUESTION} keyword. It is intended to allow template designers more control over the layout of a question. This template sits outside the normal templating system and &#039;&#039;&#039;was superseeded (as of LimeSurvey 1.87)&#039;&#039;&#039;. All keywords from this template are now available directly in question.pstpl. &lt;br /&gt;
*&#039;&#039;&#039;completed.pstpl:&#039;&#039;&#039; This page is displayed as the final page when the survey responses have been saved and the survey is over. It can be used to display a &amp;quot;forwarding link&amp;quot; as set in the survey setup.&lt;br /&gt;
*&#039;&#039;&#039;endgroup.pstpl:&#039;&#039;&#039; This file closes the group, and can be used to close off any tags opened in the startgroup.pstpl file&lt;br /&gt;
*&#039;&#039;&#039;navigator.pstpl:&#039;&#039;&#039; This file contains the buttons that navigate through the survey, &amp;quot;next&amp;quot;, &amp;quot;prev&amp;quot;, &amp;quot;last&amp;quot;, &amp;quot;submit&amp;quot;, &amp;quot;save so far&amp;quot;  and the &amp;quot;clear all&amp;quot; link. It is used in all pages except the completed page.&lt;br /&gt;
*&#039;&#039;&#039;printanswers.pstpl:&#039;&#039;&#039; This file has the HTML wrapper necessary for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_group.pstpl:&#039;&#039;&#039; This file is the same as startgroup.pstpl and endgroup.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_question.pstpl:&#039;&#039;&#039; This file is the same as question.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_survey.pstpl:&#039;&#039;&#039; This file is the same as survey.pstpl, but for the print version of the survey.&lt;br /&gt;
&lt;br /&gt;
== CSS and Javascript== &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
Two files that are always used in a template are template.css (for CSS) and template.js (for Javascript).&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATECSS}:&#039;&#039;&#039; Add lines for default css, template.css, and template-rtl.css for rtl language.&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATEJS}:&#039;&#039;&#039; Add lines for default javascript files, template.js, and all js files needed for LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
=== Using Bootstrap=== &amp;lt;!--T:294--&amp;gt;&lt;br /&gt;
LimeSurvey has Bootstrap 3 embedded, so you can style all your templates with the well documented Bootstrap classes.&lt;br /&gt;
For more information please refer to the [https://getbootstrap.com Bootstrap documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:295--&amp;gt;&lt;br /&gt;
The [https://github.com/flatlogic/awesome-bootstrap-checkbox Awesome-Bootstrap-Checkbox] plugin is also included. With it, you can use the typical Bootstrap color-classes (info,warning,danger,etc.) also with the suffix &amp;quot;-checkbox&amp;quot; or &amp;quot;-radio&amp;quot;, though styling checkboxes and radios as you prefer.&lt;br /&gt;
&lt;br /&gt;
=== Replacing default CSS or Javascript=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Some questions use specific files for Javascript or CSS. If you need to replace a function, use a cascading system. For javascript function, the last function read is the function used.&lt;br /&gt;
&lt;br /&gt;
==Other Template Files== &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The &#039;&#039;&#039;privacy.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;invitationemail.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;reminderemail.pstpl&#039;&#039;&#039;, and &#039;&#039;&#039;confirmationemail.pstpl&#039;&#039;&#039; are no longer used by LimeSurvey and defaults are instead set in the applicable language files. The email messages can now be edited on a survey by survey basis.&lt;br /&gt;
&lt;br /&gt;
==Standard Pages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
There are ten standard pages that a survey participant may see in the course of taking or accessing the LimeSurvey application.  Each is constructed from a number of common &#039;&#039;&#039;Template&#039;&#039;&#039; files from the &#039;&#039;&#039;Template&#039;&#039;&#039; specified in the settings of the survey. The table below indicates which template files are used in constructing each of these pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!  &#039;&#039;&#039;Survey Pages/&#039;&#039;&#039;&amp;lt;br /&amp;gt;&#039;&#039;&#039;Template Files&#039;&#039;&#039;!!Survey&amp;lt;br /&amp;gt;List!!Welcome!!Question!!Completed!!Clear All!!Register!!Load!!Save!!Print&amp;lt;br /&amp;gt;Answers!!Print&amp;lt;br /&amp;gt;Survey&lt;br /&gt;
|-&lt;br /&gt;
|SurveyList||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Welcome|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Privacy|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Navigator|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Survey|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|StartGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|GroupDescription|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Question&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|EndGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Assessment|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Completed|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ClearAll|| || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Register|| || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Load|| || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||&lt;br /&gt;
|-&lt;br /&gt;
|Save|| || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| ||&lt;br /&gt;
|-&lt;br /&gt;
|PrintAnswers|| || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||&lt;br /&gt;
|-&lt;br /&gt;
|Print Survey || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Group || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Question || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|StartPage&amp;lt;br /&amp;gt;EndPage&amp;lt;br /&amp;gt;Template.css||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.90+, this replaces question.pstpl AND question_start.pstpl. If you are using an old custom template, you need to add the following line to the beginning of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div {QUESTION_ESSENTIALS} class=&amp;quot;{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;And then add the corresponding closing tag to the end of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.91 and earlier, LimeSurvey js files are not included in the template. In version 2, &#039;&#039;&#039;you have to use {TEMPLATEJS} in one of your template file&#039;&#039;&#039; to add the link to the js file. You can add it in startpage.pstpl or in endpage.pstpl. You can remove the {TEMPLATEURL}/template.js line and you have to replace with {TEMPLATEJS} to update a personal template.&lt;br /&gt;
&lt;br /&gt;
==The File Control Section== &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
In the &amp;quot;file control&amp;quot; window on the left, you can click on one of the template files that is used to compile the page. You can see the &#039;&#039;Screen part&#039;&#039;, JavaScript, and CSS files. The HTML code for that file will then appear in the &amp;quot;Now editing&amp;quot; window in the center. If the template is editable (determined by directory permissions) you can then make any changes and save them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:299--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:File Control Section.png|center]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The &amp;quot;Other files&amp;quot; window shows a list of all other files from the template directory. You can use the right side to &#039;&#039;&#039;upload and select image files (your pics, logos,...) or other files needed to create your template&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:300--&amp;gt;&lt;br /&gt;
Instead of using a link for each picture, utilize the field string {TEMPLATEURL}. So, instead of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;/limesurvey/templates/yourtemplate/files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
You can use {{NewIn|2.50}}:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:287--&amp;gt;&lt;br /&gt;
In LimeSurvey versions before 2.50 use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
A &amp;quot;sample&amp;quot; of the template page you are editing will be visible in the bottom of the screen. There is no way to delete a template from the template editor. This must be done by accessing the underlying directory and deleting manually the files from there. You also have the possibility to select different screen resolutions in order to better evaluate the feel and look of the template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The shipped templates cannot be edited using the template editor. If you want to modify them, create a copy first and edit the copy.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Template files location== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
LimeSurvey stores each of the &#039;standard&#039; templates in their own distinct sub-directory within the &#039;&#039;/templates&#039;&#039; directory that is kept in the public directory with the other LimeSurvey public files. Customized user templates are stored in the &#039;&#039;/upload/templates&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
There should &#039;&#039;&#039;ALWAYS&#039;&#039;&#039; be a &amp;quot;default&amp;quot; directory in the templates directory. This template is used by default and as a fall-back if a template folder doesn&#039;t exist, or can&#039;t be found. It comes installed by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
You can use any image files that you upload into the template management area with the help of this syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{TEMPLATEURL}filename.xyz&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Styling questions with CSS= &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
Styling of questions in CSS has become much easier. Each question type has now a unique class. The mandatory questions have an additional mandatory class. For example, for a non-mandatory question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
and if the question is mandatory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
and if the question is mandatory, but the user didn&#039;t answer it or if there is validation on a question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
and if the question has validation applied, but the user hasn&#039;t answered correctly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question6&amp;quot; class=&amp;quot;text-short input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Global classes for question part== &amp;lt;!--T:273--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:274--&amp;gt;&lt;br /&gt;
These classes are used for each question type. Some question types use only one or two classes, while others may use much more.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:281--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable alternance&amp;quot;&lt;br /&gt;
|+ Global classes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Class name&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Part&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Question type&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Examples&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Note&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question {{ObsoleteIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;p class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;question&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-answers {{NewIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;div class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;ls-answers&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .subquestions-list&lt;br /&gt;
| List of subquestion&lt;br /&gt;
| Multi choice question, array question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;subquestions-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;subquestions-list&amp;quot;&amp;gt;&lt;br /&gt;
| .questions-list is used too&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answers-list&lt;br /&gt;
| List of answers&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;answers-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;answers-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answer-item&lt;br /&gt;
| The answer part: one answer&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;answer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;answer-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .noanswer-item&lt;br /&gt;
| The answer part for no answer&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;noanswer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
| No answer is an answer too, then have double class noanswer-item and answer-item&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question-item&lt;br /&gt;
| The question part: one question&lt;br /&gt;
| Multi text question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;question-item&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;question-item&amp;quot;&amp;gt;&lt;br /&gt;
| Some answers are questions too. Then we have a lot of class=&amp;quot;question-item answer-item&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-list&lt;br /&gt;
| A list of checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;checkbox-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| Some question types use multi-list class, like checkbox with comment: class=&amp;quot;checkbox-list text-list&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of checkbox&lt;br /&gt;
| Array (numbers) with checkbox option&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-item&lt;br /&gt;
| The answer part with a checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;checkbox-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;checkbox-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-list&lt;br /&gt;
| A list of radio item&lt;br /&gt;
| Single choice question, array question type (each row)&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;radio-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;radio-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-array {{NewIn|3.0}}&lt;br /&gt;
| A array of radio item&lt;br /&gt;
| Array question type&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;radio-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-item&lt;br /&gt;
| The answer part with a radio&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;radio-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;radio-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-list&lt;br /&gt;
| A list of text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-item&lt;br /&gt;
| The answer part of a text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;text-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;text-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .numeric-list&lt;br /&gt;
| A list of text input with numeric only answer&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-list&lt;br /&gt;
| A list of text input with numeric only answer (each row)&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-array  {{NewIn|3.0}}&lt;br /&gt;
| The answer part of a numeric input&lt;br /&gt;
| Array of number&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;number-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-list  {{ObsoleteIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;select-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-list  {{NewIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select) (each row)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of dropdown&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-item  {{ObsoleteIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;select-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;select-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-item  {{NewIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;dropdown-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;dropdown-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .hide  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Used for accessibility: hidden with css but read by screenreader, since 2.50 : you can use sr-only from bootstrap&lt;br /&gt;
| Short text question&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;hide&amp;quot;&amp;gt;&lt;br /&gt;
| Can be used for other purposes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is activated&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it, but you can use it too in your template&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden-sr {{NewIn|3.0}}&lt;br /&gt;
| Used for accessibility: hide it if js is activated, but always show if user use a screenreader&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-js-hidden-sr&amp;quot;&amp;gt;&lt;br /&gt;
| Button&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-no-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is not activated&lt;br /&gt;
| Link&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it for inactive link if javascript is not activated&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-label-xs-visibility {{NewIn|3.0}}&lt;br /&gt;
|  Label to be hidden in big screen, but show with little screen (with no more table) and to screenreader&lt;br /&gt;
| label&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| Used for label inside table cell of array question type&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-input-group-extra {{NewIn|3.0}}&lt;br /&gt;
| Same usage of boostrap input-group-addon, but without the border and the background.&lt;br /&gt;
| right suffix&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-input-group-extra&amp;quot;&amp;gt;&lt;br /&gt;
| Used for right and left suffix (global)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=checkbox]&lt;br /&gt;
| Question with checkbox&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;checkbox&amp;quot; class=&amp;quot;checkbox&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=radio]&lt;br /&gt;
| Question with radio&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;radio&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text&lt;br /&gt;
| input[type=text]&lt;br /&gt;
| Question with input text, or textarea&lt;br /&gt;
| &amp;amp;lt;textarea class=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answertext&lt;br /&gt;
| Array question type&lt;br /&gt;
| Answer part of array question type&lt;br /&gt;
| &amp;amp;lt;th class=&amp;quot;answertext&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .col-answers&lt;br /&gt;
| Array question type&lt;br /&gt;
| Column of answers&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .odd .even {{ObsoleteIn|2.50}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for column&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .array1 .array2  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for line&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;array1&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-odd .ls-even  {{NewIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for sub-question and Y axis&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;ls-odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Some example of question part with classes=== &amp;lt;!--T:275--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:276--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Text-short question type:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;question answer-item text-item &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;label class=&amp;quot;hide label&amp;quot; for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Answer&amp;lt;/label&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;50&amp;quot; class=&amp;quot;text  empty&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:277--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Multiple short text&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;subquestions-list questions-list text-list&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li class=&amp;quot;question-item answer-item text-item&amp;quot; id=&amp;quot;javatbdSGQA&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;label for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Some example subquestion&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;span&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;20&amp;quot; class=&amp;quot;text empty&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:282--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Array question type&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;question subquestion-list questions-list &amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;caption class=&amp;quot;hide read&amp;quot;&amp;gt;Some explanation for accessibility.&amp;lt;/caption&amp;gt;&lt;br /&gt;
	&amp;lt;colgroup class=&amp;quot;col-responses&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;50%&amp;quot; class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;25%&amp;quot; class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;13.3%&amp;quot; class=&amp;quot;col-no-answer even&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;/colgroup&amp;gt;&lt;br /&gt;
	&amp;lt;thead&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array1 dontread&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;1&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;No answer&amp;lt;/th&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/thead&amp;gt;&lt;br /&gt;
	&amp;lt;tbody&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array2 answers-list radio-list&amp;quot; id=&amp;quot;javatbdSGQ&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;20%&amp;quot; class=&amp;quot;answertext&amp;quot;&amp;gt;Some example subquestion&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer_cell_001 answer-item radio-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;1&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer-item radio-item noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;No answer&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The full list of question classes== &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Question Type&#039;&#039;&#039;||&#039;&#039;&#039;Question Class&#039;&#039;&#039;||&#039;&#039;&#039;Question ID&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|5 point choice||.choice-5-pt-radio||5&lt;br /&gt;
|-&lt;br /&gt;
|Array (10 point choice)||.array-10-pt||B&lt;br /&gt;
|-&lt;br /&gt;
|Array (5 point choice)||.array-5-pt||A&lt;br /&gt;
|-&lt;br /&gt;
|Array (Flexible Labels) dual scale||.array-flexible-duel-scale ||1&lt;br /&gt;
|-&lt;br /&gt;
|Array (Increase, Same, Decrease)||.array-increase-same-decrease||E&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Numbers)||.array-multi-flexi ||:&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Text)||.array-multi-flexi-text||;&lt;br /&gt;
|-&lt;br /&gt;
|Array (Yes/No/Uncertain)||.array-yes-uncertain-no||C&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels)||.array-flexible-row ||F&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels) by column||.array-flexible-column||H&lt;br /&gt;
|-&lt;br /&gt;
|Boilerplate question||.boilerplate||X&lt;br /&gt;
|-&lt;br /&gt;
|Date||.date||D&lt;br /&gt;
|-&lt;br /&gt;
|Gender||.gender||G&lt;br /&gt;
|-&lt;br /&gt;
|Huge free text||.text-huge||U&lt;br /&gt;
|-&lt;br /&gt;
|Language switch||.language||I&lt;br /&gt;
|-&lt;br /&gt;
|List (dropdown)||.list-dropdown||!&lt;br /&gt;
|-&lt;br /&gt;
|List (radio)||.list-radio||L&lt;br /&gt;
|-&lt;br /&gt;
|List with comment||.list-with-comment||O&lt;br /&gt;
|-&lt;br /&gt;
|Long free text||.text-long||T&lt;br /&gt;
|-&lt;br /&gt;
|Multiple numerical input||.numeric-multi||K&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options||.multiple-opt||M&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options with comments||.multiple-opt-comments||P&lt;br /&gt;
|-&lt;br /&gt;
|Multiple short text||.multiple-short-txt||Q&lt;br /&gt;
|-&lt;br /&gt;
|Numerical input||.numeric||N&lt;br /&gt;
|-&lt;br /&gt;
|Ranking||.ranking||R&lt;br /&gt;
|-&lt;br /&gt;
|Short free text||.text-short||S&lt;br /&gt;
|-&lt;br /&gt;
|Yes/No||.yes-no||Y&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==The full list of validation classes== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Note:  Prior to 1.92, only .mandatory and .input-error classes were available.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
These apply to the help and/or validation tip messages so that each type can be individually styled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
The .hide-tip option and .input-error options interact by default so that you can have validation tips hidden. However, they do appear when there are validation errors and disappear again when those errors are rectified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
All of these are designed to eliminate the need for pop-up alert messages. Instead, tips can appear/disappear as needed and are color-coded to indicate whether the answers pass the validation criteria.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Furthermore, when you first visit a page that has unmet validation criteria, you can color-code the tips in a pleasing color to show which validation criteria have not been met yet; then re-display the page using a harsher color if the person submits the page with lingering validation errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Purpose&#039;&#039;&#039;||&#039;&#039;&#039;CSS Class&#039;&#039;&#039;||&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Mandatory||.mandatory||the question is mandatory&lt;br /&gt;
|-&lt;br /&gt;
|User input error||.input-error||the question had at least one validation error&lt;br /&gt;
|-&lt;br /&gt;
|Hide Tip||.hide-tip||added if you use the hide_tip option&lt;br /&gt;
|-&lt;br /&gt;
|Num answers||.em_num_answers||for for min_answers and max_answers&lt;br /&gt;
|-&lt;br /&gt;
|Value range||.em_value_range||for min/max_num_value_n and multiflexible_min/max&lt;br /&gt;
|-&lt;br /&gt;
|Sum range||.em_sum_range||for min/max/equals_num_value&lt;br /&gt;
|-&lt;br /&gt;
|Regex validation||.em_regex_validation||for regular-expression validation of the question&lt;br /&gt;
|-&lt;br /&gt;
|Question-level validation function||.em_q_fn_validation||for the em_validation_q option&lt;br /&gt;
|-&lt;br /&gt;
|Subquestion-level validation function||.em_sq_fn_validation||for the em_validation_sq option&lt;br /&gt;
|-&lt;br /&gt;
|Other comment mandatory||.em_other_comment_mandatory||for other_comment_mandatory option - shows when &amp;quot;other&amp;quot; is selected but associated comment is missing.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing styles into your custom template== &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
The custom question styles are near the bottom of each template&#039;s CSS file and start with:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;/* --------------------------- START: Question styles  ------------------------------ */&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
If you&#039;re styling your own custom template, you should be able to copy everything after the above one from &#039;&#039;templates/default/template.css&#039;&#039; (for table-based layouts) or &#039;&#039;/templates/limespired/template.css&#039;&#039; (for CSS-based layouts) into your own style sheet without any impact on your other styles.&lt;br /&gt;
&lt;br /&gt;
==Internet Explorer conditional style sheets== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
Because of the marked discrepancies in rendering between IE6 &amp;amp; IE7 and the other browsers, there are special IE conditional style sheets included for each template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_all-versions.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if lt IE 7]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_older-than-7.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8]&amp;gt;&lt;br /&gt;
		&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}ie_fix_8.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You should include the above code within your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; and copies of both the IE style sheets from either &#039;&#039;/templates/default/&#039;&#039; or &#039;&#039;/templates/limespired&#039;&#039; for Tables base layout and CSS based layout respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; If you copy the styles into your own style sheet you will almost certainly need to tweak them.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alternative solution for Internet explorer=== &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
You can put a conditional class for body in startpage.pstpl and use this class in your template.css. This method is used in the citronade template{{ObsoleteIn|2.06}}. Adding a js / no-js class to have javascript / no javascript system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;!--[if lt IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie6 ielt7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie8 ielt9  no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 9 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if gt IE 9]&amp;gt;&amp;lt;!--&amp;gt;&amp;lt;body id=&amp;quot;body&amp;quot; class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} no-js&amp;quot;&amp;gt;&amp;lt;!--&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;script type=&#039;text/javascript&#039;&amp;gt;/*&amp;lt;![CDATA[*/(function(H){ H.className=H.className.replace(/\bno-js\b/,&#039;js&#039;) })(document.getElementsByTagName(&#039;body&#039;)[0]);/*]]&amp;gt;*/&amp;lt;/script&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
And in template.css use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;.ie6{/*specific for internet explorer 6*/}&lt;br /&gt;
.ielt8{/*specific for internet explorer 6 and 7*/}&lt;br /&gt;
.ie{/*specific for all internet explorer */}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Right-to-Left (RTL) Languages and justify== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
The text editor within LimeSurvey is able to format RTL text. However, the editor itself shows the RTL language in a left to right format when justified. This is just an editor display issue. The RTL and justified question or text will display correctly from right to left, even when justified, in your survey or on preview.&lt;br /&gt;
&lt;br /&gt;
==Keywords== &amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:309--&amp;gt;&lt;br /&gt;
{{Deprecated|3.0}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
Keywords within a template file get replaced by the current survey information. They are surrounded by curly brackets, for example: {SURVEYNAME}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
The following strings will be replaced by LimeSurvey when parsing the template file and presenting it to survey users. These field strings will work on almost every template except for the &#039;Completed Page&#039;. (Most of these strings can be found in the common.php file. If it&#039;s not there, look in the index.php file.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!&#039;&#039;&#039;Keyword&#039;&#039;&#039;!!&#039;&#039;&#039;Template files&#039;&#039;&#039;!!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYNAME}||All Files||The survey title&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYDESCRIPTION}||All Files||The survey description&lt;br /&gt;
|-&lt;br /&gt;
|{WELCOME}||All files (mainly for welcome.pstpl)||The survey &#039;welcome&#039; text&lt;br /&gt;
|-&lt;br /&gt;
|{PERCENTCOMPLETE}||survey.pstpl||A small graph showing the percentage of the survey completed&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPNAME}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group name&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPDESCRIPTION}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group description&lt;br /&gt;
|-&lt;br /&gt;
|{NUMBEROFQUESTIONS}||welcome.pstpl||Displays the total number of questions in the survey (just the number)&lt;br /&gt;
|-&lt;br /&gt;
|{THEREAREXQUESTIONS}||welcome.pstpl||Displays the sentence &amp;quot;There are X questions in this survey&amp;quot; - from the relevant language file. The X is replaced with the number of questions. Note that this will also work appropriately for singular or plural. If there is only 1 question, it will print &amp;quot;There is 1 question in this survey&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|{CHECKJAVASCRIPT}||All files (mainly for welcome.pstpl)||Warning message when end-user browser have javascript disabled&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION}||Question.pstpl||(&#039;&#039;&#039;Has been superseeded as of LS1.87&#039;&#039;&#039;) Displays the current question text (The format of {QUESTION} can customised by editing &#039;question_start.pstpl&#039;) Use the following: {QUESTION_TEXT}, {QUESTION_MANDATORY}, {QUESTION_HELP}, {QUESTION_MAN_MESSAGE}, {QUESTION_VALID_MESSAGE}, {QUESTION_INPUT_ERROR_CLASS}, and appropriate wrapping HTML instead of {QUESTION}&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWER}||question.pstpl, print_question.pstpl||presents the answer form for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{SGQ}||question.pstpl, question text||Can be used in the question text itself to reference the input field of the question dynamically by displaying the Survey-Group-Question id for the current question. (as of svn build 9755)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTIONHELP}||question.pstpl, print_question.pstpl||Displays help text (predefined tip for question type) for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CLASS}||question.pstpl, print_question.pstpl||unique class for each question type. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CODE}||question.pstpl, print_question.pstpl||Displays the current question code&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ESSENTIALS}||question.pstpl||the question ID and (if a question is conditional), &#039;style=&amp;quot;display:none;&amp;quot;&#039;. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_HELP}||question.pstp, question_start.pstpl||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TYPE_HELP}||print_question.pstp||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_INPUT_ERROR_CLASS}||question.pstp, question_start.pstpl||Provides a class if there was user input error&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ID}||print_question.pstp||Provides a unique ID for each question to allow styling for specific questions&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TEXT}||question.pstp, print_question.pstp, question_start.pstpl||Displays the text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MANDATORY}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_CLASS}||question.pstpl, print_question.pstpl||class if a question is mandatory. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_NUMBER}||print_question.pstpl||Incremental count of questions.&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_VALID_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated valid help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_SCENARIO}||print_question.pstp||Prints out the &#039;scenario&#039; text for conditional questions.&lt;br /&gt;
|-&lt;br /&gt;
|{NAVIGATOR}||navigator.pstpl||Displays navigation buttons (next, prev, last)&lt;br /&gt;
|-&lt;br /&gt;
|{CLEARALL}||All files (but intended for navigator.pstpl)||Displays the &amp;quot;Exit and Clear Results&amp;quot; link&lt;br /&gt;
|-&lt;br /&gt;
|{COMPLETED}||completed.pstpl||Displays the &#039;completed&#039; message for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{URL}||completed.pstpl||Displays the survey &#039;url&#039; and &#039;url text&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{PRIVACYMESSAGE}||privacy.pstpl||The privacy message is shown if you set your survey to be anonymous. [[Translating LimeSurvey|The text can be edited/translated]] in the language files. This can also be changed manually by editing the privacy.pstpl template you wish to use.&lt;br /&gt;
|-&lt;br /&gt;
|{TEMPLATEURL}||All Files||The URL to the current template location (useful for referencing image files in your template)&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYRESOURCESURL}||All Files||The URL to the current uploaded files for this survey location (useful for referencing image files in your question, group, ....)&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITCOMPLETE}||endpage.pstpl||The statement (from the language files) that tells the user they have completed the survey, and to press the &amp;quot;Submit&amp;quot; button&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITREVIEW}||survey.pstpl||The statement (from the language files) that tells the user they can review/change the answers they have made by clicking &amp;quot;&amp;lt;&amp;lt; prev&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{SAVEDID}||All Files||Displays &#039;Response ID&#039; of user&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|{QUEXMLPDF}||All Files||Displays button to export the queXML PDF of questionnaire including answers entered up until the point that has been completed in the survey.&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:FIRSTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users first name from the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:LASTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users last name from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:EMAIL}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users email from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_1}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_1 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_2}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_2 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWERSCLEARED}||Preferably in navigator.pstpl||The &amp;quot;Answers Cleared&amp;quot; statement from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{RESTART}||clearall.pstpl||URL to restart the survey&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERERROR}||register.pstpl||Shows any error messages in the register page (ie: &amp;quot;You must include an email address&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE1}||register.pstpl||The statement &amp;quot;You must be registered to complete this survey&amp;quot; from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE2}||register.pstpl||Details about registering from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERFORM}||register.pstpl||The actual form for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{SAVE}||Works suitable on navigator.pstpl||Displays the &#039;Save your responses so far&#039; button to offer the user to save and come back later to continue the survey. If the Save option is deactivated in the survey properties the tag will not be shown and ignored.&lt;br /&gt;
|-&lt;br /&gt;
|{LANGUAGECHANGER}||survey.pstpl||Displays a switch in multilingual surveys to change the question.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Input/Buttons== &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
Each &amp;quot;input&amp;quot; type in a survey has been given its own class name, so that you can add CSS to your &amp;quot;startpage.pstpl&amp;quot; file and have some control over the appearance of form buttons and inputs. These class names are as follows:&lt;br /&gt;
*&#039;&#039;&#039;submit&#039;&#039;&#039; (Submit Buttons)&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; (Text Inputs - for short free text, date, and numerical type)&lt;br /&gt;
*&#039;&#039;&#039;answertext&#039;&#039;&#039; (Text of answers)&lt;br /&gt;
*&#039;&#039;&#039;radio&#039;&#039;&#039; (Radio Buttons)&lt;br /&gt;
*&#039;&#039;&#039;checkbox&#039;&#039;&#039; (Check Boxes)&lt;br /&gt;
*&#039;&#039;&#039;select&#039;&#039;&#039; (Select / List Boxes)&lt;br /&gt;
*&#039;&#039;&#039;textarea&#039;&#039;&#039; (Large text inputs - for long free text)&lt;br /&gt;
*&#039;&#039;&#039;clearall&#039;&#039;&#039; (The &amp;quot;Exit and Clear Survey&amp;quot; link)&lt;br /&gt;
*&#039;&#039;&#039;rank&#039;&#039;&#039; (The rank style question. Doesn&#039;t set the colour of the select box or the text boxes, but it does allow the changing of background colour, text colour, size etc., for the rest of the ranking question)&lt;br /&gt;
*&#039;&#039;&#039;graph&#039;&#039;&#039; (The &amp;quot;percentage completed&amp;quot; graph table)&lt;br /&gt;
*&#039;&#039;&#039;innergraph&#039;&#039;&#039; (The table inside the graph table - this contains the 0% and 100% text. Use this for changing the size of this text)&lt;br /&gt;
*&#039;&#039;&#039;question&#039;&#039;&#039; (General settings for any question that is displayed within a table. Generally, you should use this to make sure that their font size and color is the same as you have used elsewhere as a default)&lt;br /&gt;
*&#039;&#039;&#039;mandatory&#039;&#039;&#039;  (Mandatory questions)&lt;br /&gt;
*&#039;&#039;&#039;input-error&#039;&#039;&#039; (User input error - for if a user has made a mistake with a mandatory question or question with validation)&lt;br /&gt;
*&#039;&#039;&#039;array1&#039;&#039;&#039; and &#039;&#039;&#039;array2&#039;&#039;&#039; (These two styles are cycled when presenting the range of answers for an array type question. This allows you to set an alternating background color for these question types. &#039;&#039;&#039;Array1&#039;&#039;&#039; is also used for the column headings in these question types)&lt;br /&gt;
*&#039;&#039;&#039;errormandatory&#039;&#039;&#039; (Sets the color and style of the &amp;quot;This question is mandatory&amp;quot; error message)&lt;br /&gt;
*&#039;&#039;&#039;warningjs&#039;&#039;&#039; (Sets the color and style of the warning message displayed if the participant&#039;s browser has javascript disabled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
There are also some elements that can be accessed using the ID of the element (&#039;&#039;&#039;#ID&#039;&#039;&#039; in CSS):&lt;br /&gt;
*&#039;&#039;&#039;surveycontact&#039;&#039;&#039; (The contact message shown on the start page)&lt;br /&gt;
*&#039;&#039;&#039;tokenmessage&#039;&#039;&#039; (used for messages inside the survey, e.g. the session expired error message)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
Because you can edit all the HTML aspects, there&#039;s no reason to surround your templates with a &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&#039;new_name&#039;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and then define a css for that new_name class.&lt;br /&gt;
&lt;br /&gt;
==Styling the progress bar== &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
The progress bar appearance can be modified with CSS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
To change the background color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-header {&lt;br /&gt;
 background-color: #3300FF;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
To change the border color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-content,&lt;br /&gt;
#progress-wrapper .ui-widget-header {&lt;br /&gt;
 border: 1px solid #FF0000;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Features Available to Developers== &amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
LimeSurvey has integrated some user-made patches that permits some special changes. These very advanced features (generally) require changes to the underlying code base of LimeSurvey and should be done carefully in order not to introduce security holes.&lt;br /&gt;
&lt;br /&gt;
===Support for your own Javascript functions=== &amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Some users may need to run Javascript on the survey pages, but calling &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; in the BODY element made it impossible to do so. This call has been replaced with a small JavaScript function in the HEAD that sniffs for the existence of &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; and &#039;&#039;&#039;template_onload()&#039;&#039;&#039; before calling them. In this way, a template author can create his or her own &#039;&#039;&#039;template_onload()&#039;&#039;&#039; function in the HEAD that replaces the default one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
*Disable XSS filter - in Global settings -&amp;gt; Security, set &amp;quot;Filter HTML for XSS&amp;quot; to No.&lt;br /&gt;
*Enter your script in the source of a question or group description.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:301--&amp;gt;&lt;br /&gt;
{{Note|For further details, see the [[Workarounds: Manipulating a survey at runtime using Javascript#How to use Script (eg. JavaScript etc.) in LimeSurvey|workaround section]].}}&lt;br /&gt;
&lt;br /&gt;
=Videos on Templates= &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
This video will demonstrate the basic and advanced template functions that are available to all LimeSurvey users. This includes changing the appearance of certain forms and inserting custom graphics. Additionally, it will thoroughly walk you through on how to edit and preview specific page templates, importing/exporting templates, modify appearance of questions in the CSS, and customizing survey description page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:302--&amp;gt;&lt;br /&gt;
Video - needed&lt;br /&gt;
&lt;br /&gt;
=Tips &amp;amp; Tricks= &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some language specific element== &amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
If you want to have some language specific sentence in a survey, for example a help at the end of each page, you can add in a .pstl file a sentence and hidding it for other language. If we hide it in the template.css, we can use the pseudo selector :lang, but we use some class for better compatibility.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
Below, there are two help sentences, in French and English. Put this on endpage.pstpl:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;fr&amp;quot; lang=&amp;quot;fr&amp;quot;&amp;gt;Pour de l&#039;aide en direct appelez le 000000&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;For some help, please call 000000&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
and in template.css:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:152--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.lang-fr .en{display:none}&lt;br /&gt;
.lang-en .fr{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change the layout of the survey page== &amp;lt;!--T:155--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:156--&amp;gt;&lt;br /&gt;
After editing and saving a template, it applies to a survey list page only if it is selected from the settings of the survey. To make it the default template, go under the &#039;&#039;&#039;General tab&#039;&#039;&#039; located in the &#039;&#039;&#039;Global settings&#039;&#039;&#039; of your LimeSurvey installation and choose the desired template. From now on, all the templates that use the &amp;quot;default&amp;quot; option as template plus the ones that are going to be newly created, will use the newly selected default template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
To use your current template for this page, you have to change the according setting from &#039;&#039;&#039;Global settings&#039;&#039;&#039;. In older versions, this change can be done by editing the $defaulttemplate setting from the config file: copy this setting from config-defaults.php to config.php which overrides config-defaults.php and edit this setting to &amp;lt;code lang=&amp;quot;html&amp;quot;&amp;gt;$defaulttemplate = &#039;yourtemplatename&#039;;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Import/Export of templates: Mac users== &amp;lt;!--T:158--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;Mac users&amp;lt;/u&amp;gt;, please note that the Mac OSX default archive utility may have problems with zip folders &amp;quot;generated on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:160--&amp;gt;&lt;br /&gt;
A workaround is to unix&#039;es unzip from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
$ unzip template.zip -d template&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:162--&amp;gt;&lt;br /&gt;
Archive: template.zip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
 inflating: template/startpage&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:164--&amp;gt;&lt;br /&gt;
 inflating: ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
Another workaround is to use scripts in their mac-compiled counterparts.&lt;br /&gt;
&lt;br /&gt;
==Replacing the help icon {{ObsoleteIn|2.50}} == &amp;lt;!--T:173--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:174--&amp;gt;&lt;br /&gt;
When a question help text is shown, then an help.gif image is used from the default template folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
You can replace this image by uploading a new help.gif, help.png or help.jpg in your custom template folder. It will then be automatically used instead of the default help icon.&lt;br /&gt;
&lt;br /&gt;
==Replacing an existing logo {{NewIn|2.50}} {{ObsoleteIn|3.0}}== &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:177--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In the &#039;&#039;&#039;default&#039;&#039; Template of 2.50, there is no preembedded logo. Read further our [[#Adding_your_own_logo |wiki on how to add your own logo]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
1. To edit the logo go to the &#039;&#039;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&#039;&#039; file which you can find it here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:179--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t1.PNG|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
2. Click the search button to find occurrences of logo related styles and search for &#039;&#039;logo&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:181--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:2.png|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
4. Edit the main style file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:185--&amp;gt;&lt;br /&gt;
You will see something similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t4.PNG|500px]]&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:187--&amp;gt;&lt;br /&gt;
If you want to change the image, just replace logo.gif with another image link. Example: (&amp;lt;u&amp;gt;logo.png&amp;lt;/u&amp;gt; or &amp;lt;u&amp;gt;logo.jpg&amp;lt;/u&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:188--&amp;gt;&lt;br /&gt;
If you want to change the image size, adjust width and height (in pixels) like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;width:100px; height:100px;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo {{ObsoleteIn|3.0}} == &amp;lt;!--T:190--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
1. Find and open the &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; template file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:192--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:startpage.pstpl.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
2. After this&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; &amp;gt;&amp;lt;div id=&amp;quot;topContainer&amp;quot; class=&amp;quot;jumbotron&amp;quot;&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
add this line to &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;img id=&#039;page_logo&#039; src=&#039;{TEMPLATEURL}/files/logo.png&#039; class=&amp;quot;clearfix pull-right&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
3. To upload your own logo, go to the template editor and upload your logo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:197--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:uploadyourlogo.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:199--&amp;gt;&lt;br /&gt;
To position your logo, please use one of the following css classes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:293--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the left side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:200--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-left&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:204--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the right side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:205--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-right&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:208--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want to center the logo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:209--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix center-block&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the same template with different logos== &amp;lt;!--T:214--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:215--&amp;gt;&lt;br /&gt;
If you want to use the same template for all surveys and just want to change the logo for each survey, you can use the {SID} placeholder in the template .pstpl file and thereby refer to different images:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:216--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;{TEMPLATEURL}files/logoImage-{SID}.png&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the default help to all question (hide_tip) {{ObsoleteIn|1.92}}== &amp;lt;!--T:217--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:218--&amp;gt;&lt;br /&gt;
There are 3 solutions to remove the default help:&lt;br /&gt;
# like a hide_tip attribute but for all question and survey.&lt;br /&gt;
# you can remove the {QUESTIONHELP} and its container from the file question.pstl. However, it can be a bad idea for the screenreader.&lt;br /&gt;
# for the default template and some other, add this at the end of tempate.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:219--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;span.questionhelp{display:none;}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display custom favicon== &amp;lt;!--T:220--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:221--&amp;gt;&lt;br /&gt;
A favicon is the little icon you see in the browser&#039;s address bar, list of bookmarks or tab. You can display your own icon as follows:&lt;br /&gt;
#Create a favicon - google will find you lots of free favicon generators.&lt;br /&gt;
#Name your new favicon &amp;quot;favicon.ico&amp;quot; and place it in your template /files directory.&lt;br /&gt;
#Add the following code to your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; before the &amp;lt;/head&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:222--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Different appearance for survey-/question-pages== &amp;lt;!--T:224--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:226--&amp;gt;&lt;br /&gt;
If you want LimeSurvey to change the appearance of every second page (i.e. of even and odd survey pages), you can use &#039;&#039;&#039;.page-odd&#039;&#039;&#039; class in your CSS file to change the appearance of odd pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:227--&amp;gt;&lt;br /&gt;
An example from default template of LimeSurvey 1.91+:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:228--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.page-odd table.question-group {&lt;br /&gt;
 background-color: #D2F2D3;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:232--&amp;gt;&lt;br /&gt;
If you do &#039;&#039;&#039;not&#039;&#039;&#039; want differentiate even and odd pages, find all instances of &#039;&#039;.page-odd&#039;&#039; in template.css and remove those styles.&lt;br /&gt;
&lt;br /&gt;
==Create a vertical separator  border for dual scale array== &amp;lt;!--T:233--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:234--&amp;gt;&lt;br /&gt;
To create a vertical separator border for a dual scale array, you can add the following lines to your &#039;&#039;&#039;template.css&#039;&#039;&#039;-file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:235--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
table.question thead td.header_separator,&lt;br /&gt;
table.question tbody td.dual_scale_separator&lt;br /&gt;
{&lt;br /&gt;
   border-right:solid 1px #00A8E1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:242--&amp;gt;&lt;br /&gt;
&#039;&#039;header_separator&#039;&#039; is used to adress the separator for the header &amp;quot;td&amp;quot;. The &amp;quot;dual_scale_separator&amp;quot; is used to address the separator column in the dual scale array.&lt;br /&gt;
&lt;br /&gt;
==Hide the survey contact message shown on the start page/survey list {{ObsoleteIn|3.0}} == &amp;lt;!--T:243--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:244--&amp;gt;&lt;br /&gt;
To hide the &amp;quot;Please contact ...&amp;quot; message on the start page (with the survey list), you can add the following to the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.js&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:245--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:246--&amp;gt;&lt;br /&gt;
$(&#039;#surveycontact&#039;).hide(); //Hides the survey contact message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:247--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the survey contact message shown on error messages {{ObsoleteIn|3.0}}== &amp;lt;!--T:248--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:249--&amp;gt;&lt;br /&gt;
If you want to remove the survey contact message from error messages, it&#039;ll be trickier. You can add the function from below. It calls the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.css&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:250--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
removeContactAdressFromMessage(); //Removes the survey contact message from error messages&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:253--&amp;gt;&lt;br /&gt;
and add the following function to your *template.js* file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:254--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
function removeContactAdressFromMessage()&lt;br /&gt;
{&lt;br /&gt;
if ($(&#039;#tokenmessage&#039;).length &amp;gt; 0)&lt;br /&gt;
   {&lt;br /&gt;
   var oldMessage = $(&#039;#tokenmessage&#039;).html();&lt;br /&gt;
   var indexContact = oldMessage.indexOf(&#039;Bitte kontaktieren&#039;);&lt;br /&gt;
   var newMessage = oldMessage.substr(0, indexContact);&lt;br /&gt;
   $(&#039;#tokenmessage&#039;).html(newMessage);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:266--&amp;gt;&lt;br /&gt;
It will probably not work for a survey in English language and has to be extended when used for multilingual surveys. But it&#039;s an idea/tip on how to solve this.&lt;br /&gt;
&lt;br /&gt;
==How to deal with multilingual question attributes {{ObsoleteIn|2.50}}== &amp;lt;!--T:267--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:268--&amp;gt;&lt;br /&gt;
If you have a multilingual survey and e. g. want to use a different string for the &amp;quot;other&amp;quot; field, this could only be done for the base language (until this feature was added at LimeSurvey 2.0). To work around this, paste in the field to change the label for &amp;quot;other&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:269--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;en&amp;quot;&amp;gt;New label&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;fr&amp;quot;&amp;gt;Nouveau label&amp;lt;/span&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:270--&amp;gt;&lt;br /&gt;
Add in the template.css of your template (at &#039;&#039;/limesurvey/upload/templates/&amp;lt;yourtemplatename&amp;gt;/template.css&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:271--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;html:lang(en) .fr{display:none}&lt;br /&gt;
html:lang(fr) .en{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo to the survey list {{ NewIn|3.0}} == &amp;lt;!--T:310--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:311--&amp;gt;&lt;br /&gt;
# First please open the theme editor for the theme you like to use. [[File:OpenThemeEditor.jpg]]&lt;br /&gt;
# We recommend to use fruity, it is our best theme currently. &lt;br /&gt;
# Then extend the theme and give it a name you will recognize. [[File:ExtendTheme.jpg]]&lt;br /&gt;
# In the following view you may upload the logo you want to use. [[File:UploadFileTheme.jpg]]&lt;br /&gt;
# Select the editor screen `Survey List´ in the Screen dropdown in the top right corner. [[File:OpenScreenSurveyList.jpg]]&lt;br /&gt;
# Then select `layout_survey_list.twig´ in the left side menu. [[File:EditLayoutSurveyListTwig.jpg]]&lt;br /&gt;
# In the editor scroll to line 126 and change the marked part to the filename of the image you uploaded to the theme before. [[File:ChangeSurveyListHeaderImageEditor.jpg]]&lt;br /&gt;
# Save your file. [[File:ThemeEditorSaveChanges.jpg]]&lt;br /&gt;
# Change default theme to your extended theme. [[File:ChangeDefaultTheme.jpg]]&lt;br /&gt;
&lt;br /&gt;
=Custom Question Views {{NewIn|3.0}}= &amp;lt;!--T:289--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:290--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; This is a temporary feature to be replaced in the future by question object (it will be very easy to move custom views to question object). It is disabled by default.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:291--&amp;gt;&lt;br /&gt;
As of version 2.5, you can create template-specific custom views for questions and some of their incorporated elements. This is useful if you want to modify the HTML layout of a particular question type for one or more surveys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:292--&amp;gt;&lt;br /&gt;
*In application/config/config.php, find &#039;config&#039;=&amp;gt;array and add this line to the array : &#039;allow_templates_to_overwrite_views&#039;=&amp;gt;1&lt;br /&gt;
*In /{your_template}/config.xml, set &amp;quot;overwrite_question_views&amp;quot; to true&lt;br /&gt;
*Copy application/views/survey/* to template/{your_view_directory}/survey/&lt;br /&gt;
*Note that you only need to copy the files that you intend to modify but the file structure must remain the same as in application/views/survey/&lt;br /&gt;
&lt;br /&gt;
=Insert Custom CSS or JavaScript files for template {{NewIn|2.50}}= &amp;lt;!--T:296--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:303--&amp;gt;&lt;br /&gt;
As of version 2.50, you can use the config.xml file to automatically load plugin files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:304--&amp;gt;&lt;br /&gt;
*Upload your files to the template /css or /scripts folder&lt;br /&gt;
*In /{your_template}/config.xml, add the file paths to the &amp;lt;css&amp;gt; or &amp;lt;js&amp;gt; blocks, something like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;css&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/jquery-ui-custom.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/bootstrap-slider.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:305--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/flat_and_modern.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:306--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/template.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:307--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/myCustomPlugin.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;js&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/template.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/bootstrap-slider.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:308--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;scripts/myCustomPlugin.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/js&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95874</id>
		<title>Theme editor</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95874"/>
		<updated>2018-04-04T10:33:13Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt; &amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
LimeSurvey has an advanced theme and style system providing to developers an efficient way to customize the survey appearance. Since LS3, we&#039;re not speaking anymore about &#039;&#039;&#039;&amp;quot;templates&amp;quot;&#039;&#039;&#039; like in previous versions, but about &#039;&#039;&#039;&amp;quot;themes&amp;quot;&#039;&#039;&#039;. The &#039;&#039;&#039;themes&#039;&#039;&#039; allow control over the look and feel of pages during a survey. A survey administrator can select a default theme that will be used for each survey to further personalize it and improve its look and feel. &#039;&#039;&#039;Themes&#039;&#039;&#039;  come with options that provide to admin without coding skill a simple way to add a logo on the welcome page, to change the background colors, to select a font, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
LimeSurvey comes with 3 themes right out of the box. These initial themes are defined by directories located in the LimeSurvey installation &amp;quot;themes/survey/&amp;quot; directory. Each theme has it&#039;s own directory. Within the main directory of a theme you&#039;ll find a configuration file in XML, and numerous directories containing the views &#039;&#039;themes (.twig)&#039;&#039;&#039;, &#039;&#039;&#039;cascading style sheets (.css)&#039;&#039;&#039;, &#039;&#039;&#039;scripts&#039;&#039;&#039;,  &#039;&#039;&#039;images&#039;&#039;&#039; (&#039;&#039;&#039;.jpg&#039;&#039;&#039; or &#039;&#039;&#039;.png&#039;&#039;&#039;), and maybe others. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Since LimeSurvey 2.50, the theme engine use [http://getbootstrap.com/docs/3.3/ Bootstrap 3]  as CSS framework. Bootstrap 3 being a standard framework, developers will find a lot of documentation, tutorials and forum threads about it on Internet. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since LimeSurvey 3, the theme engine use [https://twig.symfony.com Twig], so the theme developers can change the logic of the survey rendering in a safe and easy way. Twig replace the old system of replacement keywords that was used in the previous versions. The logic that was used to generate the HTML of the keywords are now available inside the theme&#039;s views. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Snippet from Vanilla Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;twig&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.answercontainer }} col-xs-12&amp;quot; {{ aSurveyInfo.attr.answercontainer }}&amp;gt;&lt;br /&gt;
    {# NOTE: If you want to customize the question rendering, use a question theme #}&lt;br /&gt;
    {{ aQuestion.answer | raw }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Themes, being HTML and Twig code, tend to define the positioning and type of text to be displayed and similar structural features of the page. They often reference or include other files. Most of them reference a common cascading style sheets (CSS) file that defines the font style, color, size, background, and similar parameters common to all pages in the survey. Style sheets reference HTML &#039;&#039;&#039;class&#039;&#039;&#039; parameters that are associated with the various types of objects in the HTML code. This allows the style sheet to describe how to display each of the many types of text or other objects that may appear in multiple places. There are unique classes for each question type in LimeSurvey and thus giving detailed control over the appearance of each. Image files, like logos or special progress-bar constructors, may be referenced as well in the Theme file. Finally, special keywords in curly braces are replaced with text defined in the survey for each language translation correspondent (for example, the &#039;Survey Title&#039; or &#039;Question Text&#039; for each language defined).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
If you create a new custom theme, please consider contributing it back to the LimeSurvey community and make it available to others. With your help, we can grow our repository of themes, surveys, and other add-ons to make LimeSurvey even better! &lt;br /&gt;
See our [https://www.limesurvey.org/index.php?option=com_sobipro&amp;amp;sid=55:Templates&amp;amp;Itemid=729 LimeSurvey template repository] where you can share your templates.&lt;br /&gt;
&lt;br /&gt;
=Creating a new theme= &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To be able to create a new theme (or edit an existing theme), you need [[Manage users#Set global permissions for a user|Template Editing user permission]] in LimeSurvey as well as permission to manipulate the files in the underlying operating system hosting your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;Note of Warning:&#039;&#039;&#039;&amp;lt;/span&amp;gt; If you change themes, you could also affect all the pre-existing surveys from your LimeSurvey installation. Themes are an advanced feature that require experience and HTML knowledge in order to make them running smoothly.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
The preferred way to create a new theme is through the &#039;&#039;&#039;Theme Editor&#039;&#039;&#039; (see below), which is located in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; dialog. Some people may like to work directly with theme files so that they can use their favorite text editor instead of the web interface. In this case, still use the Theme Editor to first create your new theme. This will create a new base theme with all the files you need in the &#039;&#039;LimeSurvey_web_root/upload/themes/survey/your_new_template&#039;&#039; directory. From there you can use your text editor to manually adjust the template files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; on unix/linux systems, these theme files will be owned by the group and user where the web server is running (may be &amp;quot;www&amp;quot; for some systems). So, make sure you have enough access to edit these files, When you save them, make sure they don&#039;t change ownership! In this way, you can still use the web Theme Editing interface if needed.&amp;lt;/div&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A number of &#039;public&#039; elements of LimeSurvey can be adjusted by a series of themes. The next section provides a very brief explanation of these templates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
{{Note|Themes files may seem complex. Besides HTML, you might also need to understand CSS, Twig, and JavaScript.}}&lt;br /&gt;
&lt;br /&gt;
=The LimeSurvey template editor= &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
To ease the understanding and quick update of a Template, LimeSurvey provides a &#039;&#039;&#039;Template Editor&#039;&#039;&#039; in the main &#039;&#039;&#039;administrative&#039;&#039;&#039; toolbar of the application. This Template Editor is only available to users [[Manage users#Set global permissions for a user|with the Templates permission]] and to superadministrators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:297--&amp;gt;&lt;br /&gt;
{{Alert|title=Attention|text=A template that is not correctly constructed can render a survey (that uses the respective template) inoperable. }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
The LimeSurvey template editor allows you to edit the contents of your templates online. Start the Template Editor by clicking on &#039;&#039;&#039;Template editor&#039;&#039;&#039; in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; menu. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:285--&amp;gt;&lt;br /&gt;
[[File:templates.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:286--&amp;gt;&lt;br /&gt;
The template editor page allows you to select the template you would like to edit/view. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:279--&amp;gt;&lt;br /&gt;
[[File:Template-editor-2013-7-10_11_38_16.png|center]]&lt;br /&gt;
&lt;br /&gt;
==The template menu== &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:298--&amp;gt;&lt;br /&gt;
The following options are available:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:280--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Create&#039;&#039;&#039;: Allows you to create a new template. In order not to start from scratch, the template &#039;default&#039; is copied.&lt;br /&gt;
*&#039;&#039;&#039;Import&#039;&#039;&#039;: Allows you to import a template from a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Export&#039;&#039;&#039;: Allows you to export the current template to a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Copy&#039;&#039;&#039;: Allows you to make a new template by copying the current one.&lt;br /&gt;
*&#039;&#039;&#039;Rename&#039;&#039;&#039;: Allows you to change the name of the template. It is generally used after copying or importing a template.&lt;br /&gt;
*&#039;&#039;&#039;Template&#039;&#039;&#039;: It is a drop-down list that shows all the available templates that are located in your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Screen&#039;&#039;&#039;: It is a drop-down list which allows you to choose which particular survey page of that template you want to look at.&lt;br /&gt;
*&#039;&#039;&#039;Return to admin panel&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Import/export/copy a template== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
When you &#039;&#039;&#039;export &#039;&#039;&#039;a template, a ZIP-file archive with all the files your template consists of will be created (.pstpl files, images, css files, ...). You can simply &#039;&#039;&#039;import&#039;&#039;&#039; the exported zip-file into another LimeSurvey installation by using the import feature or you can manually copy the archive into another LimeSurvey installation and extract it into the corresponding [[Theme editor#Template files location|template directory there]]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:288--&amp;gt;&lt;br /&gt;
However, it is preferred to use the LimeSurvey template import/export/copy functions in the template editor.&lt;br /&gt;
&lt;br /&gt;
==Page Structure / Template Use== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;The Welcome Page:&#039;&#039;&#039; startpage.pstpl, welcome.pstpl, privacy.pstpl,  navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Questions Pages:&#039;&#039;&#039; startpage.pstpl, survey.pstpl, startgroup.pstpl, groupdescription.pstpl, question.pstpl, endgroup.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Final Page:&#039;&#039;&#039; startpage.pstpl, assessment.pstpl, completed.pstpl, endpage.pstpl&lt;br /&gt;
&lt;br /&gt;
==Template Files== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The following template files are used to produce your public survey and must exist in any new template folder you create:&lt;br /&gt;
*&#039;&#039;&#039;startpage.pstpl:&#039;&#039;&#039; Produces the start of each html page. It starts at the &amp;quot;&amp;lt;head&amp;gt;&amp;quot; tag, and should not contain the &amp;quot;&amp;lt;html&amp;gt;&amp;quot; tag. This &#039;very beginning&#039; of a standard html page is written by the scripts. Please ensure that your startpage.pstpl files contains a &amp;lt;body&amp;gt; tag. Even though many browsers do not require strict adherence to the W3 HTML standards, the LimeSurvey script needs to find a &amp;lt;body&amp;gt; tag to run certain javascript elements. It is not expected to see many &#039;keywords&#039; used in the startpage.pstpl file. However, you may wish to put the {SURVEYNAME} into the title. The startpage.pstpl file can contain code that ends in the corresponding endpage.pstpl file. For example, you can start a table in this file and close the table in the endpage.pstpl file. The startpage.pstpl and endpage.pstpl files wrap around every possible page used by LimeSurvey.&lt;br /&gt;
*&#039;&#039;&#039;survey.pstpl:&#039;&#039;&#039; This template is the second used on most pages and provides a space to put the survey name and description. This template does not have a corresponding &#039;closing&#039; template, and subsequently you should close all tags opened in this template file (i.e.: don&#039;t leave a table open here because there is nowhere else to close it).&lt;br /&gt;
*&#039;&#039;&#039;welcome.pstpl:&#039;&#039;&#039; This template is only used in the welcome screen (which is also on the main page for &#039;all in one&#039; surveys). You can use this to print out the welcome text, and other information that should be provided in the introduction. Like the &#039;survey.pstpl&#039; file, there is no corresponding &#039;closing&#039; template, so all tags opened in this template file should be closed as well.&lt;br /&gt;
*&#039;&#039;&#039;startgroup.pstpl:&#039;&#039;&#039; This template can provide a &#039;summary&#039; wrap around for questions within a group. It has a matching &#039;endgroup.pstpl&#039; template that can be used to close any opened tags in this file, so you can open a table within this.&lt;br /&gt;
*&#039;&#039;&#039;groupdescription.pstpl:&#039;&#039;&#039; This template file is used to display a description of a group. Please note that in the survey settings (access the &#039;&#039;Presentation &amp;amp; navigation settings&#039;&#039; by clicking on the &#039;&#039;&#039;Presentation&#039;&#039;&#039; tab) you can set if the group description should be shown or not. If not, then this file is not included at all.&lt;br /&gt;
*&#039;&#039;&#039;question.pstpl:&#039;&#039;&#039; This file contains the question, answer, and help text sections of your survey. In the &amp;quot;group by group&amp;quot; and &amp;quot;all in one&amp;quot; surveys, this template is cycled repeatedly with each question. There is no corresponding closing file for this and all tags should be closed.&lt;br /&gt;
*&#039;&#039;&#039;question_start.pstpl:&#039;&#039;&#039; This file contains the individual elements found at the start of a question. It is included within &#039;question.pstpl&#039; via the {QUESTION} keyword. It is intended to allow template designers more control over the layout of a question. This template sits outside the normal templating system and &#039;&#039;&#039;was superseeded (as of LimeSurvey 1.87)&#039;&#039;&#039;. All keywords from this template are now available directly in question.pstpl. &lt;br /&gt;
*&#039;&#039;&#039;completed.pstpl:&#039;&#039;&#039; This page is displayed as the final page when the survey responses have been saved and the survey is over. It can be used to display a &amp;quot;forwarding link&amp;quot; as set in the survey setup.&lt;br /&gt;
*&#039;&#039;&#039;endgroup.pstpl:&#039;&#039;&#039; This file closes the group, and can be used to close off any tags opened in the startgroup.pstpl file&lt;br /&gt;
*&#039;&#039;&#039;navigator.pstpl:&#039;&#039;&#039; This file contains the buttons that navigate through the survey, &amp;quot;next&amp;quot;, &amp;quot;prev&amp;quot;, &amp;quot;last&amp;quot;, &amp;quot;submit&amp;quot;, &amp;quot;save so far&amp;quot;  and the &amp;quot;clear all&amp;quot; link. It is used in all pages except the completed page.&lt;br /&gt;
*&#039;&#039;&#039;printanswers.pstpl:&#039;&#039;&#039; This file has the HTML wrapper necessary for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_group.pstpl:&#039;&#039;&#039; This file is the same as startgroup.pstpl and endgroup.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_question.pstpl:&#039;&#039;&#039; This file is the same as question.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_survey.pstpl:&#039;&#039;&#039; This file is the same as survey.pstpl, but for the print version of the survey.&lt;br /&gt;
&lt;br /&gt;
== CSS and Javascript== &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
Two files that are always used in a template are template.css (for CSS) and template.js (for Javascript).&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATECSS}:&#039;&#039;&#039; Add lines for default css, template.css, and template-rtl.css for rtl language.&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATEJS}:&#039;&#039;&#039; Add lines for default javascript files, template.js, and all js files needed for LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
=== Using Bootstrap=== &amp;lt;!--T:294--&amp;gt;&lt;br /&gt;
LimeSurvey has Bootstrap 3 embedded, so you can style all your templates with the well documented Bootstrap classes.&lt;br /&gt;
For more information please refer to the [https://getbootstrap.com Bootstrap documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:295--&amp;gt;&lt;br /&gt;
The [https://github.com/flatlogic/awesome-bootstrap-checkbox Awesome-Bootstrap-Checkbox] plugin is also included. With it, you can use the typical Bootstrap color-classes (info,warning,danger,etc.) also with the suffix &amp;quot;-checkbox&amp;quot; or &amp;quot;-radio&amp;quot;, though styling checkboxes and radios as you prefer.&lt;br /&gt;
&lt;br /&gt;
=== Replacing default CSS or Javascript=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Some questions use specific files for Javascript or CSS. If you need to replace a function, use a cascading system. For javascript function, the last function read is the function used.&lt;br /&gt;
&lt;br /&gt;
==Other Template Files== &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The &#039;&#039;&#039;privacy.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;invitationemail.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;reminderemail.pstpl&#039;&#039;&#039;, and &#039;&#039;&#039;confirmationemail.pstpl&#039;&#039;&#039; are no longer used by LimeSurvey and defaults are instead set in the applicable language files. The email messages can now be edited on a survey by survey basis.&lt;br /&gt;
&lt;br /&gt;
==Standard Pages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
There are ten standard pages that a survey participant may see in the course of taking or accessing the LimeSurvey application.  Each is constructed from a number of common &#039;&#039;&#039;Template&#039;&#039;&#039; files from the &#039;&#039;&#039;Template&#039;&#039;&#039; specified in the settings of the survey. The table below indicates which template files are used in constructing each of these pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!  &#039;&#039;&#039;Survey Pages/&#039;&#039;&#039;&amp;lt;br /&amp;gt;&#039;&#039;&#039;Template Files&#039;&#039;&#039;!!Survey&amp;lt;br /&amp;gt;List!!Welcome!!Question!!Completed!!Clear All!!Register!!Load!!Save!!Print&amp;lt;br /&amp;gt;Answers!!Print&amp;lt;br /&amp;gt;Survey&lt;br /&gt;
|-&lt;br /&gt;
|SurveyList||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Welcome|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Privacy|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Navigator|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Survey|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|StartGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|GroupDescription|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Question&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|EndGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Assessment|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Completed|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ClearAll|| || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Register|| || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Load|| || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||&lt;br /&gt;
|-&lt;br /&gt;
|Save|| || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| ||&lt;br /&gt;
|-&lt;br /&gt;
|PrintAnswers|| || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||&lt;br /&gt;
|-&lt;br /&gt;
|Print Survey || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Group || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Question || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|StartPage&amp;lt;br /&amp;gt;EndPage&amp;lt;br /&amp;gt;Template.css||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.90+, this replaces question.pstpl AND question_start.pstpl. If you are using an old custom template, you need to add the following line to the beginning of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div {QUESTION_ESSENTIALS} class=&amp;quot;{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;And then add the corresponding closing tag to the end of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.91 and earlier, LimeSurvey js files are not included in the template. In version 2, &#039;&#039;&#039;you have to use {TEMPLATEJS} in one of your template file&#039;&#039;&#039; to add the link to the js file. You can add it in startpage.pstpl or in endpage.pstpl. You can remove the {TEMPLATEURL}/template.js line and you have to replace with {TEMPLATEJS} to update a personal template.&lt;br /&gt;
&lt;br /&gt;
==The File Control Section== &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
In the &amp;quot;file control&amp;quot; window on the left, you can click on one of the template files that is used to compile the page. You can see the &#039;&#039;Screen part&#039;&#039;, JavaScript, and CSS files. The HTML code for that file will then appear in the &amp;quot;Now editing&amp;quot; window in the center. If the template is editable (determined by directory permissions) you can then make any changes and save them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:299--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:File Control Section.png|center]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The &amp;quot;Other files&amp;quot; window shows a list of all other files from the template directory. You can use the right side to &#039;&#039;&#039;upload and select image files (your pics, logos,...) or other files needed to create your template&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:300--&amp;gt;&lt;br /&gt;
Instead of using a link for each picture, utilize the field string {TEMPLATEURL}. So, instead of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;/limesurvey/templates/yourtemplate/files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
You can use {{NewIn|2.50}}:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:287--&amp;gt;&lt;br /&gt;
In LimeSurvey versions before 2.50 use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
A &amp;quot;sample&amp;quot; of the template page you are editing will be visible in the bottom of the screen. There is no way to delete a template from the template editor. This must be done by accessing the underlying directory and deleting manually the files from there. You also have the possibility to select different screen resolutions in order to better evaluate the feel and look of the template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The shipped templates cannot be edited using the template editor. If you want to modify them, create a copy first and edit the copy.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Template files location== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
LimeSurvey stores each of the &#039;standard&#039; templates in their own distinct sub-directory within the &#039;&#039;/templates&#039;&#039; directory that is kept in the public directory with the other LimeSurvey public files. Customized user templates are stored in the &#039;&#039;/upload/templates&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
There should &#039;&#039;&#039;ALWAYS&#039;&#039;&#039; be a &amp;quot;default&amp;quot; directory in the templates directory. This template is used by default and as a fall-back if a template folder doesn&#039;t exist, or can&#039;t be found. It comes installed by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
You can use any image files that you upload into the template management area with the help of this syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{TEMPLATEURL}filename.xyz&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Styling questions with CSS= &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
Styling of questions in CSS has become much easier. Each question type has now a unique class. The mandatory questions have an additional mandatory class. For example, for a non-mandatory question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
and if the question is mandatory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
and if the question is mandatory, but the user didn&#039;t answer it or if there is validation on a question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
and if the question has validation applied, but the user hasn&#039;t answered correctly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question6&amp;quot; class=&amp;quot;text-short input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Global classes for question part== &amp;lt;!--T:273--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:274--&amp;gt;&lt;br /&gt;
These classes are used for each question type. Some question types use only one or two classes, while others may use much more.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:281--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable alternance&amp;quot;&lt;br /&gt;
|+ Global classes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Class name&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Part&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Question type&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Examples&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Note&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question {{ObsoleteIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;p class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;question&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-answers {{NewIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;div class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;ls-answers&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .subquestions-list&lt;br /&gt;
| List of subquestion&lt;br /&gt;
| Multi choice question, array question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;subquestions-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;subquestions-list&amp;quot;&amp;gt;&lt;br /&gt;
| .questions-list is used too&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answers-list&lt;br /&gt;
| List of answers&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;answers-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;answers-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answer-item&lt;br /&gt;
| The answer part: one answer&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;answer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;answer-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .noanswer-item&lt;br /&gt;
| The answer part for no answer&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;noanswer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
| No answer is an answer too, then have double class noanswer-item and answer-item&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question-item&lt;br /&gt;
| The question part: one question&lt;br /&gt;
| Multi text question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;question-item&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;question-item&amp;quot;&amp;gt;&lt;br /&gt;
| Some answers are questions too. Then we have a lot of class=&amp;quot;question-item answer-item&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-list&lt;br /&gt;
| A list of checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;checkbox-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| Some question types use multi-list class, like checkbox with comment: class=&amp;quot;checkbox-list text-list&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of checkbox&lt;br /&gt;
| Array (numbers) with checkbox option&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-item&lt;br /&gt;
| The answer part with a checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;checkbox-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;checkbox-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-list&lt;br /&gt;
| A list of radio item&lt;br /&gt;
| Single choice question, array question type (each row)&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;radio-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;radio-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-array {{NewIn|3.0}}&lt;br /&gt;
| A array of radio item&lt;br /&gt;
| Array question type&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;radio-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-item&lt;br /&gt;
| The answer part with a radio&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;radio-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;radio-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-list&lt;br /&gt;
| A list of text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-item&lt;br /&gt;
| The answer part of a text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;text-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;text-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .numeric-list&lt;br /&gt;
| A list of text input with numeric only answer&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-list&lt;br /&gt;
| A list of text input with numeric only answer (each row)&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-array  {{NewIn|3.0}}&lt;br /&gt;
| The answer part of a numeric input&lt;br /&gt;
| Array of number&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;number-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-list  {{ObsoleteIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;select-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-list  {{NewIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select) (each row)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of dropdown&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-item  {{ObsoleteIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;select-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;select-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-item  {{NewIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;dropdown-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;dropdown-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .hide  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Used for accessibility: hidden with css but read by screenreader, since 2.50 : you can use sr-only from bootstrap&lt;br /&gt;
| Short text question&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;hide&amp;quot;&amp;gt;&lt;br /&gt;
| Can be used for other purposes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is activated&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it, but you can use it too in your template&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden-sr {{NewIn|3.0}}&lt;br /&gt;
| Used for accessibility: hide it if js is activated, but always show if user use a screenreader&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-js-hidden-sr&amp;quot;&amp;gt;&lt;br /&gt;
| Button&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-no-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is not activated&lt;br /&gt;
| Link&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it for inactive link if javascript is not activated&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-label-xs-visibility {{NewIn|3.0}}&lt;br /&gt;
|  Label to be hidden in big screen, but show with little screen (with no more table) and to screenreader&lt;br /&gt;
| label&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| Used for label inside table cell of array question type&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-input-group-extra {{NewIn|3.0}}&lt;br /&gt;
| Same usage of boostrap input-group-addon, but without the border and the background.&lt;br /&gt;
| right suffix&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-input-group-extra&amp;quot;&amp;gt;&lt;br /&gt;
| Used for right and left suffix (global)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=checkbox]&lt;br /&gt;
| Question with checkbox&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;checkbox&amp;quot; class=&amp;quot;checkbox&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=radio]&lt;br /&gt;
| Question with radio&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;radio&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text&lt;br /&gt;
| input[type=text]&lt;br /&gt;
| Question with input text, or textarea&lt;br /&gt;
| &amp;amp;lt;textarea class=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answertext&lt;br /&gt;
| Array question type&lt;br /&gt;
| Answer part of array question type&lt;br /&gt;
| &amp;amp;lt;th class=&amp;quot;answertext&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .col-answers&lt;br /&gt;
| Array question type&lt;br /&gt;
| Column of answers&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .odd .even {{ObsoleteIn|2.50}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for column&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .array1 .array2  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for line&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;array1&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-odd .ls-even  {{NewIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for sub-question and Y axis&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;ls-odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Some example of question part with classes=== &amp;lt;!--T:275--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:276--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Text-short question type:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;question answer-item text-item &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;label class=&amp;quot;hide label&amp;quot; for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Answer&amp;lt;/label&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;50&amp;quot; class=&amp;quot;text  empty&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:277--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Multiple short text&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;subquestions-list questions-list text-list&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li class=&amp;quot;question-item answer-item text-item&amp;quot; id=&amp;quot;javatbdSGQA&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;label for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Some example subquestion&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;span&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;20&amp;quot; class=&amp;quot;text empty&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:282--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Array question type&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;question subquestion-list questions-list &amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;caption class=&amp;quot;hide read&amp;quot;&amp;gt;Some explanation for accessibility.&amp;lt;/caption&amp;gt;&lt;br /&gt;
	&amp;lt;colgroup class=&amp;quot;col-responses&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;50%&amp;quot; class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;25%&amp;quot; class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;13.3%&amp;quot; class=&amp;quot;col-no-answer even&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;/colgroup&amp;gt;&lt;br /&gt;
	&amp;lt;thead&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array1 dontread&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;1&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;No answer&amp;lt;/th&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/thead&amp;gt;&lt;br /&gt;
	&amp;lt;tbody&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array2 answers-list radio-list&amp;quot; id=&amp;quot;javatbdSGQ&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;20%&amp;quot; class=&amp;quot;answertext&amp;quot;&amp;gt;Some example subquestion&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer_cell_001 answer-item radio-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;1&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer-item radio-item noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;No answer&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The full list of question classes== &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Question Type&#039;&#039;&#039;||&#039;&#039;&#039;Question Class&#039;&#039;&#039;||&#039;&#039;&#039;Question ID&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|5 point choice||.choice-5-pt-radio||5&lt;br /&gt;
|-&lt;br /&gt;
|Array (10 point choice)||.array-10-pt||B&lt;br /&gt;
|-&lt;br /&gt;
|Array (5 point choice)||.array-5-pt||A&lt;br /&gt;
|-&lt;br /&gt;
|Array (Flexible Labels) dual scale||.array-flexible-duel-scale ||1&lt;br /&gt;
|-&lt;br /&gt;
|Array (Increase, Same, Decrease)||.array-increase-same-decrease||E&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Numbers)||.array-multi-flexi ||:&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Text)||.array-multi-flexi-text||;&lt;br /&gt;
|-&lt;br /&gt;
|Array (Yes/No/Uncertain)||.array-yes-uncertain-no||C&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels)||.array-flexible-row ||F&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels) by column||.array-flexible-column||H&lt;br /&gt;
|-&lt;br /&gt;
|Boilerplate question||.boilerplate||X&lt;br /&gt;
|-&lt;br /&gt;
|Date||.date||D&lt;br /&gt;
|-&lt;br /&gt;
|Gender||.gender||G&lt;br /&gt;
|-&lt;br /&gt;
|Huge free text||.text-huge||U&lt;br /&gt;
|-&lt;br /&gt;
|Language switch||.language||I&lt;br /&gt;
|-&lt;br /&gt;
|List (dropdown)||.list-dropdown||!&lt;br /&gt;
|-&lt;br /&gt;
|List (radio)||.list-radio||L&lt;br /&gt;
|-&lt;br /&gt;
|List with comment||.list-with-comment||O&lt;br /&gt;
|-&lt;br /&gt;
|Long free text||.text-long||T&lt;br /&gt;
|-&lt;br /&gt;
|Multiple numerical input||.numeric-multi||K&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options||.multiple-opt||M&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options with comments||.multiple-opt-comments||P&lt;br /&gt;
|-&lt;br /&gt;
|Multiple short text||.multiple-short-txt||Q&lt;br /&gt;
|-&lt;br /&gt;
|Numerical input||.numeric||N&lt;br /&gt;
|-&lt;br /&gt;
|Ranking||.ranking||R&lt;br /&gt;
|-&lt;br /&gt;
|Short free text||.text-short||S&lt;br /&gt;
|-&lt;br /&gt;
|Yes/No||.yes-no||Y&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==The full list of validation classes== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Note:  Prior to 1.92, only .mandatory and .input-error classes were available.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
These apply to the help and/or validation tip messages so that each type can be individually styled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
The .hide-tip option and .input-error options interact by default so that you can have validation tips hidden. However, they do appear when there are validation errors and disappear again when those errors are rectified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
All of these are designed to eliminate the need for pop-up alert messages. Instead, tips can appear/disappear as needed and are color-coded to indicate whether the answers pass the validation criteria.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Furthermore, when you first visit a page that has unmet validation criteria, you can color-code the tips in a pleasing color to show which validation criteria have not been met yet; then re-display the page using a harsher color if the person submits the page with lingering validation errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Purpose&#039;&#039;&#039;||&#039;&#039;&#039;CSS Class&#039;&#039;&#039;||&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Mandatory||.mandatory||the question is mandatory&lt;br /&gt;
|-&lt;br /&gt;
|User input error||.input-error||the question had at least one validation error&lt;br /&gt;
|-&lt;br /&gt;
|Hide Tip||.hide-tip||added if you use the hide_tip option&lt;br /&gt;
|-&lt;br /&gt;
|Num answers||.em_num_answers||for for min_answers and max_answers&lt;br /&gt;
|-&lt;br /&gt;
|Value range||.em_value_range||for min/max_num_value_n and multiflexible_min/max&lt;br /&gt;
|-&lt;br /&gt;
|Sum range||.em_sum_range||for min/max/equals_num_value&lt;br /&gt;
|-&lt;br /&gt;
|Regex validation||.em_regex_validation||for regular-expression validation of the question&lt;br /&gt;
|-&lt;br /&gt;
|Question-level validation function||.em_q_fn_validation||for the em_validation_q option&lt;br /&gt;
|-&lt;br /&gt;
|Subquestion-level validation function||.em_sq_fn_validation||for the em_validation_sq option&lt;br /&gt;
|-&lt;br /&gt;
|Other comment mandatory||.em_other_comment_mandatory||for other_comment_mandatory option - shows when &amp;quot;other&amp;quot; is selected but associated comment is missing.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing styles into your custom template== &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
The custom question styles are near the bottom of each template&#039;s CSS file and start with:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;/* --------------------------- START: Question styles  ------------------------------ */&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
If you&#039;re styling your own custom template, you should be able to copy everything after the above one from &#039;&#039;templates/default/template.css&#039;&#039; (for table-based layouts) or &#039;&#039;/templates/limespired/template.css&#039;&#039; (for CSS-based layouts) into your own style sheet without any impact on your other styles.&lt;br /&gt;
&lt;br /&gt;
==Internet Explorer conditional style sheets== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
Because of the marked discrepancies in rendering between IE6 &amp;amp; IE7 and the other browsers, there are special IE conditional style sheets included for each template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_all-versions.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if lt IE 7]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_older-than-7.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8]&amp;gt;&lt;br /&gt;
		&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}ie_fix_8.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You should include the above code within your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; and copies of both the IE style sheets from either &#039;&#039;/templates/default/&#039;&#039; or &#039;&#039;/templates/limespired&#039;&#039; for Tables base layout and CSS based layout respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; If you copy the styles into your own style sheet you will almost certainly need to tweak them.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alternative solution for Internet explorer=== &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
You can put a conditional class for body in startpage.pstpl and use this class in your template.css. This method is used in the citronade template{{ObsoleteIn|2.06}}. Adding a js / no-js class to have javascript / no javascript system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;!--[if lt IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie6 ielt7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie8 ielt9  no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 9 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if gt IE 9]&amp;gt;&amp;lt;!--&amp;gt;&amp;lt;body id=&amp;quot;body&amp;quot; class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} no-js&amp;quot;&amp;gt;&amp;lt;!--&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;script type=&#039;text/javascript&#039;&amp;gt;/*&amp;lt;![CDATA[*/(function(H){ H.className=H.className.replace(/\bno-js\b/,&#039;js&#039;) })(document.getElementsByTagName(&#039;body&#039;)[0]);/*]]&amp;gt;*/&amp;lt;/script&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
And in template.css use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;.ie6{/*specific for internet explorer 6*/}&lt;br /&gt;
.ielt8{/*specific for internet explorer 6 and 7*/}&lt;br /&gt;
.ie{/*specific for all internet explorer */}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Right-to-Left (RTL) Languages and justify== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
The text editor within LimeSurvey is able to format RTL text. However, the editor itself shows the RTL language in a left to right format when justified. This is just an editor display issue. The RTL and justified question or text will display correctly from right to left, even when justified, in your survey or on preview.&lt;br /&gt;
&lt;br /&gt;
==Keywords== &amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:309--&amp;gt;&lt;br /&gt;
{{Deprecated|3.0}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
Keywords within a template file get replaced by the current survey information. They are surrounded by curly brackets, for example: {SURVEYNAME}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
The following strings will be replaced by LimeSurvey when parsing the template file and presenting it to survey users. These field strings will work on almost every template except for the &#039;Completed Page&#039;. (Most of these strings can be found in the common.php file. If it&#039;s not there, look in the index.php file.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!&#039;&#039;&#039;Keyword&#039;&#039;&#039;!!&#039;&#039;&#039;Template files&#039;&#039;&#039;!!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYNAME}||All Files||The survey title&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYDESCRIPTION}||All Files||The survey description&lt;br /&gt;
|-&lt;br /&gt;
|{WELCOME}||All files (mainly for welcome.pstpl)||The survey &#039;welcome&#039; text&lt;br /&gt;
|-&lt;br /&gt;
|{PERCENTCOMPLETE}||survey.pstpl||A small graph showing the percentage of the survey completed&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPNAME}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group name&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPDESCRIPTION}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group description&lt;br /&gt;
|-&lt;br /&gt;
|{NUMBEROFQUESTIONS}||welcome.pstpl||Displays the total number of questions in the survey (just the number)&lt;br /&gt;
|-&lt;br /&gt;
|{THEREAREXQUESTIONS}||welcome.pstpl||Displays the sentence &amp;quot;There are X questions in this survey&amp;quot; - from the relevant language file. The X is replaced with the number of questions. Note that this will also work appropriately for singular or plural. If there is only 1 question, it will print &amp;quot;There is 1 question in this survey&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|{CHECKJAVASCRIPT}||All files (mainly for welcome.pstpl)||Warning message when end-user browser have javascript disabled&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION}||Question.pstpl||(&#039;&#039;&#039;Has been superseeded as of LS1.87&#039;&#039;&#039;) Displays the current question text (The format of {QUESTION} can customised by editing &#039;question_start.pstpl&#039;) Use the following: {QUESTION_TEXT}, {QUESTION_MANDATORY}, {QUESTION_HELP}, {QUESTION_MAN_MESSAGE}, {QUESTION_VALID_MESSAGE}, {QUESTION_INPUT_ERROR_CLASS}, and appropriate wrapping HTML instead of {QUESTION}&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWER}||question.pstpl, print_question.pstpl||presents the answer form for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{SGQ}||question.pstpl, question text||Can be used in the question text itself to reference the input field of the question dynamically by displaying the Survey-Group-Question id for the current question. (as of svn build 9755)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTIONHELP}||question.pstpl, print_question.pstpl||Displays help text (predefined tip for question type) for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CLASS}||question.pstpl, print_question.pstpl||unique class for each question type. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CODE}||question.pstpl, print_question.pstpl||Displays the current question code&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ESSENTIALS}||question.pstpl||the question ID and (if a question is conditional), &#039;style=&amp;quot;display:none;&amp;quot;&#039;. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_HELP}||question.pstp, question_start.pstpl||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TYPE_HELP}||print_question.pstp||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_INPUT_ERROR_CLASS}||question.pstp, question_start.pstpl||Provides a class if there was user input error&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ID}||print_question.pstp||Provides a unique ID for each question to allow styling for specific questions&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TEXT}||question.pstp, print_question.pstp, question_start.pstpl||Displays the text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MANDATORY}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_CLASS}||question.pstpl, print_question.pstpl||class if a question is mandatory. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_NUMBER}||print_question.pstpl||Incremental count of questions.&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_VALID_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated valid help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_SCENARIO}||print_question.pstp||Prints out the &#039;scenario&#039; text for conditional questions.&lt;br /&gt;
|-&lt;br /&gt;
|{NAVIGATOR}||navigator.pstpl||Displays navigation buttons (next, prev, last)&lt;br /&gt;
|-&lt;br /&gt;
|{CLEARALL}||All files (but intended for navigator.pstpl)||Displays the &amp;quot;Exit and Clear Results&amp;quot; link&lt;br /&gt;
|-&lt;br /&gt;
|{COMPLETED}||completed.pstpl||Displays the &#039;completed&#039; message for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{URL}||completed.pstpl||Displays the survey &#039;url&#039; and &#039;url text&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{PRIVACYMESSAGE}||privacy.pstpl||The privacy message is shown if you set your survey to be anonymous. [[Translating LimeSurvey|The text can be edited/translated]] in the language files. This can also be changed manually by editing the privacy.pstpl template you wish to use.&lt;br /&gt;
|-&lt;br /&gt;
|{TEMPLATEURL}||All Files||The URL to the current template location (useful for referencing image files in your template)&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYRESOURCESURL}||All Files||The URL to the current uploaded files for this survey location (useful for referencing image files in your question, group, ....)&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITCOMPLETE}||endpage.pstpl||The statement (from the language files) that tells the user they have completed the survey, and to press the &amp;quot;Submit&amp;quot; button&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITREVIEW}||survey.pstpl||The statement (from the language files) that tells the user they can review/change the answers they have made by clicking &amp;quot;&amp;lt;&amp;lt; prev&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{SAVEDID}||All Files||Displays &#039;Response ID&#039; of user&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|{QUEXMLPDF}||All Files||Displays button to export the queXML PDF of questionnaire including answers entered up until the point that has been completed in the survey.&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:FIRSTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users first name from the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:LASTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users last name from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:EMAIL}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users email from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_1}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_1 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_2}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_2 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWERSCLEARED}||Preferably in navigator.pstpl||The &amp;quot;Answers Cleared&amp;quot; statement from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{RESTART}||clearall.pstpl||URL to restart the survey&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERERROR}||register.pstpl||Shows any error messages in the register page (ie: &amp;quot;You must include an email address&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE1}||register.pstpl||The statement &amp;quot;You must be registered to complete this survey&amp;quot; from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE2}||register.pstpl||Details about registering from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERFORM}||register.pstpl||The actual form for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{SAVE}||Works suitable on navigator.pstpl||Displays the &#039;Save your responses so far&#039; button to offer the user to save and come back later to continue the survey. If the Save option is deactivated in the survey properties the tag will not be shown and ignored.&lt;br /&gt;
|-&lt;br /&gt;
|{LANGUAGECHANGER}||survey.pstpl||Displays a switch in multilingual surveys to change the question.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Input/Buttons== &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
Each &amp;quot;input&amp;quot; type in a survey has been given its own class name, so that you can add CSS to your &amp;quot;startpage.pstpl&amp;quot; file and have some control over the appearance of form buttons and inputs. These class names are as follows:&lt;br /&gt;
*&#039;&#039;&#039;submit&#039;&#039;&#039; (Submit Buttons)&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; (Text Inputs - for short free text, date, and numerical type)&lt;br /&gt;
*&#039;&#039;&#039;answertext&#039;&#039;&#039; (Text of answers)&lt;br /&gt;
*&#039;&#039;&#039;radio&#039;&#039;&#039; (Radio Buttons)&lt;br /&gt;
*&#039;&#039;&#039;checkbox&#039;&#039;&#039; (Check Boxes)&lt;br /&gt;
*&#039;&#039;&#039;select&#039;&#039;&#039; (Select / List Boxes)&lt;br /&gt;
*&#039;&#039;&#039;textarea&#039;&#039;&#039; (Large text inputs - for long free text)&lt;br /&gt;
*&#039;&#039;&#039;clearall&#039;&#039;&#039; (The &amp;quot;Exit and Clear Survey&amp;quot; link)&lt;br /&gt;
*&#039;&#039;&#039;rank&#039;&#039;&#039; (The rank style question. Doesn&#039;t set the colour of the select box or the text boxes, but it does allow the changing of background colour, text colour, size etc., for the rest of the ranking question)&lt;br /&gt;
*&#039;&#039;&#039;graph&#039;&#039;&#039; (The &amp;quot;percentage completed&amp;quot; graph table)&lt;br /&gt;
*&#039;&#039;&#039;innergraph&#039;&#039;&#039; (The table inside the graph table - this contains the 0% and 100% text. Use this for changing the size of this text)&lt;br /&gt;
*&#039;&#039;&#039;question&#039;&#039;&#039; (General settings for any question that is displayed within a table. Generally, you should use this to make sure that their font size and color is the same as you have used elsewhere as a default)&lt;br /&gt;
*&#039;&#039;&#039;mandatory&#039;&#039;&#039;  (Mandatory questions)&lt;br /&gt;
*&#039;&#039;&#039;input-error&#039;&#039;&#039; (User input error - for if a user has made a mistake with a mandatory question or question with validation)&lt;br /&gt;
*&#039;&#039;&#039;array1&#039;&#039;&#039; and &#039;&#039;&#039;array2&#039;&#039;&#039; (These two styles are cycled when presenting the range of answers for an array type question. This allows you to set an alternating background color for these question types. &#039;&#039;&#039;Array1&#039;&#039;&#039; is also used for the column headings in these question types)&lt;br /&gt;
*&#039;&#039;&#039;errormandatory&#039;&#039;&#039; (Sets the color and style of the &amp;quot;This question is mandatory&amp;quot; error message)&lt;br /&gt;
*&#039;&#039;&#039;warningjs&#039;&#039;&#039; (Sets the color and style of the warning message displayed if the participant&#039;s browser has javascript disabled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
There are also some elements that can be accessed using the ID of the element (&#039;&#039;&#039;#ID&#039;&#039;&#039; in CSS):&lt;br /&gt;
*&#039;&#039;&#039;surveycontact&#039;&#039;&#039; (The contact message shown on the start page)&lt;br /&gt;
*&#039;&#039;&#039;tokenmessage&#039;&#039;&#039; (used for messages inside the survey, e.g. the session expired error message)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
Because you can edit all the HTML aspects, there&#039;s no reason to surround your templates with a &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&#039;new_name&#039;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and then define a css for that new_name class.&lt;br /&gt;
&lt;br /&gt;
==Styling the progress bar== &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
The progress bar appearance can be modified with CSS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
To change the background color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-header {&lt;br /&gt;
 background-color: #3300FF;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
To change the border color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-content,&lt;br /&gt;
#progress-wrapper .ui-widget-header {&lt;br /&gt;
 border: 1px solid #FF0000;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Features Available to Developers== &amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
LimeSurvey has integrated some user-made patches that permits some special changes. These very advanced features (generally) require changes to the underlying code base of LimeSurvey and should be done carefully in order not to introduce security holes.&lt;br /&gt;
&lt;br /&gt;
===Support for your own Javascript functions=== &amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Some users may need to run Javascript on the survey pages, but calling &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; in the BODY element made it impossible to do so. This call has been replaced with a small JavaScript function in the HEAD that sniffs for the existence of &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; and &#039;&#039;&#039;template_onload()&#039;&#039;&#039; before calling them. In this way, a template author can create his or her own &#039;&#039;&#039;template_onload()&#039;&#039;&#039; function in the HEAD that replaces the default one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
*Disable XSS filter - in Global settings -&amp;gt; Security, set &amp;quot;Filter HTML for XSS&amp;quot; to No.&lt;br /&gt;
*Enter your script in the source of a question or group description.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:301--&amp;gt;&lt;br /&gt;
{{Note|For further details, see the [[Workarounds: Manipulating a survey at runtime using Javascript#How to use Script (eg. JavaScript etc.) in LimeSurvey|workaround section]].}}&lt;br /&gt;
&lt;br /&gt;
=Videos on Templates= &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
This video will demonstrate the basic and advanced template functions that are available to all LimeSurvey users. This includes changing the appearance of certain forms and inserting custom graphics. Additionally, it will thoroughly walk you through on how to edit and preview specific page templates, importing/exporting templates, modify appearance of questions in the CSS, and customizing survey description page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:302--&amp;gt;&lt;br /&gt;
Video - needed&lt;br /&gt;
&lt;br /&gt;
=Tips &amp;amp; Tricks= &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some language specific element== &amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
If you want to have some language specific sentence in a survey, for example a help at the end of each page, you can add in a .pstl file a sentence and hidding it for other language. If we hide it in the template.css, we can use the pseudo selector :lang, but we use some class for better compatibility.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
Below, there are two help sentences, in French and English. Put this on endpage.pstpl:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;fr&amp;quot; lang=&amp;quot;fr&amp;quot;&amp;gt;Pour de l&#039;aide en direct appelez le 000000&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;For some help, please call 000000&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
and in template.css:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:152--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.lang-fr .en{display:none}&lt;br /&gt;
.lang-en .fr{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change the layout of the survey page== &amp;lt;!--T:155--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:156--&amp;gt;&lt;br /&gt;
After editing and saving a template, it applies to a survey list page only if it is selected from the settings of the survey. To make it the default template, go under the &#039;&#039;&#039;General tab&#039;&#039;&#039; located in the &#039;&#039;&#039;Global settings&#039;&#039;&#039; of your LimeSurvey installation and choose the desired template. From now on, all the templates that use the &amp;quot;default&amp;quot; option as template plus the ones that are going to be newly created, will use the newly selected default template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
To use your current template for this page, you have to change the according setting from &#039;&#039;&#039;Global settings&#039;&#039;&#039;. In older versions, this change can be done by editing the $defaulttemplate setting from the config file: copy this setting from config-defaults.php to config.php which overrides config-defaults.php and edit this setting to &amp;lt;code lang=&amp;quot;html&amp;quot;&amp;gt;$defaulttemplate = &#039;yourtemplatename&#039;;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Import/Export of templates: Mac users== &amp;lt;!--T:158--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;Mac users&amp;lt;/u&amp;gt;, please note that the Mac OSX default archive utility may have problems with zip folders &amp;quot;generated on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:160--&amp;gt;&lt;br /&gt;
A workaround is to unix&#039;es unzip from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
$ unzip template.zip -d template&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:162--&amp;gt;&lt;br /&gt;
Archive: template.zip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
 inflating: template/startpage&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:164--&amp;gt;&lt;br /&gt;
 inflating: ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
Another workaround is to use scripts in their mac-compiled counterparts.&lt;br /&gt;
&lt;br /&gt;
==Replacing the help icon {{ObsoleteIn|2.50}} == &amp;lt;!--T:173--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:174--&amp;gt;&lt;br /&gt;
When a question help text is shown, then an help.gif image is used from the default template folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
You can replace this image by uploading a new help.gif, help.png or help.jpg in your custom template folder. It will then be automatically used instead of the default help icon.&lt;br /&gt;
&lt;br /&gt;
==Replacing an existing logo {{NewIn|2.50}} {{ObsoleteIn|3.0}}== &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:177--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In the &#039;&#039;&#039;default&#039;&#039; Template of 2.50, there is no preembedded logo. Read further our [[#Adding_your_own_logo |wiki on how to add your own logo]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
1. To edit the logo go to the &#039;&#039;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&#039;&#039; file which you can find it here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:179--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t1.PNG|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
2. Click the search button to find occurrences of logo related styles and search for &#039;&#039;logo&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:181--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:2.png|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
4. Edit the main style file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:185--&amp;gt;&lt;br /&gt;
You will see something similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t4.PNG|500px]]&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:187--&amp;gt;&lt;br /&gt;
If you want to change the image, just replace logo.gif with another image link. Example: (&amp;lt;u&amp;gt;logo.png&amp;lt;/u&amp;gt; or &amp;lt;u&amp;gt;logo.jpg&amp;lt;/u&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:188--&amp;gt;&lt;br /&gt;
If you want to change the image size, adjust width and height (in pixels) like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;width:100px; height:100px;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo {{ObsoleteIn|3.0}} == &amp;lt;!--T:190--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
1. Find and open the &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; template file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:192--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:startpage.pstpl.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
2. After this&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; &amp;gt;&amp;lt;div id=&amp;quot;topContainer&amp;quot; class=&amp;quot;jumbotron&amp;quot;&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
add this line to &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;img id=&#039;page_logo&#039; src=&#039;{TEMPLATEURL}/files/logo.png&#039; class=&amp;quot;clearfix pull-right&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
3. To upload your own logo, go to the template editor and upload your logo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:197--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:uploadyourlogo.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:199--&amp;gt;&lt;br /&gt;
To position your logo, please use one of the following css classes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:293--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the left side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:200--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-left&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:204--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the right side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:205--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-right&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:208--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want to center the logo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:209--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix center-block&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the same template with different logos== &amp;lt;!--T:214--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:215--&amp;gt;&lt;br /&gt;
If you want to use the same template for all surveys and just want to change the logo for each survey, you can use the {SID} placeholder in the template .pstpl file and thereby refer to different images:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:216--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;{TEMPLATEURL}files/logoImage-{SID}.png&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the default help to all question (hide_tip) {{ObsoleteIn|1.92}}== &amp;lt;!--T:217--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:218--&amp;gt;&lt;br /&gt;
There are 3 solutions to remove the default help:&lt;br /&gt;
# like a hide_tip attribute but for all question and survey.&lt;br /&gt;
# you can remove the {QUESTIONHELP} and its container from the file question.pstl. However, it can be a bad idea for the screenreader.&lt;br /&gt;
# for the default template and some other, add this at the end of tempate.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:219--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;span.questionhelp{display:none;}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display custom favicon== &amp;lt;!--T:220--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:221--&amp;gt;&lt;br /&gt;
A favicon is the little icon you see in the browser&#039;s address bar, list of bookmarks or tab. You can display your own icon as follows:&lt;br /&gt;
#Create a favicon - google will find you lots of free favicon generators.&lt;br /&gt;
#Name your new favicon &amp;quot;favicon.ico&amp;quot; and place it in your template /files directory.&lt;br /&gt;
#Add the following code to your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; before the &amp;lt;/head&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:222--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Different appearance for survey-/question-pages== &amp;lt;!--T:224--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:226--&amp;gt;&lt;br /&gt;
If you want LimeSurvey to change the appearance of every second page (i.e. of even and odd survey pages), you can use &#039;&#039;&#039;.page-odd&#039;&#039;&#039; class in your CSS file to change the appearance of odd pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:227--&amp;gt;&lt;br /&gt;
An example from default template of LimeSurvey 1.91+:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:228--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.page-odd table.question-group {&lt;br /&gt;
 background-color: #D2F2D3;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:232--&amp;gt;&lt;br /&gt;
If you do &#039;&#039;&#039;not&#039;&#039;&#039; want differentiate even and odd pages, find all instances of &#039;&#039;.page-odd&#039;&#039; in template.css and remove those styles.&lt;br /&gt;
&lt;br /&gt;
==Create a vertical separator  border for dual scale array== &amp;lt;!--T:233--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:234--&amp;gt;&lt;br /&gt;
To create a vertical separator border for a dual scale array, you can add the following lines to your &#039;&#039;&#039;template.css&#039;&#039;&#039;-file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:235--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
table.question thead td.header_separator,&lt;br /&gt;
table.question tbody td.dual_scale_separator&lt;br /&gt;
{&lt;br /&gt;
   border-right:solid 1px #00A8E1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:242--&amp;gt;&lt;br /&gt;
&#039;&#039;header_separator&#039;&#039; is used to adress the separator for the header &amp;quot;td&amp;quot;. The &amp;quot;dual_scale_separator&amp;quot; is used to address the separator column in the dual scale array.&lt;br /&gt;
&lt;br /&gt;
==Hide the survey contact message shown on the start page/survey list {{ObsoleteIn|3.0}} == &amp;lt;!--T:243--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:244--&amp;gt;&lt;br /&gt;
To hide the &amp;quot;Please contact ...&amp;quot; message on the start page (with the survey list), you can add the following to the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.js&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:245--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:246--&amp;gt;&lt;br /&gt;
$(&#039;#surveycontact&#039;).hide(); //Hides the survey contact message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:247--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the survey contact message shown on error messages {{ObsoleteIn|3.0}}== &amp;lt;!--T:248--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:249--&amp;gt;&lt;br /&gt;
If you want to remove the survey contact message from error messages, it&#039;ll be trickier. You can add the function from below. It calls the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.css&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:250--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
removeContactAdressFromMessage(); //Removes the survey contact message from error messages&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:253--&amp;gt;&lt;br /&gt;
and add the following function to your *template.js* file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:254--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
function removeContactAdressFromMessage()&lt;br /&gt;
{&lt;br /&gt;
if ($(&#039;#tokenmessage&#039;).length &amp;gt; 0)&lt;br /&gt;
   {&lt;br /&gt;
   var oldMessage = $(&#039;#tokenmessage&#039;).html();&lt;br /&gt;
   var indexContact = oldMessage.indexOf(&#039;Bitte kontaktieren&#039;);&lt;br /&gt;
   var newMessage = oldMessage.substr(0, indexContact);&lt;br /&gt;
   $(&#039;#tokenmessage&#039;).html(newMessage);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:266--&amp;gt;&lt;br /&gt;
It will probably not work for a survey in English language and has to be extended when used for multilingual surveys. But it&#039;s an idea/tip on how to solve this.&lt;br /&gt;
&lt;br /&gt;
==How to deal with multilingual question attributes {{ObsoleteIn|2.50}}== &amp;lt;!--T:267--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:268--&amp;gt;&lt;br /&gt;
If you have a multilingual survey and e. g. want to use a different string for the &amp;quot;other&amp;quot; field, this could only be done for the base language (until this feature was added at LimeSurvey 2.0). To work around this, paste in the field to change the label for &amp;quot;other&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:269--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;en&amp;quot;&amp;gt;New label&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;fr&amp;quot;&amp;gt;Nouveau label&amp;lt;/span&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:270--&amp;gt;&lt;br /&gt;
Add in the template.css of your template (at &#039;&#039;/limesurvey/upload/templates/&amp;lt;yourtemplatename&amp;gt;/template.css&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:271--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;html:lang(en) .fr{display:none}&lt;br /&gt;
html:lang(fr) .en{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo to the survey list {{ NewIn|3.0}} == &amp;lt;!--T:310--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:311--&amp;gt;&lt;br /&gt;
# First please open the theme editor for the theme you like to use. [[File:OpenThemeEditor.jpg]]&lt;br /&gt;
# We recommend to use fruity, it is our best theme currently. &lt;br /&gt;
# Then extend the theme and give it a name you will recognize. [[File:ExtendTheme.jpg]]&lt;br /&gt;
# In the following view you may upload the logo you want to use. [[File:UploadFileTheme.jpg]]&lt;br /&gt;
# Select the editor screen `Survey List´ in the Screen dropdown in the top right corner. [[File:OpenScreenSurveyList.jpg]]&lt;br /&gt;
# Then select `layout_survey_list.twig´ in the left side menu. [[File:EditLayoutSurveyListTwig.jpg]]&lt;br /&gt;
# In the editor scroll to line 126 and change the marked part to the filename of the image you uploaded to the theme before. [[File:ChangeSurveyListHeaderImageEditor.jpg]]&lt;br /&gt;
# Save your file. [[File:ThemeEditorSaveChanges.jpg]]&lt;br /&gt;
# Change default theme to your extended theme. [[File:ChangeDefaultTheme.jpg]]&lt;br /&gt;
&lt;br /&gt;
=Custom Question Views {{NewIn|3.0}}= &amp;lt;!--T:289--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:290--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; This is a temporary feature to be replaced in the future by question object (it will be very easy to move custom views to question object). It is disabled by default.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:291--&amp;gt;&lt;br /&gt;
As of version 2.5, you can create template-specific custom views for questions and some of their incorporated elements. This is useful if you want to modify the HTML layout of a particular question type for one or more surveys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:292--&amp;gt;&lt;br /&gt;
*In application/config/config.php, find &#039;config&#039;=&amp;gt;array and add this line to the array : &#039;allow_templates_to_overwrite_views&#039;=&amp;gt;1&lt;br /&gt;
*In /{your_template}/config.xml, set &amp;quot;overwrite_question_views&amp;quot; to true&lt;br /&gt;
*Copy application/views/survey/* to template/{your_view_directory}/survey/&lt;br /&gt;
*Note that you only need to copy the files that you intend to modify but the file structure must remain the same as in application/views/survey/&lt;br /&gt;
&lt;br /&gt;
=Insert Custom CSS or JavaScript files for template {{NewIn|2.50}}= &amp;lt;!--T:296--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:303--&amp;gt;&lt;br /&gt;
As of version 2.50, you can use the config.xml file to automatically load plugin files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:304--&amp;gt;&lt;br /&gt;
*Upload your files to the template /css or /scripts folder&lt;br /&gt;
*In /{your_template}/config.xml, add the file paths to the &amp;lt;css&amp;gt; or &amp;lt;js&amp;gt; blocks, something like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;css&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/jquery-ui-custom.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/bootstrap-slider.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:305--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/flat_and_modern.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:306--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/template.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:307--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/myCustomPlugin.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;js&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/template.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/bootstrap-slider.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:308--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;scripts/myCustomPlugin.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/js&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95849</id>
		<title>Theme editor</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95849"/>
		<updated>2018-04-04T10:25:05Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt; &amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
LimeSurvey has an advanced theme and style system providing to developers an efficient way to customize the survey appearance. Since LS3, we&#039;re not speaking anymore about &#039;&#039;&#039;&amp;quot;templates&amp;quot;&#039;&#039;&#039; like in previous versions, but about &#039;&#039;&#039;&amp;quot;themes&amp;quot;&#039;&#039;&#039;. The &#039;&#039;&#039;themes&#039;&#039;&#039; allow control over the look and feel of pages during a survey. A survey administrator can select a default theme that will be used for each survey to further personalize it and improve its look and feel. &#039;&#039;&#039;Themes&#039;&#039;&#039;  come with options that provide to admin without coding skill a simple way to add a logo on the welcome page, to change the background colors, to select a font, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
LimeSurvey comes with 3 themes right out of the box. These initial themes are defined by directories located in the LimeSurvey installation &amp;quot;themes/survey/&amp;quot; directory. Each theme has it&#039;s own directory. Within the main directory of a theme you&#039;ll find a configuration file in XML, and numerous directories containing the views &#039;&#039;themes (.twig)&#039;&#039;&#039;, &#039;&#039;&#039;cascading style sheets (.css)&#039;&#039;&#039;, &#039;&#039;&#039;scripts&#039;&#039;&#039;,  &#039;&#039;&#039;images&#039;&#039;&#039; (&#039;&#039;&#039;.jpg&#039;&#039;&#039; or &#039;&#039;&#039;.png&#039;&#039;&#039;), and maybe others. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Since LimeSurvey 2.50, the theme engine use [http://getbootstrap.com/docs/3.3/ Bootstrap 3]  as CSS framework. Bootstrap 3 being a standard framework, developers will find a lot of documentation, tutorials and forum threads about it on Internet. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since LimeSurvey 3, the theme engine use [https://twig.symfony.com Twig], so the theme developers can change the logic of the survey rendering in a safe and easy way. Twig replace the old system of replacement keywords that was used in the previous versions. The logic that was used to generate the HTML of the keywords are now available inside the theme&#039;s views. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Snippet from Vanilla Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;twig&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.answercontainer }} col-xs-12&amp;quot; {{ aSurveyInfo.attr.answercontainer }}&amp;gt;&lt;br /&gt;
    {# NOTE: If you want to customize the question rendering, use a question theme #}&lt;br /&gt;
    {{ aQuestion.answer | raw }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Themes, being HTML and Twig code, tend to define the positioning and type of text to be displayed and similar structural features of the page. They often reference or include other files. Most of them reference a common cascading style sheets (CSS) file that defines the font style, color, size, background, and similar parameters common to all pages in the survey. Style sheets reference HTML &#039;&#039;&#039;class&#039;&#039;&#039; parameters that are associated with the various types of objects in the HTML code. This allows the style sheet to describe how to display each of the many types of text or other objects that may appear in multiple places. There are unique classes for each question type in LimeSurvey and thus giving detailed control over the appearance of each. Image files, like logos or special progress-bar constructors, may be referenced as well in the Theme file. Finally, special keywords in curly braces are replaced with text defined in the survey for each language translation correspondent (for example, the &#039;Survey Title&#039; or &#039;Question Text&#039; for each language defined).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
If you create a new custom theme, please consider contributing it back to the LimeSurvey community and make it available to others. With your help, we can grow our repository of themes, surveys, and other add-ons to make LimeSurvey even better! &lt;br /&gt;
See our [https://www.limesurvey.org/index.php?option=com_sobipro&amp;amp;sid=55:Templates&amp;amp;Itemid=729 LimeSurvey template repository] where you can share your templates.&lt;br /&gt;
&lt;br /&gt;
=Creating a new template= &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To be able to create a new template (or edit an existing template), you need [[Manage users#Set global permissions for a user|Template Editing user permission]] in LimeSurvey as well as permission to manipulate the files in the underlying operating system hosting your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;Note of Warning:&#039;&#039;&#039;&amp;lt;/span&amp;gt; If you change templates, you could also affect all the pre-existing surveys from your LimeSurvey installation. Templates are an advanced feature that require experience and HTML knowledge in order to make them running smoothly.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
The preferred way to create a new template is through the &#039;&#039;&#039;Template Editor&#039;&#039;&#039; (see below), which is located in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; dialog. Some people may like to work directly with template files so that they can use their favorite text editor instead of the web interface. In this case, still use the Template Editor to first create your new template. This will create a new base template with all the files you need in the &#039;&#039;LimeSurvey_web_root/upload/templates/your_new_template&#039;&#039; directory. From there you can use your text editor to manually adjust the template files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; on unix/linux systems, these template files will be owned by the group and user where the web server is running (may be &amp;quot;www&amp;quot; for some systems). So, make sure you have enough access to edit these files, When you save them, make sure they don&#039;t change ownership! In this way, you can still use the web Template Editing interface if needed.&amp;lt;/div&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A number of &#039;public&#039; elements of LimeSurvey can be adjusted by a series of templates. The next section provides a very brief explanation of these templates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
{{Note|Template files may seem complex. Besides HTML, you might also need to understand CSS.}}&lt;br /&gt;
&lt;br /&gt;
=The LimeSurvey template editor= &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
To ease the understanding and quick update of a Template, LimeSurvey provides a &#039;&#039;&#039;Template Editor&#039;&#039;&#039; in the main &#039;&#039;&#039;administrative&#039;&#039;&#039; toolbar of the application. This Template Editor is only available to users [[Manage users#Set global permissions for a user|with the Templates permission]] and to superadministrators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:297--&amp;gt;&lt;br /&gt;
{{Alert|title=Attention|text=A template that is not correctly constructed can render a survey (that uses the respective template) inoperable. }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
The LimeSurvey template editor allows you to edit the contents of your templates online. Start the Template Editor by clicking on &#039;&#039;&#039;Template editor&#039;&#039;&#039; in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; menu. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:285--&amp;gt;&lt;br /&gt;
[[File:templates.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:286--&amp;gt;&lt;br /&gt;
The template editor page allows you to select the template you would like to edit/view. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:279--&amp;gt;&lt;br /&gt;
[[File:Template-editor-2013-7-10_11_38_16.png|center]]&lt;br /&gt;
&lt;br /&gt;
==The template menu== &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:298--&amp;gt;&lt;br /&gt;
The following options are available:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:280--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Create&#039;&#039;&#039;: Allows you to create a new template. In order not to start from scratch, the template &#039;default&#039; is copied.&lt;br /&gt;
*&#039;&#039;&#039;Import&#039;&#039;&#039;: Allows you to import a template from a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Export&#039;&#039;&#039;: Allows you to export the current template to a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Copy&#039;&#039;&#039;: Allows you to make a new template by copying the current one.&lt;br /&gt;
*&#039;&#039;&#039;Rename&#039;&#039;&#039;: Allows you to change the name of the template. It is generally used after copying or importing a template.&lt;br /&gt;
*&#039;&#039;&#039;Template&#039;&#039;&#039;: It is a drop-down list that shows all the available templates that are located in your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Screen&#039;&#039;&#039;: It is a drop-down list which allows you to choose which particular survey page of that template you want to look at.&lt;br /&gt;
*&#039;&#039;&#039;Return to admin panel&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Import/export/copy a template== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
When you &#039;&#039;&#039;export &#039;&#039;&#039;a template, a ZIP-file archive with all the files your template consists of will be created (.pstpl files, images, css files, ...). You can simply &#039;&#039;&#039;import&#039;&#039;&#039; the exported zip-file into another LimeSurvey installation by using the import feature or you can manually copy the archive into another LimeSurvey installation and extract it into the corresponding [[Theme editor#Template files location|template directory there]]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:288--&amp;gt;&lt;br /&gt;
However, it is preferred to use the LimeSurvey template import/export/copy functions in the template editor.&lt;br /&gt;
&lt;br /&gt;
==Page Structure / Template Use== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;The Welcome Page:&#039;&#039;&#039; startpage.pstpl, welcome.pstpl, privacy.pstpl,  navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Questions Pages:&#039;&#039;&#039; startpage.pstpl, survey.pstpl, startgroup.pstpl, groupdescription.pstpl, question.pstpl, endgroup.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Final Page:&#039;&#039;&#039; startpage.pstpl, assessment.pstpl, completed.pstpl, endpage.pstpl&lt;br /&gt;
&lt;br /&gt;
==Template Files== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The following template files are used to produce your public survey and must exist in any new template folder you create:&lt;br /&gt;
*&#039;&#039;&#039;startpage.pstpl:&#039;&#039;&#039; Produces the start of each html page. It starts at the &amp;quot;&amp;lt;head&amp;gt;&amp;quot; tag, and should not contain the &amp;quot;&amp;lt;html&amp;gt;&amp;quot; tag. This &#039;very beginning&#039; of a standard html page is written by the scripts. Please ensure that your startpage.pstpl files contains a &amp;lt;body&amp;gt; tag. Even though many browsers do not require strict adherence to the W3 HTML standards, the LimeSurvey script needs to find a &amp;lt;body&amp;gt; tag to run certain javascript elements. It is not expected to see many &#039;keywords&#039; used in the startpage.pstpl file. However, you may wish to put the {SURVEYNAME} into the title. The startpage.pstpl file can contain code that ends in the corresponding endpage.pstpl file. For example, you can start a table in this file and close the table in the endpage.pstpl file. The startpage.pstpl and endpage.pstpl files wrap around every possible page used by LimeSurvey.&lt;br /&gt;
*&#039;&#039;&#039;survey.pstpl:&#039;&#039;&#039; This template is the second used on most pages and provides a space to put the survey name and description. This template does not have a corresponding &#039;closing&#039; template, and subsequently you should close all tags opened in this template file (i.e.: don&#039;t leave a table open here because there is nowhere else to close it).&lt;br /&gt;
*&#039;&#039;&#039;welcome.pstpl:&#039;&#039;&#039; This template is only used in the welcome screen (which is also on the main page for &#039;all in one&#039; surveys). You can use this to print out the welcome text, and other information that should be provided in the introduction. Like the &#039;survey.pstpl&#039; file, there is no corresponding &#039;closing&#039; template, so all tags opened in this template file should be closed as well.&lt;br /&gt;
*&#039;&#039;&#039;startgroup.pstpl:&#039;&#039;&#039; This template can provide a &#039;summary&#039; wrap around for questions within a group. It has a matching &#039;endgroup.pstpl&#039; template that can be used to close any opened tags in this file, so you can open a table within this.&lt;br /&gt;
*&#039;&#039;&#039;groupdescription.pstpl:&#039;&#039;&#039; This template file is used to display a description of a group. Please note that in the survey settings (access the &#039;&#039;Presentation &amp;amp; navigation settings&#039;&#039; by clicking on the &#039;&#039;&#039;Presentation&#039;&#039;&#039; tab) you can set if the group description should be shown or not. If not, then this file is not included at all.&lt;br /&gt;
*&#039;&#039;&#039;question.pstpl:&#039;&#039;&#039; This file contains the question, answer, and help text sections of your survey. In the &amp;quot;group by group&amp;quot; and &amp;quot;all in one&amp;quot; surveys, this template is cycled repeatedly with each question. There is no corresponding closing file for this and all tags should be closed.&lt;br /&gt;
*&#039;&#039;&#039;question_start.pstpl:&#039;&#039;&#039; This file contains the individual elements found at the start of a question. It is included within &#039;question.pstpl&#039; via the {QUESTION} keyword. It is intended to allow template designers more control over the layout of a question. This template sits outside the normal templating system and &#039;&#039;&#039;was superseeded (as of LimeSurvey 1.87)&#039;&#039;&#039;. All keywords from this template are now available directly in question.pstpl. &lt;br /&gt;
*&#039;&#039;&#039;completed.pstpl:&#039;&#039;&#039; This page is displayed as the final page when the survey responses have been saved and the survey is over. It can be used to display a &amp;quot;forwarding link&amp;quot; as set in the survey setup.&lt;br /&gt;
*&#039;&#039;&#039;endgroup.pstpl:&#039;&#039;&#039; This file closes the group, and can be used to close off any tags opened in the startgroup.pstpl file&lt;br /&gt;
*&#039;&#039;&#039;navigator.pstpl:&#039;&#039;&#039; This file contains the buttons that navigate through the survey, &amp;quot;next&amp;quot;, &amp;quot;prev&amp;quot;, &amp;quot;last&amp;quot;, &amp;quot;submit&amp;quot;, &amp;quot;save so far&amp;quot;  and the &amp;quot;clear all&amp;quot; link. It is used in all pages except the completed page.&lt;br /&gt;
*&#039;&#039;&#039;printanswers.pstpl:&#039;&#039;&#039; This file has the HTML wrapper necessary for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_group.pstpl:&#039;&#039;&#039; This file is the same as startgroup.pstpl and endgroup.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_question.pstpl:&#039;&#039;&#039; This file is the same as question.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_survey.pstpl:&#039;&#039;&#039; This file is the same as survey.pstpl, but for the print version of the survey.&lt;br /&gt;
&lt;br /&gt;
== CSS and Javascript== &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
Two files that are always used in a template are template.css (for CSS) and template.js (for Javascript).&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATECSS}:&#039;&#039;&#039; Add lines for default css, template.css, and template-rtl.css for rtl language.&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATEJS}:&#039;&#039;&#039; Add lines for default javascript files, template.js, and all js files needed for LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
=== Using Bootstrap=== &amp;lt;!--T:294--&amp;gt;&lt;br /&gt;
LimeSurvey has Bootstrap 3 embedded, so you can style all your templates with the well documented Bootstrap classes.&lt;br /&gt;
For more information please refer to the [https://getbootstrap.com Bootstrap documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:295--&amp;gt;&lt;br /&gt;
The [https://github.com/flatlogic/awesome-bootstrap-checkbox Awesome-Bootstrap-Checkbox] plugin is also included. With it, you can use the typical Bootstrap color-classes (info,warning,danger,etc.) also with the suffix &amp;quot;-checkbox&amp;quot; or &amp;quot;-radio&amp;quot;, though styling checkboxes and radios as you prefer.&lt;br /&gt;
&lt;br /&gt;
=== Replacing default CSS or Javascript=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Some questions use specific files for Javascript or CSS. If you need to replace a function, use a cascading system. For javascript function, the last function read is the function used.&lt;br /&gt;
&lt;br /&gt;
==Other Template Files== &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The &#039;&#039;&#039;privacy.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;invitationemail.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;reminderemail.pstpl&#039;&#039;&#039;, and &#039;&#039;&#039;confirmationemail.pstpl&#039;&#039;&#039; are no longer used by LimeSurvey and defaults are instead set in the applicable language files. The email messages can now be edited on a survey by survey basis.&lt;br /&gt;
&lt;br /&gt;
==Standard Pages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
There are ten standard pages that a survey participant may see in the course of taking or accessing the LimeSurvey application.  Each is constructed from a number of common &#039;&#039;&#039;Template&#039;&#039;&#039; files from the &#039;&#039;&#039;Template&#039;&#039;&#039; specified in the settings of the survey. The table below indicates which template files are used in constructing each of these pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!  &#039;&#039;&#039;Survey Pages/&#039;&#039;&#039;&amp;lt;br /&amp;gt;&#039;&#039;&#039;Template Files&#039;&#039;&#039;!!Survey&amp;lt;br /&amp;gt;List!!Welcome!!Question!!Completed!!Clear All!!Register!!Load!!Save!!Print&amp;lt;br /&amp;gt;Answers!!Print&amp;lt;br /&amp;gt;Survey&lt;br /&gt;
|-&lt;br /&gt;
|SurveyList||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Welcome|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Privacy|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Navigator|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Survey|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|StartGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|GroupDescription|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Question&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|EndGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Assessment|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Completed|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ClearAll|| || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Register|| || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Load|| || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||&lt;br /&gt;
|-&lt;br /&gt;
|Save|| || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| ||&lt;br /&gt;
|-&lt;br /&gt;
|PrintAnswers|| || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||&lt;br /&gt;
|-&lt;br /&gt;
|Print Survey || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Group || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Question || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|StartPage&amp;lt;br /&amp;gt;EndPage&amp;lt;br /&amp;gt;Template.css||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.90+, this replaces question.pstpl AND question_start.pstpl. If you are using an old custom template, you need to add the following line to the beginning of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div {QUESTION_ESSENTIALS} class=&amp;quot;{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;And then add the corresponding closing tag to the end of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.91 and earlier, LimeSurvey js files are not included in the template. In version 2, &#039;&#039;&#039;you have to use {TEMPLATEJS} in one of your template file&#039;&#039;&#039; to add the link to the js file. You can add it in startpage.pstpl or in endpage.pstpl. You can remove the {TEMPLATEURL}/template.js line and you have to replace with {TEMPLATEJS} to update a personal template.&lt;br /&gt;
&lt;br /&gt;
==The File Control Section== &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
In the &amp;quot;file control&amp;quot; window on the left, you can click on one of the template files that is used to compile the page. You can see the &#039;&#039;Screen part&#039;&#039;, JavaScript, and CSS files. The HTML code for that file will then appear in the &amp;quot;Now editing&amp;quot; window in the center. If the template is editable (determined by directory permissions) you can then make any changes and save them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:299--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:File Control Section.png|center]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The &amp;quot;Other files&amp;quot; window shows a list of all other files from the template directory. You can use the right side to &#039;&#039;&#039;upload and select image files (your pics, logos,...) or other files needed to create your template&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:300--&amp;gt;&lt;br /&gt;
Instead of using a link for each picture, utilize the field string {TEMPLATEURL}. So, instead of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;/limesurvey/templates/yourtemplate/files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
You can use {{NewIn|2.50}}:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:287--&amp;gt;&lt;br /&gt;
In LimeSurvey versions before 2.50 use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
A &amp;quot;sample&amp;quot; of the template page you are editing will be visible in the bottom of the screen. There is no way to delete a template from the template editor. This must be done by accessing the underlying directory and deleting manually the files from there. You also have the possibility to select different screen resolutions in order to better evaluate the feel and look of the template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The shipped templates cannot be edited using the template editor. If you want to modify them, create a copy first and edit the copy.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Template files location== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
LimeSurvey stores each of the &#039;standard&#039; templates in their own distinct sub-directory within the &#039;&#039;/templates&#039;&#039; directory that is kept in the public directory with the other LimeSurvey public files. Customized user templates are stored in the &#039;&#039;/upload/templates&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
There should &#039;&#039;&#039;ALWAYS&#039;&#039;&#039; be a &amp;quot;default&amp;quot; directory in the templates directory. This template is used by default and as a fall-back if a template folder doesn&#039;t exist, or can&#039;t be found. It comes installed by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
You can use any image files that you upload into the template management area with the help of this syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{TEMPLATEURL}filename.xyz&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Styling questions with CSS= &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
Styling of questions in CSS has become much easier. Each question type has now a unique class. The mandatory questions have an additional mandatory class. For example, for a non-mandatory question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
and if the question is mandatory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
and if the question is mandatory, but the user didn&#039;t answer it or if there is validation on a question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
and if the question has validation applied, but the user hasn&#039;t answered correctly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question6&amp;quot; class=&amp;quot;text-short input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Global classes for question part== &amp;lt;!--T:273--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:274--&amp;gt;&lt;br /&gt;
These classes are used for each question type. Some question types use only one or two classes, while others may use much more.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:281--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable alternance&amp;quot;&lt;br /&gt;
|+ Global classes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Class name&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Part&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Question type&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Examples&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Note&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question {{ObsoleteIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;p class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;question&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-answers {{NewIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;div class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;ls-answers&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .subquestions-list&lt;br /&gt;
| List of subquestion&lt;br /&gt;
| Multi choice question, array question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;subquestions-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;subquestions-list&amp;quot;&amp;gt;&lt;br /&gt;
| .questions-list is used too&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answers-list&lt;br /&gt;
| List of answers&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;answers-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;answers-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answer-item&lt;br /&gt;
| The answer part: one answer&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;answer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;answer-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .noanswer-item&lt;br /&gt;
| The answer part for no answer&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;noanswer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
| No answer is an answer too, then have double class noanswer-item and answer-item&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question-item&lt;br /&gt;
| The question part: one question&lt;br /&gt;
| Multi text question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;question-item&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;question-item&amp;quot;&amp;gt;&lt;br /&gt;
| Some answers are questions too. Then we have a lot of class=&amp;quot;question-item answer-item&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-list&lt;br /&gt;
| A list of checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;checkbox-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| Some question types use multi-list class, like checkbox with comment: class=&amp;quot;checkbox-list text-list&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of checkbox&lt;br /&gt;
| Array (numbers) with checkbox option&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-item&lt;br /&gt;
| The answer part with a checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;checkbox-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;checkbox-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-list&lt;br /&gt;
| A list of radio item&lt;br /&gt;
| Single choice question, array question type (each row)&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;radio-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;radio-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-array {{NewIn|3.0}}&lt;br /&gt;
| A array of radio item&lt;br /&gt;
| Array question type&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;radio-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-item&lt;br /&gt;
| The answer part with a radio&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;radio-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;radio-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-list&lt;br /&gt;
| A list of text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-item&lt;br /&gt;
| The answer part of a text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;text-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;text-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .numeric-list&lt;br /&gt;
| A list of text input with numeric only answer&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-list&lt;br /&gt;
| A list of text input with numeric only answer (each row)&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-array  {{NewIn|3.0}}&lt;br /&gt;
| The answer part of a numeric input&lt;br /&gt;
| Array of number&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;number-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-list  {{ObsoleteIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;select-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-list  {{NewIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select) (each row)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of dropdown&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-item  {{ObsoleteIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;select-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;select-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-item  {{NewIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;dropdown-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;dropdown-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .hide  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Used for accessibility: hidden with css but read by screenreader, since 2.50 : you can use sr-only from bootstrap&lt;br /&gt;
| Short text question&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;hide&amp;quot;&amp;gt;&lt;br /&gt;
| Can be used for other purposes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is activated&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it, but you can use it too in your template&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden-sr {{NewIn|3.0}}&lt;br /&gt;
| Used for accessibility: hide it if js is activated, but always show if user use a screenreader&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-js-hidden-sr&amp;quot;&amp;gt;&lt;br /&gt;
| Button&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-no-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is not activated&lt;br /&gt;
| Link&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it for inactive link if javascript is not activated&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-label-xs-visibility {{NewIn|3.0}}&lt;br /&gt;
|  Label to be hidden in big screen, but show with little screen (with no more table) and to screenreader&lt;br /&gt;
| label&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| Used for label inside table cell of array question type&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-input-group-extra {{NewIn|3.0}}&lt;br /&gt;
| Same usage of boostrap input-group-addon, but without the border and the background.&lt;br /&gt;
| right suffix&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-input-group-extra&amp;quot;&amp;gt;&lt;br /&gt;
| Used for right and left suffix (global)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=checkbox]&lt;br /&gt;
| Question with checkbox&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;checkbox&amp;quot; class=&amp;quot;checkbox&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=radio]&lt;br /&gt;
| Question with radio&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;radio&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text&lt;br /&gt;
| input[type=text]&lt;br /&gt;
| Question with input text, or textarea&lt;br /&gt;
| &amp;amp;lt;textarea class=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answertext&lt;br /&gt;
| Array question type&lt;br /&gt;
| Answer part of array question type&lt;br /&gt;
| &amp;amp;lt;th class=&amp;quot;answertext&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .col-answers&lt;br /&gt;
| Array question type&lt;br /&gt;
| Column of answers&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .odd .even {{ObsoleteIn|2.50}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for column&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .array1 .array2  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for line&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;array1&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-odd .ls-even  {{NewIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for sub-question and Y axis&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;ls-odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Some example of question part with classes=== &amp;lt;!--T:275--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:276--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Text-short question type:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;question answer-item text-item &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;label class=&amp;quot;hide label&amp;quot; for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Answer&amp;lt;/label&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;50&amp;quot; class=&amp;quot;text  empty&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:277--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Multiple short text&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;subquestions-list questions-list text-list&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li class=&amp;quot;question-item answer-item text-item&amp;quot; id=&amp;quot;javatbdSGQA&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;label for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Some example subquestion&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;span&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;20&amp;quot; class=&amp;quot;text empty&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:282--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Array question type&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;question subquestion-list questions-list &amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;caption class=&amp;quot;hide read&amp;quot;&amp;gt;Some explanation for accessibility.&amp;lt;/caption&amp;gt;&lt;br /&gt;
	&amp;lt;colgroup class=&amp;quot;col-responses&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;50%&amp;quot; class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;25%&amp;quot; class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;13.3%&amp;quot; class=&amp;quot;col-no-answer even&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;/colgroup&amp;gt;&lt;br /&gt;
	&amp;lt;thead&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array1 dontread&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;1&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;No answer&amp;lt;/th&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/thead&amp;gt;&lt;br /&gt;
	&amp;lt;tbody&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array2 answers-list radio-list&amp;quot; id=&amp;quot;javatbdSGQ&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;20%&amp;quot; class=&amp;quot;answertext&amp;quot;&amp;gt;Some example subquestion&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer_cell_001 answer-item radio-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;1&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer-item radio-item noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;No answer&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The full list of question classes== &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Question Type&#039;&#039;&#039;||&#039;&#039;&#039;Question Class&#039;&#039;&#039;||&#039;&#039;&#039;Question ID&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|5 point choice||.choice-5-pt-radio||5&lt;br /&gt;
|-&lt;br /&gt;
|Array (10 point choice)||.array-10-pt||B&lt;br /&gt;
|-&lt;br /&gt;
|Array (5 point choice)||.array-5-pt||A&lt;br /&gt;
|-&lt;br /&gt;
|Array (Flexible Labels) dual scale||.array-flexible-duel-scale ||1&lt;br /&gt;
|-&lt;br /&gt;
|Array (Increase, Same, Decrease)||.array-increase-same-decrease||E&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Numbers)||.array-multi-flexi ||:&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Text)||.array-multi-flexi-text||;&lt;br /&gt;
|-&lt;br /&gt;
|Array (Yes/No/Uncertain)||.array-yes-uncertain-no||C&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels)||.array-flexible-row ||F&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels) by column||.array-flexible-column||H&lt;br /&gt;
|-&lt;br /&gt;
|Boilerplate question||.boilerplate||X&lt;br /&gt;
|-&lt;br /&gt;
|Date||.date||D&lt;br /&gt;
|-&lt;br /&gt;
|Gender||.gender||G&lt;br /&gt;
|-&lt;br /&gt;
|Huge free text||.text-huge||U&lt;br /&gt;
|-&lt;br /&gt;
|Language switch||.language||I&lt;br /&gt;
|-&lt;br /&gt;
|List (dropdown)||.list-dropdown||!&lt;br /&gt;
|-&lt;br /&gt;
|List (radio)||.list-radio||L&lt;br /&gt;
|-&lt;br /&gt;
|List with comment||.list-with-comment||O&lt;br /&gt;
|-&lt;br /&gt;
|Long free text||.text-long||T&lt;br /&gt;
|-&lt;br /&gt;
|Multiple numerical input||.numeric-multi||K&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options||.multiple-opt||M&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options with comments||.multiple-opt-comments||P&lt;br /&gt;
|-&lt;br /&gt;
|Multiple short text||.multiple-short-txt||Q&lt;br /&gt;
|-&lt;br /&gt;
|Numerical input||.numeric||N&lt;br /&gt;
|-&lt;br /&gt;
|Ranking||.ranking||R&lt;br /&gt;
|-&lt;br /&gt;
|Short free text||.text-short||S&lt;br /&gt;
|-&lt;br /&gt;
|Yes/No||.yes-no||Y&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==The full list of validation classes== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Note:  Prior to 1.92, only .mandatory and .input-error classes were available.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
These apply to the help and/or validation tip messages so that each type can be individually styled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
The .hide-tip option and .input-error options interact by default so that you can have validation tips hidden. However, they do appear when there are validation errors and disappear again when those errors are rectified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
All of these are designed to eliminate the need for pop-up alert messages. Instead, tips can appear/disappear as needed and are color-coded to indicate whether the answers pass the validation criteria.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Furthermore, when you first visit a page that has unmet validation criteria, you can color-code the tips in a pleasing color to show which validation criteria have not been met yet; then re-display the page using a harsher color if the person submits the page with lingering validation errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Purpose&#039;&#039;&#039;||&#039;&#039;&#039;CSS Class&#039;&#039;&#039;||&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Mandatory||.mandatory||the question is mandatory&lt;br /&gt;
|-&lt;br /&gt;
|User input error||.input-error||the question had at least one validation error&lt;br /&gt;
|-&lt;br /&gt;
|Hide Tip||.hide-tip||added if you use the hide_tip option&lt;br /&gt;
|-&lt;br /&gt;
|Num answers||.em_num_answers||for for min_answers and max_answers&lt;br /&gt;
|-&lt;br /&gt;
|Value range||.em_value_range||for min/max_num_value_n and multiflexible_min/max&lt;br /&gt;
|-&lt;br /&gt;
|Sum range||.em_sum_range||for min/max/equals_num_value&lt;br /&gt;
|-&lt;br /&gt;
|Regex validation||.em_regex_validation||for regular-expression validation of the question&lt;br /&gt;
|-&lt;br /&gt;
|Question-level validation function||.em_q_fn_validation||for the em_validation_q option&lt;br /&gt;
|-&lt;br /&gt;
|Subquestion-level validation function||.em_sq_fn_validation||for the em_validation_sq option&lt;br /&gt;
|-&lt;br /&gt;
|Other comment mandatory||.em_other_comment_mandatory||for other_comment_mandatory option - shows when &amp;quot;other&amp;quot; is selected but associated comment is missing.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing styles into your custom template== &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
The custom question styles are near the bottom of each template&#039;s CSS file and start with:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;/* --------------------------- START: Question styles  ------------------------------ */&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
If you&#039;re styling your own custom template, you should be able to copy everything after the above one from &#039;&#039;templates/default/template.css&#039;&#039; (for table-based layouts) or &#039;&#039;/templates/limespired/template.css&#039;&#039; (for CSS-based layouts) into your own style sheet without any impact on your other styles.&lt;br /&gt;
&lt;br /&gt;
==Internet Explorer conditional style sheets== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
Because of the marked discrepancies in rendering between IE6 &amp;amp; IE7 and the other browsers, there are special IE conditional style sheets included for each template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_all-versions.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if lt IE 7]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_older-than-7.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8]&amp;gt;&lt;br /&gt;
		&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}ie_fix_8.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You should include the above code within your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; and copies of both the IE style sheets from either &#039;&#039;/templates/default/&#039;&#039; or &#039;&#039;/templates/limespired&#039;&#039; for Tables base layout and CSS based layout respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; If you copy the styles into your own style sheet you will almost certainly need to tweak them.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alternative solution for Internet explorer=== &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
You can put a conditional class for body in startpage.pstpl and use this class in your template.css. This method is used in the citronade template{{ObsoleteIn|2.06}}. Adding a js / no-js class to have javascript / no javascript system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;!--[if lt IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie6 ielt7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie8 ielt9  no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 9 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if gt IE 9]&amp;gt;&amp;lt;!--&amp;gt;&amp;lt;body id=&amp;quot;body&amp;quot; class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} no-js&amp;quot;&amp;gt;&amp;lt;!--&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;script type=&#039;text/javascript&#039;&amp;gt;/*&amp;lt;![CDATA[*/(function(H){ H.className=H.className.replace(/\bno-js\b/,&#039;js&#039;) })(document.getElementsByTagName(&#039;body&#039;)[0]);/*]]&amp;gt;*/&amp;lt;/script&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
And in template.css use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;.ie6{/*specific for internet explorer 6*/}&lt;br /&gt;
.ielt8{/*specific for internet explorer 6 and 7*/}&lt;br /&gt;
.ie{/*specific for all internet explorer */}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Right-to-Left (RTL) Languages and justify== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
The text editor within LimeSurvey is able to format RTL text. However, the editor itself shows the RTL language in a left to right format when justified. This is just an editor display issue. The RTL and justified question or text will display correctly from right to left, even when justified, in your survey or on preview.&lt;br /&gt;
&lt;br /&gt;
==Keywords== &amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:309--&amp;gt;&lt;br /&gt;
{{Deprecated|3.0}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
Keywords within a template file get replaced by the current survey information. They are surrounded by curly brackets, for example: {SURVEYNAME}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
The following strings will be replaced by LimeSurvey when parsing the template file and presenting it to survey users. These field strings will work on almost every template except for the &#039;Completed Page&#039;. (Most of these strings can be found in the common.php file. If it&#039;s not there, look in the index.php file.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!&#039;&#039;&#039;Keyword&#039;&#039;&#039;!!&#039;&#039;&#039;Template files&#039;&#039;&#039;!!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYNAME}||All Files||The survey title&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYDESCRIPTION}||All Files||The survey description&lt;br /&gt;
|-&lt;br /&gt;
|{WELCOME}||All files (mainly for welcome.pstpl)||The survey &#039;welcome&#039; text&lt;br /&gt;
|-&lt;br /&gt;
|{PERCENTCOMPLETE}||survey.pstpl||A small graph showing the percentage of the survey completed&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPNAME}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group name&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPDESCRIPTION}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group description&lt;br /&gt;
|-&lt;br /&gt;
|{NUMBEROFQUESTIONS}||welcome.pstpl||Displays the total number of questions in the survey (just the number)&lt;br /&gt;
|-&lt;br /&gt;
|{THEREAREXQUESTIONS}||welcome.pstpl||Displays the sentence &amp;quot;There are X questions in this survey&amp;quot; - from the relevant language file. The X is replaced with the number of questions. Note that this will also work appropriately for singular or plural. If there is only 1 question, it will print &amp;quot;There is 1 question in this survey&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|{CHECKJAVASCRIPT}||All files (mainly for welcome.pstpl)||Warning message when end-user browser have javascript disabled&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION}||Question.pstpl||(&#039;&#039;&#039;Has been superseeded as of LS1.87&#039;&#039;&#039;) Displays the current question text (The format of {QUESTION} can customised by editing &#039;question_start.pstpl&#039;) Use the following: {QUESTION_TEXT}, {QUESTION_MANDATORY}, {QUESTION_HELP}, {QUESTION_MAN_MESSAGE}, {QUESTION_VALID_MESSAGE}, {QUESTION_INPUT_ERROR_CLASS}, and appropriate wrapping HTML instead of {QUESTION}&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWER}||question.pstpl, print_question.pstpl||presents the answer form for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{SGQ}||question.pstpl, question text||Can be used in the question text itself to reference the input field of the question dynamically by displaying the Survey-Group-Question id for the current question. (as of svn build 9755)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTIONHELP}||question.pstpl, print_question.pstpl||Displays help text (predefined tip for question type) for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CLASS}||question.pstpl, print_question.pstpl||unique class for each question type. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CODE}||question.pstpl, print_question.pstpl||Displays the current question code&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ESSENTIALS}||question.pstpl||the question ID and (if a question is conditional), &#039;style=&amp;quot;display:none;&amp;quot;&#039;. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_HELP}||question.pstp, question_start.pstpl||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TYPE_HELP}||print_question.pstp||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_INPUT_ERROR_CLASS}||question.pstp, question_start.pstpl||Provides a class if there was user input error&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ID}||print_question.pstp||Provides a unique ID for each question to allow styling for specific questions&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TEXT}||question.pstp, print_question.pstp, question_start.pstpl||Displays the text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MANDATORY}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_CLASS}||question.pstpl, print_question.pstpl||class if a question is mandatory. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_NUMBER}||print_question.pstpl||Incremental count of questions.&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_VALID_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated valid help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_SCENARIO}||print_question.pstp||Prints out the &#039;scenario&#039; text for conditional questions.&lt;br /&gt;
|-&lt;br /&gt;
|{NAVIGATOR}||navigator.pstpl||Displays navigation buttons (next, prev, last)&lt;br /&gt;
|-&lt;br /&gt;
|{CLEARALL}||All files (but intended for navigator.pstpl)||Displays the &amp;quot;Exit and Clear Results&amp;quot; link&lt;br /&gt;
|-&lt;br /&gt;
|{COMPLETED}||completed.pstpl||Displays the &#039;completed&#039; message for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{URL}||completed.pstpl||Displays the survey &#039;url&#039; and &#039;url text&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{PRIVACYMESSAGE}||privacy.pstpl||The privacy message is shown if you set your survey to be anonymous. [[Translating LimeSurvey|The text can be edited/translated]] in the language files. This can also be changed manually by editing the privacy.pstpl template you wish to use.&lt;br /&gt;
|-&lt;br /&gt;
|{TEMPLATEURL}||All Files||The URL to the current template location (useful for referencing image files in your template)&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYRESOURCESURL}||All Files||The URL to the current uploaded files for this survey location (useful for referencing image files in your question, group, ....)&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITCOMPLETE}||endpage.pstpl||The statement (from the language files) that tells the user they have completed the survey, and to press the &amp;quot;Submit&amp;quot; button&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITREVIEW}||survey.pstpl||The statement (from the language files) that tells the user they can review/change the answers they have made by clicking &amp;quot;&amp;lt;&amp;lt; prev&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{SAVEDID}||All Files||Displays &#039;Response ID&#039; of user&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|{QUEXMLPDF}||All Files||Displays button to export the queXML PDF of questionnaire including answers entered up until the point that has been completed in the survey.&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:FIRSTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users first name from the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:LASTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users last name from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:EMAIL}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users email from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_1}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_1 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_2}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_2 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWERSCLEARED}||Preferably in navigator.pstpl||The &amp;quot;Answers Cleared&amp;quot; statement from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{RESTART}||clearall.pstpl||URL to restart the survey&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERERROR}||register.pstpl||Shows any error messages in the register page (ie: &amp;quot;You must include an email address&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE1}||register.pstpl||The statement &amp;quot;You must be registered to complete this survey&amp;quot; from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE2}||register.pstpl||Details about registering from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERFORM}||register.pstpl||The actual form for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{SAVE}||Works suitable on navigator.pstpl||Displays the &#039;Save your responses so far&#039; button to offer the user to save and come back later to continue the survey. If the Save option is deactivated in the survey properties the tag will not be shown and ignored.&lt;br /&gt;
|-&lt;br /&gt;
|{LANGUAGECHANGER}||survey.pstpl||Displays a switch in multilingual surveys to change the question.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Input/Buttons== &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
Each &amp;quot;input&amp;quot; type in a survey has been given its own class name, so that you can add CSS to your &amp;quot;startpage.pstpl&amp;quot; file and have some control over the appearance of form buttons and inputs. These class names are as follows:&lt;br /&gt;
*&#039;&#039;&#039;submit&#039;&#039;&#039; (Submit Buttons)&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; (Text Inputs - for short free text, date, and numerical type)&lt;br /&gt;
*&#039;&#039;&#039;answertext&#039;&#039;&#039; (Text of answers)&lt;br /&gt;
*&#039;&#039;&#039;radio&#039;&#039;&#039; (Radio Buttons)&lt;br /&gt;
*&#039;&#039;&#039;checkbox&#039;&#039;&#039; (Check Boxes)&lt;br /&gt;
*&#039;&#039;&#039;select&#039;&#039;&#039; (Select / List Boxes)&lt;br /&gt;
*&#039;&#039;&#039;textarea&#039;&#039;&#039; (Large text inputs - for long free text)&lt;br /&gt;
*&#039;&#039;&#039;clearall&#039;&#039;&#039; (The &amp;quot;Exit and Clear Survey&amp;quot; link)&lt;br /&gt;
*&#039;&#039;&#039;rank&#039;&#039;&#039; (The rank style question. Doesn&#039;t set the colour of the select box or the text boxes, but it does allow the changing of background colour, text colour, size etc., for the rest of the ranking question)&lt;br /&gt;
*&#039;&#039;&#039;graph&#039;&#039;&#039; (The &amp;quot;percentage completed&amp;quot; graph table)&lt;br /&gt;
*&#039;&#039;&#039;innergraph&#039;&#039;&#039; (The table inside the graph table - this contains the 0% and 100% text. Use this for changing the size of this text)&lt;br /&gt;
*&#039;&#039;&#039;question&#039;&#039;&#039; (General settings for any question that is displayed within a table. Generally, you should use this to make sure that their font size and color is the same as you have used elsewhere as a default)&lt;br /&gt;
*&#039;&#039;&#039;mandatory&#039;&#039;&#039;  (Mandatory questions)&lt;br /&gt;
*&#039;&#039;&#039;input-error&#039;&#039;&#039; (User input error - for if a user has made a mistake with a mandatory question or question with validation)&lt;br /&gt;
*&#039;&#039;&#039;array1&#039;&#039;&#039; and &#039;&#039;&#039;array2&#039;&#039;&#039; (These two styles are cycled when presenting the range of answers for an array type question. This allows you to set an alternating background color for these question types. &#039;&#039;&#039;Array1&#039;&#039;&#039; is also used for the column headings in these question types)&lt;br /&gt;
*&#039;&#039;&#039;errormandatory&#039;&#039;&#039; (Sets the color and style of the &amp;quot;This question is mandatory&amp;quot; error message)&lt;br /&gt;
*&#039;&#039;&#039;warningjs&#039;&#039;&#039; (Sets the color and style of the warning message displayed if the participant&#039;s browser has javascript disabled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
There are also some elements that can be accessed using the ID of the element (&#039;&#039;&#039;#ID&#039;&#039;&#039; in CSS):&lt;br /&gt;
*&#039;&#039;&#039;surveycontact&#039;&#039;&#039; (The contact message shown on the start page)&lt;br /&gt;
*&#039;&#039;&#039;tokenmessage&#039;&#039;&#039; (used for messages inside the survey, e.g. the session expired error message)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
Because you can edit all the HTML aspects, there&#039;s no reason to surround your templates with a &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&#039;new_name&#039;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and then define a css for that new_name class.&lt;br /&gt;
&lt;br /&gt;
==Styling the progress bar== &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
The progress bar appearance can be modified with CSS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
To change the background color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-header {&lt;br /&gt;
 background-color: #3300FF;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
To change the border color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-content,&lt;br /&gt;
#progress-wrapper .ui-widget-header {&lt;br /&gt;
 border: 1px solid #FF0000;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Features Available to Developers== &amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
LimeSurvey has integrated some user-made patches that permits some special changes. These very advanced features (generally) require changes to the underlying code base of LimeSurvey and should be done carefully in order not to introduce security holes.&lt;br /&gt;
&lt;br /&gt;
===Support for your own Javascript functions=== &amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Some users may need to run Javascript on the survey pages, but calling &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; in the BODY element made it impossible to do so. This call has been replaced with a small JavaScript function in the HEAD that sniffs for the existence of &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; and &#039;&#039;&#039;template_onload()&#039;&#039;&#039; before calling them. In this way, a template author can create his or her own &#039;&#039;&#039;template_onload()&#039;&#039;&#039; function in the HEAD that replaces the default one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
*Disable XSS filter - in Global settings -&amp;gt; Security, set &amp;quot;Filter HTML for XSS&amp;quot; to No.&lt;br /&gt;
*Enter your script in the source of a question or group description.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:301--&amp;gt;&lt;br /&gt;
{{Note|For further details, see the [[Workarounds: Manipulating a survey at runtime using Javascript#How to use Script (eg. JavaScript etc.) in LimeSurvey|workaround section]].}}&lt;br /&gt;
&lt;br /&gt;
=Videos on Templates= &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
This video will demonstrate the basic and advanced template functions that are available to all LimeSurvey users. This includes changing the appearance of certain forms and inserting custom graphics. Additionally, it will thoroughly walk you through on how to edit and preview specific page templates, importing/exporting templates, modify appearance of questions in the CSS, and customizing survey description page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:302--&amp;gt;&lt;br /&gt;
Video - needed&lt;br /&gt;
&lt;br /&gt;
=Tips &amp;amp; Tricks= &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some language specific element== &amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
If you want to have some language specific sentence in a survey, for example a help at the end of each page, you can add in a .pstl file a sentence and hidding it for other language. If we hide it in the template.css, we can use the pseudo selector :lang, but we use some class for better compatibility.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
Below, there are two help sentences, in French and English. Put this on endpage.pstpl:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;fr&amp;quot; lang=&amp;quot;fr&amp;quot;&amp;gt;Pour de l&#039;aide en direct appelez le 000000&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;For some help, please call 000000&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
and in template.css:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:152--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.lang-fr .en{display:none}&lt;br /&gt;
.lang-en .fr{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change the layout of the survey page== &amp;lt;!--T:155--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:156--&amp;gt;&lt;br /&gt;
After editing and saving a template, it applies to a survey list page only if it is selected from the settings of the survey. To make it the default template, go under the &#039;&#039;&#039;General tab&#039;&#039;&#039; located in the &#039;&#039;&#039;Global settings&#039;&#039;&#039; of your LimeSurvey installation and choose the desired template. From now on, all the templates that use the &amp;quot;default&amp;quot; option as template plus the ones that are going to be newly created, will use the newly selected default template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
To use your current template for this page, you have to change the according setting from &#039;&#039;&#039;Global settings&#039;&#039;&#039;. In older versions, this change can be done by editing the $defaulttemplate setting from the config file: copy this setting from config-defaults.php to config.php which overrides config-defaults.php and edit this setting to &amp;lt;code lang=&amp;quot;html&amp;quot;&amp;gt;$defaulttemplate = &#039;yourtemplatename&#039;;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Import/Export of templates: Mac users== &amp;lt;!--T:158--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;Mac users&amp;lt;/u&amp;gt;, please note that the Mac OSX default archive utility may have problems with zip folders &amp;quot;generated on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:160--&amp;gt;&lt;br /&gt;
A workaround is to unix&#039;es unzip from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
$ unzip template.zip -d template&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:162--&amp;gt;&lt;br /&gt;
Archive: template.zip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
 inflating: template/startpage&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:164--&amp;gt;&lt;br /&gt;
 inflating: ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
Another workaround is to use scripts in their mac-compiled counterparts.&lt;br /&gt;
&lt;br /&gt;
==Replacing the help icon {{ObsoleteIn|2.50}} == &amp;lt;!--T:173--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:174--&amp;gt;&lt;br /&gt;
When a question help text is shown, then an help.gif image is used from the default template folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
You can replace this image by uploading a new help.gif, help.png or help.jpg in your custom template folder. It will then be automatically used instead of the default help icon.&lt;br /&gt;
&lt;br /&gt;
==Replacing an existing logo {{NewIn|2.50}} {{ObsoleteIn|3.0}}== &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:177--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In the &#039;&#039;&#039;default&#039;&#039; Template of 2.50, there is no preembedded logo. Read further our [[#Adding_your_own_logo |wiki on how to add your own logo]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
1. To edit the logo go to the &#039;&#039;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&#039;&#039; file which you can find it here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:179--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t1.PNG|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
2. Click the search button to find occurrences of logo related styles and search for &#039;&#039;logo&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:181--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:2.png|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
4. Edit the main style file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:185--&amp;gt;&lt;br /&gt;
You will see something similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t4.PNG|500px]]&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:187--&amp;gt;&lt;br /&gt;
If you want to change the image, just replace logo.gif with another image link. Example: (&amp;lt;u&amp;gt;logo.png&amp;lt;/u&amp;gt; or &amp;lt;u&amp;gt;logo.jpg&amp;lt;/u&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:188--&amp;gt;&lt;br /&gt;
If you want to change the image size, adjust width and height (in pixels) like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;width:100px; height:100px;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo {{ObsoleteIn|3.0}} == &amp;lt;!--T:190--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
1. Find and open the &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; template file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:192--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:startpage.pstpl.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
2. After this&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; &amp;gt;&amp;lt;div id=&amp;quot;topContainer&amp;quot; class=&amp;quot;jumbotron&amp;quot;&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
add this line to &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;img id=&#039;page_logo&#039; src=&#039;{TEMPLATEURL}/files/logo.png&#039; class=&amp;quot;clearfix pull-right&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
3. To upload your own logo, go to the template editor and upload your logo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:197--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:uploadyourlogo.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:199--&amp;gt;&lt;br /&gt;
To position your logo, please use one of the following css classes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:293--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the left side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:200--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-left&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:204--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the right side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:205--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-right&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:208--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want to center the logo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:209--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix center-block&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the same template with different logos== &amp;lt;!--T:214--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:215--&amp;gt;&lt;br /&gt;
If you want to use the same template for all surveys and just want to change the logo for each survey, you can use the {SID} placeholder in the template .pstpl file and thereby refer to different images:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:216--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;{TEMPLATEURL}files/logoImage-{SID}.png&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the default help to all question (hide_tip) {{ObsoleteIn|1.92}}== &amp;lt;!--T:217--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:218--&amp;gt;&lt;br /&gt;
There are 3 solutions to remove the default help:&lt;br /&gt;
# like a hide_tip attribute but for all question and survey.&lt;br /&gt;
# you can remove the {QUESTIONHELP} and its container from the file question.pstl. However, it can be a bad idea for the screenreader.&lt;br /&gt;
# for the default template and some other, add this at the end of tempate.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:219--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;span.questionhelp{display:none;}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display custom favicon== &amp;lt;!--T:220--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:221--&amp;gt;&lt;br /&gt;
A favicon is the little icon you see in the browser&#039;s address bar, list of bookmarks or tab. You can display your own icon as follows:&lt;br /&gt;
#Create a favicon - google will find you lots of free favicon generators.&lt;br /&gt;
#Name your new favicon &amp;quot;favicon.ico&amp;quot; and place it in your template /files directory.&lt;br /&gt;
#Add the following code to your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; before the &amp;lt;/head&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:222--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Different appearance for survey-/question-pages== &amp;lt;!--T:224--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:226--&amp;gt;&lt;br /&gt;
If you want LimeSurvey to change the appearance of every second page (i.e. of even and odd survey pages), you can use &#039;&#039;&#039;.page-odd&#039;&#039;&#039; class in your CSS file to change the appearance of odd pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:227--&amp;gt;&lt;br /&gt;
An example from default template of LimeSurvey 1.91+:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:228--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.page-odd table.question-group {&lt;br /&gt;
 background-color: #D2F2D3;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:232--&amp;gt;&lt;br /&gt;
If you do &#039;&#039;&#039;not&#039;&#039;&#039; want differentiate even and odd pages, find all instances of &#039;&#039;.page-odd&#039;&#039; in template.css and remove those styles.&lt;br /&gt;
&lt;br /&gt;
==Create a vertical separator  border for dual scale array== &amp;lt;!--T:233--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:234--&amp;gt;&lt;br /&gt;
To create a vertical separator border for a dual scale array, you can add the following lines to your &#039;&#039;&#039;template.css&#039;&#039;&#039;-file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:235--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
table.question thead td.header_separator,&lt;br /&gt;
table.question tbody td.dual_scale_separator&lt;br /&gt;
{&lt;br /&gt;
   border-right:solid 1px #00A8E1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:242--&amp;gt;&lt;br /&gt;
&#039;&#039;header_separator&#039;&#039; is used to adress the separator for the header &amp;quot;td&amp;quot;. The &amp;quot;dual_scale_separator&amp;quot; is used to address the separator column in the dual scale array.&lt;br /&gt;
&lt;br /&gt;
==Hide the survey contact message shown on the start page/survey list {{ObsoleteIn|3.0}} == &amp;lt;!--T:243--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:244--&amp;gt;&lt;br /&gt;
To hide the &amp;quot;Please contact ...&amp;quot; message on the start page (with the survey list), you can add the following to the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.js&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:245--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:246--&amp;gt;&lt;br /&gt;
$(&#039;#surveycontact&#039;).hide(); //Hides the survey contact message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:247--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the survey contact message shown on error messages {{ObsoleteIn|3.0}}== &amp;lt;!--T:248--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:249--&amp;gt;&lt;br /&gt;
If you want to remove the survey contact message from error messages, it&#039;ll be trickier. You can add the function from below. It calls the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.css&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:250--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
removeContactAdressFromMessage(); //Removes the survey contact message from error messages&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:253--&amp;gt;&lt;br /&gt;
and add the following function to your *template.js* file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:254--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
function removeContactAdressFromMessage()&lt;br /&gt;
{&lt;br /&gt;
if ($(&#039;#tokenmessage&#039;).length &amp;gt; 0)&lt;br /&gt;
   {&lt;br /&gt;
   var oldMessage = $(&#039;#tokenmessage&#039;).html();&lt;br /&gt;
   var indexContact = oldMessage.indexOf(&#039;Bitte kontaktieren&#039;);&lt;br /&gt;
   var newMessage = oldMessage.substr(0, indexContact);&lt;br /&gt;
   $(&#039;#tokenmessage&#039;).html(newMessage);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:266--&amp;gt;&lt;br /&gt;
It will probably not work for a survey in English language and has to be extended when used for multilingual surveys. But it&#039;s an idea/tip on how to solve this.&lt;br /&gt;
&lt;br /&gt;
==How to deal with multilingual question attributes {{ObsoleteIn|2.50}}== &amp;lt;!--T:267--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:268--&amp;gt;&lt;br /&gt;
If you have a multilingual survey and e. g. want to use a different string for the &amp;quot;other&amp;quot; field, this could only be done for the base language (until this feature was added at LimeSurvey 2.0). To work around this, paste in the field to change the label for &amp;quot;other&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:269--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;en&amp;quot;&amp;gt;New label&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;fr&amp;quot;&amp;gt;Nouveau label&amp;lt;/span&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:270--&amp;gt;&lt;br /&gt;
Add in the template.css of your template (at &#039;&#039;/limesurvey/upload/templates/&amp;lt;yourtemplatename&amp;gt;/template.css&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:271--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;html:lang(en) .fr{display:none}&lt;br /&gt;
html:lang(fr) .en{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo to the survey list {{ NewIn|3.0}} == &amp;lt;!--T:310--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:311--&amp;gt;&lt;br /&gt;
# First please open the theme editor for the theme you like to use. [[File:OpenThemeEditor.jpg]]&lt;br /&gt;
# We recommend to use fruity, it is our best theme currently. &lt;br /&gt;
# Then extend the theme and give it a name you will recognize. [[File:ExtendTheme.jpg]]&lt;br /&gt;
# In the following view you may upload the logo you want to use. [[File:UploadFileTheme.jpg]]&lt;br /&gt;
# Select the editor screen `Survey List´ in the Screen dropdown in the top right corner. [[File:OpenScreenSurveyList.jpg]]&lt;br /&gt;
# Then select `layout_survey_list.twig´ in the left side menu. [[File:EditLayoutSurveyListTwig.jpg]]&lt;br /&gt;
# In the editor scroll to line 126 and change the marked part to the filename of the image you uploaded to the theme before. [[File:ChangeSurveyListHeaderImageEditor.jpg]]&lt;br /&gt;
# Save your file. [[File:ThemeEditorSaveChanges.jpg]]&lt;br /&gt;
# Change default theme to your extended theme. [[File:ChangeDefaultTheme.jpg]]&lt;br /&gt;
&lt;br /&gt;
=Custom Question Views {{NewIn|3.0}}= &amp;lt;!--T:289--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:290--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; This is a temporary feature to be replaced in the future by question object (it will be very easy to move custom views to question object). It is disabled by default.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:291--&amp;gt;&lt;br /&gt;
As of version 2.5, you can create template-specific custom views for questions and some of their incorporated elements. This is useful if you want to modify the HTML layout of a particular question type for one or more surveys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:292--&amp;gt;&lt;br /&gt;
*In application/config/config.php, find &#039;config&#039;=&amp;gt;array and add this line to the array : &#039;allow_templates_to_overwrite_views&#039;=&amp;gt;1&lt;br /&gt;
*In /{your_template}/config.xml, set &amp;quot;overwrite_question_views&amp;quot; to true&lt;br /&gt;
*Copy application/views/survey/* to template/{your_view_directory}/survey/&lt;br /&gt;
*Note that you only need to copy the files that you intend to modify but the file structure must remain the same as in application/views/survey/&lt;br /&gt;
&lt;br /&gt;
=Insert Custom CSS or JavaScript files for template {{NewIn|2.50}}= &amp;lt;!--T:296--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:303--&amp;gt;&lt;br /&gt;
As of version 2.50, you can use the config.xml file to automatically load plugin files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:304--&amp;gt;&lt;br /&gt;
*Upload your files to the template /css or /scripts folder&lt;br /&gt;
*In /{your_template}/config.xml, add the file paths to the &amp;lt;css&amp;gt; or &amp;lt;js&amp;gt; blocks, something like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;css&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/jquery-ui-custom.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/bootstrap-slider.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:305--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/flat_and_modern.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:306--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/template.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:307--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/myCustomPlugin.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;js&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/template.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/bootstrap-slider.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:308--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;scripts/myCustomPlugin.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/js&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95834</id>
		<title>Theme editor</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95834"/>
		<updated>2018-04-04T10:17:30Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt; &amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
LimeSurvey has an advanced theme and style system providing to developers an efficient way to customize the survey appearance. Since LS3, we&#039;re not speaking anymore about &#039;&#039;&#039;&amp;quot;templates&amp;quot;&#039;&#039;&#039; like in previous versions, but about &#039;&#039;&#039;&amp;quot;themes&amp;quot;&#039;&#039;&#039;. The &#039;&#039;&#039;themes&#039;&#039;&#039; allow control over the look and feel of pages during a survey. A survey administrator can select a default theme that will be used for each survey to further personalize it and improve its look and feel. &#039;&#039;&#039;Themes&#039;&#039;&#039;  come with options that provide to admin without coding skill a simple way to add a logo on the welcome page, to change the background colors, to select a font, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
LimeSurvey comes with 3 themes right out of the box. These initial themes are defined by directories located in the LimeSurvey installation &amp;quot;themes/survey/&amp;quot; directory. Each theme has it&#039;s own directory. Within the main directory of a theme you&#039;ll find a configuration file in XML, and numerous directories containing the views &#039;&#039;themes (.twig)&#039;&#039;&#039;, &#039;&#039;&#039;cascading style sheets (.css)&#039;&#039;&#039;, &#039;&#039;&#039;scripts&#039;&#039;&#039;,  &#039;&#039;&#039;images&#039;&#039;&#039; (&#039;&#039;&#039;.jpg&#039;&#039;&#039; or &#039;&#039;&#039;.png&#039;&#039;&#039;), and maybe others. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Since LimeSurvey 2.50, the theme engine use [http://getbootstrap.com/docs/3.3/ Bootstrap 3]  as CSS framework. Bootstrap 3 being a standard framework, developers will find a lot of documentation, tutorials and forum threads about it on Internet. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since LimeSurvey 3, the theme engine use [https://twig.symfony.com Twig], so the theme developers can change the logic of the survey rendering in a safe and easy way. Twig replace the old system of replacement keywords that was used in the previous versions. The logic that was used to generate the HTML of the keywords are now available inside the theme&#039;s views. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Snippet from Vanilla Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;twig&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.answercontainer }} col-xs-12&amp;quot; {{ aSurveyInfo.attr.answercontainer }}&amp;gt;&lt;br /&gt;
    {# NOTE: If you want to customize the question rendering, use a question theme #}&lt;br /&gt;
    {{ aQuestion.answer | raw }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
One gets a result that looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:278--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;div style=&#039;text-align: center;&#039;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;My New Survey&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&#039;text-align: center;&#039;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;This is a survey written by me to find out what sort of chocolate people like.&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Templates, being HTML code, tend to define the positioning and type of text to be displayed and similar structural features of the page. They often reference or include other files. Most of them reference a common cascading style sheets (CSS) file that defines the font style, color, size, background, and similar parameters common to all pages in the survey. Style sheets reference HTML &#039;&#039;&#039;class&#039;&#039;&#039; parameters that are associated with the various types of objects in the HTML code. This allows the style sheet to describe how to display each of the many types of text or other objects that may appear in multiple places. There are unique classes for each question type in LimeSurvey and thus giving detailed control over the appearance of each. Image files, like logos or special progress-bar constructors, may be referenced as well in the Template file. Finally, special keywords in curly braces are replaced with text defined in the survey for each language translation correspondent (for example, the &#039;Survey Title&#039; or &#039;Question Text&#039; for each language defined).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
If you create a new custom template, please consider contributing it back to the LimeSurvey community and make it available to others. With your help, we can grow our repository of templates, surveys, and other add-ons to make LimeSurvey even better! &lt;br /&gt;
See our [https://www.limesurvey.org/index.php?option=com_sobipro&amp;amp;sid=55:Templates&amp;amp;Itemid=729 LimeSurvey template repository] where you can share your templates.&lt;br /&gt;
&lt;br /&gt;
=Creating a new template= &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To be able to create a new template (or edit an existing template), you need [[Manage users#Set global permissions for a user|Template Editing user permission]] in LimeSurvey as well as permission to manipulate the files in the underlying operating system hosting your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;Note of Warning:&#039;&#039;&#039;&amp;lt;/span&amp;gt; If you change templates, you could also affect all the pre-existing surveys from your LimeSurvey installation. Templates are an advanced feature that require experience and HTML knowledge in order to make them running smoothly.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
The preferred way to create a new template is through the &#039;&#039;&#039;Template Editor&#039;&#039;&#039; (see below), which is located in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; dialog. Some people may like to work directly with template files so that they can use their favorite text editor instead of the web interface. In this case, still use the Template Editor to first create your new template. This will create a new base template with all the files you need in the &#039;&#039;LimeSurvey_web_root/upload/templates/your_new_template&#039;&#039; directory. From there you can use your text editor to manually adjust the template files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; on unix/linux systems, these template files will be owned by the group and user where the web server is running (may be &amp;quot;www&amp;quot; for some systems). So, make sure you have enough access to edit these files, When you save them, make sure they don&#039;t change ownership! In this way, you can still use the web Template Editing interface if needed.&amp;lt;/div&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A number of &#039;public&#039; elements of LimeSurvey can be adjusted by a series of templates. The next section provides a very brief explanation of these templates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
{{Note|Template files may seem complex. Besides HTML, you might also need to understand CSS.}}&lt;br /&gt;
&lt;br /&gt;
=The LimeSurvey template editor= &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
To ease the understanding and quick update of a Template, LimeSurvey provides a &#039;&#039;&#039;Template Editor&#039;&#039;&#039; in the main &#039;&#039;&#039;administrative&#039;&#039;&#039; toolbar of the application. This Template Editor is only available to users [[Manage users#Set global permissions for a user|with the Templates permission]] and to superadministrators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:297--&amp;gt;&lt;br /&gt;
{{Alert|title=Attention|text=A template that is not correctly constructed can render a survey (that uses the respective template) inoperable. }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
The LimeSurvey template editor allows you to edit the contents of your templates online. Start the Template Editor by clicking on &#039;&#039;&#039;Template editor&#039;&#039;&#039; in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; menu. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:285--&amp;gt;&lt;br /&gt;
[[File:templates.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:286--&amp;gt;&lt;br /&gt;
The template editor page allows you to select the template you would like to edit/view. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:279--&amp;gt;&lt;br /&gt;
[[File:Template-editor-2013-7-10_11_38_16.png|center]]&lt;br /&gt;
&lt;br /&gt;
==The template menu== &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:298--&amp;gt;&lt;br /&gt;
The following options are available:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:280--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Create&#039;&#039;&#039;: Allows you to create a new template. In order not to start from scratch, the template &#039;default&#039; is copied.&lt;br /&gt;
*&#039;&#039;&#039;Import&#039;&#039;&#039;: Allows you to import a template from a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Export&#039;&#039;&#039;: Allows you to export the current template to a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Copy&#039;&#039;&#039;: Allows you to make a new template by copying the current one.&lt;br /&gt;
*&#039;&#039;&#039;Rename&#039;&#039;&#039;: Allows you to change the name of the template. It is generally used after copying or importing a template.&lt;br /&gt;
*&#039;&#039;&#039;Template&#039;&#039;&#039;: It is a drop-down list that shows all the available templates that are located in your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Screen&#039;&#039;&#039;: It is a drop-down list which allows you to choose which particular survey page of that template you want to look at.&lt;br /&gt;
*&#039;&#039;&#039;Return to admin panel&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Import/export/copy a template== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
When you &#039;&#039;&#039;export &#039;&#039;&#039;a template, a ZIP-file archive with all the files your template consists of will be created (.pstpl files, images, css files, ...). You can simply &#039;&#039;&#039;import&#039;&#039;&#039; the exported zip-file into another LimeSurvey installation by using the import feature or you can manually copy the archive into another LimeSurvey installation and extract it into the corresponding [[Theme editor#Template files location|template directory there]]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:288--&amp;gt;&lt;br /&gt;
However, it is preferred to use the LimeSurvey template import/export/copy functions in the template editor.&lt;br /&gt;
&lt;br /&gt;
==Page Structure / Template Use== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;The Welcome Page:&#039;&#039;&#039; startpage.pstpl, welcome.pstpl, privacy.pstpl,  navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Questions Pages:&#039;&#039;&#039; startpage.pstpl, survey.pstpl, startgroup.pstpl, groupdescription.pstpl, question.pstpl, endgroup.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Final Page:&#039;&#039;&#039; startpage.pstpl, assessment.pstpl, completed.pstpl, endpage.pstpl&lt;br /&gt;
&lt;br /&gt;
==Template Files== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The following template files are used to produce your public survey and must exist in any new template folder you create:&lt;br /&gt;
*&#039;&#039;&#039;startpage.pstpl:&#039;&#039;&#039; Produces the start of each html page. It starts at the &amp;quot;&amp;lt;head&amp;gt;&amp;quot; tag, and should not contain the &amp;quot;&amp;lt;html&amp;gt;&amp;quot; tag. This &#039;very beginning&#039; of a standard html page is written by the scripts. Please ensure that your startpage.pstpl files contains a &amp;lt;body&amp;gt; tag. Even though many browsers do not require strict adherence to the W3 HTML standards, the LimeSurvey script needs to find a &amp;lt;body&amp;gt; tag to run certain javascript elements. It is not expected to see many &#039;keywords&#039; used in the startpage.pstpl file. However, you may wish to put the {SURVEYNAME} into the title. The startpage.pstpl file can contain code that ends in the corresponding endpage.pstpl file. For example, you can start a table in this file and close the table in the endpage.pstpl file. The startpage.pstpl and endpage.pstpl files wrap around every possible page used by LimeSurvey.&lt;br /&gt;
*&#039;&#039;&#039;survey.pstpl:&#039;&#039;&#039; This template is the second used on most pages and provides a space to put the survey name and description. This template does not have a corresponding &#039;closing&#039; template, and subsequently you should close all tags opened in this template file (i.e.: don&#039;t leave a table open here because there is nowhere else to close it).&lt;br /&gt;
*&#039;&#039;&#039;welcome.pstpl:&#039;&#039;&#039; This template is only used in the welcome screen (which is also on the main page for &#039;all in one&#039; surveys). You can use this to print out the welcome text, and other information that should be provided in the introduction. Like the &#039;survey.pstpl&#039; file, there is no corresponding &#039;closing&#039; template, so all tags opened in this template file should be closed as well.&lt;br /&gt;
*&#039;&#039;&#039;startgroup.pstpl:&#039;&#039;&#039; This template can provide a &#039;summary&#039; wrap around for questions within a group. It has a matching &#039;endgroup.pstpl&#039; template that can be used to close any opened tags in this file, so you can open a table within this.&lt;br /&gt;
*&#039;&#039;&#039;groupdescription.pstpl:&#039;&#039;&#039; This template file is used to display a description of a group. Please note that in the survey settings (access the &#039;&#039;Presentation &amp;amp; navigation settings&#039;&#039; by clicking on the &#039;&#039;&#039;Presentation&#039;&#039;&#039; tab) you can set if the group description should be shown or not. If not, then this file is not included at all.&lt;br /&gt;
*&#039;&#039;&#039;question.pstpl:&#039;&#039;&#039; This file contains the question, answer, and help text sections of your survey. In the &amp;quot;group by group&amp;quot; and &amp;quot;all in one&amp;quot; surveys, this template is cycled repeatedly with each question. There is no corresponding closing file for this and all tags should be closed.&lt;br /&gt;
*&#039;&#039;&#039;question_start.pstpl:&#039;&#039;&#039; This file contains the individual elements found at the start of a question. It is included within &#039;question.pstpl&#039; via the {QUESTION} keyword. It is intended to allow template designers more control over the layout of a question. This template sits outside the normal templating system and &#039;&#039;&#039;was superseeded (as of LimeSurvey 1.87)&#039;&#039;&#039;. All keywords from this template are now available directly in question.pstpl. &lt;br /&gt;
*&#039;&#039;&#039;completed.pstpl:&#039;&#039;&#039; This page is displayed as the final page when the survey responses have been saved and the survey is over. It can be used to display a &amp;quot;forwarding link&amp;quot; as set in the survey setup.&lt;br /&gt;
*&#039;&#039;&#039;endgroup.pstpl:&#039;&#039;&#039; This file closes the group, and can be used to close off any tags opened in the startgroup.pstpl file&lt;br /&gt;
*&#039;&#039;&#039;navigator.pstpl:&#039;&#039;&#039; This file contains the buttons that navigate through the survey, &amp;quot;next&amp;quot;, &amp;quot;prev&amp;quot;, &amp;quot;last&amp;quot;, &amp;quot;submit&amp;quot;, &amp;quot;save so far&amp;quot;  and the &amp;quot;clear all&amp;quot; link. It is used in all pages except the completed page.&lt;br /&gt;
*&#039;&#039;&#039;printanswers.pstpl:&#039;&#039;&#039; This file has the HTML wrapper necessary for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_group.pstpl:&#039;&#039;&#039; This file is the same as startgroup.pstpl and endgroup.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_question.pstpl:&#039;&#039;&#039; This file is the same as question.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_survey.pstpl:&#039;&#039;&#039; This file is the same as survey.pstpl, but for the print version of the survey.&lt;br /&gt;
&lt;br /&gt;
== CSS and Javascript== &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
Two files that are always used in a template are template.css (for CSS) and template.js (for Javascript).&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATECSS}:&#039;&#039;&#039; Add lines for default css, template.css, and template-rtl.css for rtl language.&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATEJS}:&#039;&#039;&#039; Add lines for default javascript files, template.js, and all js files needed for LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
=== Using Bootstrap=== &amp;lt;!--T:294--&amp;gt;&lt;br /&gt;
LimeSurvey has Bootstrap 3 embedded, so you can style all your templates with the well documented Bootstrap classes.&lt;br /&gt;
For more information please refer to the [https://getbootstrap.com Bootstrap documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:295--&amp;gt;&lt;br /&gt;
The [https://github.com/flatlogic/awesome-bootstrap-checkbox Awesome-Bootstrap-Checkbox] plugin is also included. With it, you can use the typical Bootstrap color-classes (info,warning,danger,etc.) also with the suffix &amp;quot;-checkbox&amp;quot; or &amp;quot;-radio&amp;quot;, though styling checkboxes and radios as you prefer.&lt;br /&gt;
&lt;br /&gt;
=== Replacing default CSS or Javascript=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Some questions use specific files for Javascript or CSS. If you need to replace a function, use a cascading system. For javascript function, the last function read is the function used.&lt;br /&gt;
&lt;br /&gt;
==Other Template Files== &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The &#039;&#039;&#039;privacy.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;invitationemail.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;reminderemail.pstpl&#039;&#039;&#039;, and &#039;&#039;&#039;confirmationemail.pstpl&#039;&#039;&#039; are no longer used by LimeSurvey and defaults are instead set in the applicable language files. The email messages can now be edited on a survey by survey basis.&lt;br /&gt;
&lt;br /&gt;
==Standard Pages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
There are ten standard pages that a survey participant may see in the course of taking or accessing the LimeSurvey application.  Each is constructed from a number of common &#039;&#039;&#039;Template&#039;&#039;&#039; files from the &#039;&#039;&#039;Template&#039;&#039;&#039; specified in the settings of the survey. The table below indicates which template files are used in constructing each of these pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!  &#039;&#039;&#039;Survey Pages/&#039;&#039;&#039;&amp;lt;br /&amp;gt;&#039;&#039;&#039;Template Files&#039;&#039;&#039;!!Survey&amp;lt;br /&amp;gt;List!!Welcome!!Question!!Completed!!Clear All!!Register!!Load!!Save!!Print&amp;lt;br /&amp;gt;Answers!!Print&amp;lt;br /&amp;gt;Survey&lt;br /&gt;
|-&lt;br /&gt;
|SurveyList||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Welcome|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Privacy|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Navigator|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Survey|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|StartGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|GroupDescription|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Question&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|EndGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Assessment|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Completed|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ClearAll|| || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Register|| || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Load|| || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||&lt;br /&gt;
|-&lt;br /&gt;
|Save|| || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| ||&lt;br /&gt;
|-&lt;br /&gt;
|PrintAnswers|| || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||&lt;br /&gt;
|-&lt;br /&gt;
|Print Survey || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Group || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Question || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|StartPage&amp;lt;br /&amp;gt;EndPage&amp;lt;br /&amp;gt;Template.css||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.90+, this replaces question.pstpl AND question_start.pstpl. If you are using an old custom template, you need to add the following line to the beginning of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div {QUESTION_ESSENTIALS} class=&amp;quot;{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;And then add the corresponding closing tag to the end of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.91 and earlier, LimeSurvey js files are not included in the template. In version 2, &#039;&#039;&#039;you have to use {TEMPLATEJS} in one of your template file&#039;&#039;&#039; to add the link to the js file. You can add it in startpage.pstpl or in endpage.pstpl. You can remove the {TEMPLATEURL}/template.js line and you have to replace with {TEMPLATEJS} to update a personal template.&lt;br /&gt;
&lt;br /&gt;
==The File Control Section== &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
In the &amp;quot;file control&amp;quot; window on the left, you can click on one of the template files that is used to compile the page. You can see the &#039;&#039;Screen part&#039;&#039;, JavaScript, and CSS files. The HTML code for that file will then appear in the &amp;quot;Now editing&amp;quot; window in the center. If the template is editable (determined by directory permissions) you can then make any changes and save them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:299--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:File Control Section.png|center]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The &amp;quot;Other files&amp;quot; window shows a list of all other files from the template directory. You can use the right side to &#039;&#039;&#039;upload and select image files (your pics, logos,...) or other files needed to create your template&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:300--&amp;gt;&lt;br /&gt;
Instead of using a link for each picture, utilize the field string {TEMPLATEURL}. So, instead of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;/limesurvey/templates/yourtemplate/files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
You can use {{NewIn|2.50}}:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:287--&amp;gt;&lt;br /&gt;
In LimeSurvey versions before 2.50 use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
A &amp;quot;sample&amp;quot; of the template page you are editing will be visible in the bottom of the screen. There is no way to delete a template from the template editor. This must be done by accessing the underlying directory and deleting manually the files from there. You also have the possibility to select different screen resolutions in order to better evaluate the feel and look of the template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The shipped templates cannot be edited using the template editor. If you want to modify them, create a copy first and edit the copy.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Template files location== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
LimeSurvey stores each of the &#039;standard&#039; templates in their own distinct sub-directory within the &#039;&#039;/templates&#039;&#039; directory that is kept in the public directory with the other LimeSurvey public files. Customized user templates are stored in the &#039;&#039;/upload/templates&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
There should &#039;&#039;&#039;ALWAYS&#039;&#039;&#039; be a &amp;quot;default&amp;quot; directory in the templates directory. This template is used by default and as a fall-back if a template folder doesn&#039;t exist, or can&#039;t be found. It comes installed by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
You can use any image files that you upload into the template management area with the help of this syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{TEMPLATEURL}filename.xyz&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Styling questions with CSS= &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
Styling of questions in CSS has become much easier. Each question type has now a unique class. The mandatory questions have an additional mandatory class. For example, for a non-mandatory question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
and if the question is mandatory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
and if the question is mandatory, but the user didn&#039;t answer it or if there is validation on a question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
and if the question has validation applied, but the user hasn&#039;t answered correctly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question6&amp;quot; class=&amp;quot;text-short input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Global classes for question part== &amp;lt;!--T:273--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:274--&amp;gt;&lt;br /&gt;
These classes are used for each question type. Some question types use only one or two classes, while others may use much more.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:281--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable alternance&amp;quot;&lt;br /&gt;
|+ Global classes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Class name&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Part&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Question type&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Examples&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Note&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question {{ObsoleteIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;p class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;question&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-answers {{NewIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;div class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;ls-answers&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .subquestions-list&lt;br /&gt;
| List of subquestion&lt;br /&gt;
| Multi choice question, array question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;subquestions-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;subquestions-list&amp;quot;&amp;gt;&lt;br /&gt;
| .questions-list is used too&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answers-list&lt;br /&gt;
| List of answers&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;answers-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;answers-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answer-item&lt;br /&gt;
| The answer part: one answer&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;answer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;answer-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .noanswer-item&lt;br /&gt;
| The answer part for no answer&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;noanswer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
| No answer is an answer too, then have double class noanswer-item and answer-item&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question-item&lt;br /&gt;
| The question part: one question&lt;br /&gt;
| Multi text question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;question-item&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;question-item&amp;quot;&amp;gt;&lt;br /&gt;
| Some answers are questions too. Then we have a lot of class=&amp;quot;question-item answer-item&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-list&lt;br /&gt;
| A list of checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;checkbox-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| Some question types use multi-list class, like checkbox with comment: class=&amp;quot;checkbox-list text-list&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of checkbox&lt;br /&gt;
| Array (numbers) with checkbox option&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-item&lt;br /&gt;
| The answer part with a checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;checkbox-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;checkbox-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-list&lt;br /&gt;
| A list of radio item&lt;br /&gt;
| Single choice question, array question type (each row)&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;radio-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;radio-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-array {{NewIn|3.0}}&lt;br /&gt;
| A array of radio item&lt;br /&gt;
| Array question type&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;radio-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-item&lt;br /&gt;
| The answer part with a radio&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;radio-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;radio-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-list&lt;br /&gt;
| A list of text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-item&lt;br /&gt;
| The answer part of a text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;text-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;text-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .numeric-list&lt;br /&gt;
| A list of text input with numeric only answer&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-list&lt;br /&gt;
| A list of text input with numeric only answer (each row)&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-array  {{NewIn|3.0}}&lt;br /&gt;
| The answer part of a numeric input&lt;br /&gt;
| Array of number&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;number-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-list  {{ObsoleteIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;select-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-list  {{NewIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select) (each row)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of dropdown&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-item  {{ObsoleteIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;select-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;select-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-item  {{NewIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;dropdown-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;dropdown-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .hide  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Used for accessibility: hidden with css but read by screenreader, since 2.50 : you can use sr-only from bootstrap&lt;br /&gt;
| Short text question&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;hide&amp;quot;&amp;gt;&lt;br /&gt;
| Can be used for other purposes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is activated&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it, but you can use it too in your template&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden-sr {{NewIn|3.0}}&lt;br /&gt;
| Used for accessibility: hide it if js is activated, but always show if user use a screenreader&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-js-hidden-sr&amp;quot;&amp;gt;&lt;br /&gt;
| Button&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-no-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is not activated&lt;br /&gt;
| Link&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it for inactive link if javascript is not activated&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-label-xs-visibility {{NewIn|3.0}}&lt;br /&gt;
|  Label to be hidden in big screen, but show with little screen (with no more table) and to screenreader&lt;br /&gt;
| label&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| Used for label inside table cell of array question type&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-input-group-extra {{NewIn|3.0}}&lt;br /&gt;
| Same usage of boostrap input-group-addon, but without the border and the background.&lt;br /&gt;
| right suffix&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-input-group-extra&amp;quot;&amp;gt;&lt;br /&gt;
| Used for right and left suffix (global)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=checkbox]&lt;br /&gt;
| Question with checkbox&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;checkbox&amp;quot; class=&amp;quot;checkbox&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=radio]&lt;br /&gt;
| Question with radio&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;radio&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text&lt;br /&gt;
| input[type=text]&lt;br /&gt;
| Question with input text, or textarea&lt;br /&gt;
| &amp;amp;lt;textarea class=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answertext&lt;br /&gt;
| Array question type&lt;br /&gt;
| Answer part of array question type&lt;br /&gt;
| &amp;amp;lt;th class=&amp;quot;answertext&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .col-answers&lt;br /&gt;
| Array question type&lt;br /&gt;
| Column of answers&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .odd .even {{ObsoleteIn|2.50}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for column&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .array1 .array2  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for line&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;array1&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-odd .ls-even  {{NewIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for sub-question and Y axis&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;ls-odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Some example of question part with classes=== &amp;lt;!--T:275--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:276--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Text-short question type:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;question answer-item text-item &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;label class=&amp;quot;hide label&amp;quot; for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Answer&amp;lt;/label&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;50&amp;quot; class=&amp;quot;text  empty&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:277--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Multiple short text&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;subquestions-list questions-list text-list&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li class=&amp;quot;question-item answer-item text-item&amp;quot; id=&amp;quot;javatbdSGQA&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;label for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Some example subquestion&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;span&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;20&amp;quot; class=&amp;quot;text empty&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:282--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Array question type&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;question subquestion-list questions-list &amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;caption class=&amp;quot;hide read&amp;quot;&amp;gt;Some explanation for accessibility.&amp;lt;/caption&amp;gt;&lt;br /&gt;
	&amp;lt;colgroup class=&amp;quot;col-responses&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;50%&amp;quot; class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;25%&amp;quot; class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;13.3%&amp;quot; class=&amp;quot;col-no-answer even&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;/colgroup&amp;gt;&lt;br /&gt;
	&amp;lt;thead&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array1 dontread&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;1&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;No answer&amp;lt;/th&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/thead&amp;gt;&lt;br /&gt;
	&amp;lt;tbody&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array2 answers-list radio-list&amp;quot; id=&amp;quot;javatbdSGQ&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;20%&amp;quot; class=&amp;quot;answertext&amp;quot;&amp;gt;Some example subquestion&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer_cell_001 answer-item radio-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;1&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer-item radio-item noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;No answer&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The full list of question classes== &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Question Type&#039;&#039;&#039;||&#039;&#039;&#039;Question Class&#039;&#039;&#039;||&#039;&#039;&#039;Question ID&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|5 point choice||.choice-5-pt-radio||5&lt;br /&gt;
|-&lt;br /&gt;
|Array (10 point choice)||.array-10-pt||B&lt;br /&gt;
|-&lt;br /&gt;
|Array (5 point choice)||.array-5-pt||A&lt;br /&gt;
|-&lt;br /&gt;
|Array (Flexible Labels) dual scale||.array-flexible-duel-scale ||1&lt;br /&gt;
|-&lt;br /&gt;
|Array (Increase, Same, Decrease)||.array-increase-same-decrease||E&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Numbers)||.array-multi-flexi ||:&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Text)||.array-multi-flexi-text||;&lt;br /&gt;
|-&lt;br /&gt;
|Array (Yes/No/Uncertain)||.array-yes-uncertain-no||C&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels)||.array-flexible-row ||F&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels) by column||.array-flexible-column||H&lt;br /&gt;
|-&lt;br /&gt;
|Boilerplate question||.boilerplate||X&lt;br /&gt;
|-&lt;br /&gt;
|Date||.date||D&lt;br /&gt;
|-&lt;br /&gt;
|Gender||.gender||G&lt;br /&gt;
|-&lt;br /&gt;
|Huge free text||.text-huge||U&lt;br /&gt;
|-&lt;br /&gt;
|Language switch||.language||I&lt;br /&gt;
|-&lt;br /&gt;
|List (dropdown)||.list-dropdown||!&lt;br /&gt;
|-&lt;br /&gt;
|List (radio)||.list-radio||L&lt;br /&gt;
|-&lt;br /&gt;
|List with comment||.list-with-comment||O&lt;br /&gt;
|-&lt;br /&gt;
|Long free text||.text-long||T&lt;br /&gt;
|-&lt;br /&gt;
|Multiple numerical input||.numeric-multi||K&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options||.multiple-opt||M&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options with comments||.multiple-opt-comments||P&lt;br /&gt;
|-&lt;br /&gt;
|Multiple short text||.multiple-short-txt||Q&lt;br /&gt;
|-&lt;br /&gt;
|Numerical input||.numeric||N&lt;br /&gt;
|-&lt;br /&gt;
|Ranking||.ranking||R&lt;br /&gt;
|-&lt;br /&gt;
|Short free text||.text-short||S&lt;br /&gt;
|-&lt;br /&gt;
|Yes/No||.yes-no||Y&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==The full list of validation classes== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Note:  Prior to 1.92, only .mandatory and .input-error classes were available.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
These apply to the help and/or validation tip messages so that each type can be individually styled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
The .hide-tip option and .input-error options interact by default so that you can have validation tips hidden. However, they do appear when there are validation errors and disappear again when those errors are rectified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
All of these are designed to eliminate the need for pop-up alert messages. Instead, tips can appear/disappear as needed and are color-coded to indicate whether the answers pass the validation criteria.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Furthermore, when you first visit a page that has unmet validation criteria, you can color-code the tips in a pleasing color to show which validation criteria have not been met yet; then re-display the page using a harsher color if the person submits the page with lingering validation errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Purpose&#039;&#039;&#039;||&#039;&#039;&#039;CSS Class&#039;&#039;&#039;||&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Mandatory||.mandatory||the question is mandatory&lt;br /&gt;
|-&lt;br /&gt;
|User input error||.input-error||the question had at least one validation error&lt;br /&gt;
|-&lt;br /&gt;
|Hide Tip||.hide-tip||added if you use the hide_tip option&lt;br /&gt;
|-&lt;br /&gt;
|Num answers||.em_num_answers||for for min_answers and max_answers&lt;br /&gt;
|-&lt;br /&gt;
|Value range||.em_value_range||for min/max_num_value_n and multiflexible_min/max&lt;br /&gt;
|-&lt;br /&gt;
|Sum range||.em_sum_range||for min/max/equals_num_value&lt;br /&gt;
|-&lt;br /&gt;
|Regex validation||.em_regex_validation||for regular-expression validation of the question&lt;br /&gt;
|-&lt;br /&gt;
|Question-level validation function||.em_q_fn_validation||for the em_validation_q option&lt;br /&gt;
|-&lt;br /&gt;
|Subquestion-level validation function||.em_sq_fn_validation||for the em_validation_sq option&lt;br /&gt;
|-&lt;br /&gt;
|Other comment mandatory||.em_other_comment_mandatory||for other_comment_mandatory option - shows when &amp;quot;other&amp;quot; is selected but associated comment is missing.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing styles into your custom template== &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
The custom question styles are near the bottom of each template&#039;s CSS file and start with:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;/* --------------------------- START: Question styles  ------------------------------ */&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
If you&#039;re styling your own custom template, you should be able to copy everything after the above one from &#039;&#039;templates/default/template.css&#039;&#039; (for table-based layouts) or &#039;&#039;/templates/limespired/template.css&#039;&#039; (for CSS-based layouts) into your own style sheet without any impact on your other styles.&lt;br /&gt;
&lt;br /&gt;
==Internet Explorer conditional style sheets== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
Because of the marked discrepancies in rendering between IE6 &amp;amp; IE7 and the other browsers, there are special IE conditional style sheets included for each template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_all-versions.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if lt IE 7]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_older-than-7.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8]&amp;gt;&lt;br /&gt;
		&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}ie_fix_8.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You should include the above code within your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; and copies of both the IE style sheets from either &#039;&#039;/templates/default/&#039;&#039; or &#039;&#039;/templates/limespired&#039;&#039; for Tables base layout and CSS based layout respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; If you copy the styles into your own style sheet you will almost certainly need to tweak them.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alternative solution for Internet explorer=== &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
You can put a conditional class for body in startpage.pstpl and use this class in your template.css. This method is used in the citronade template{{ObsoleteIn|2.06}}. Adding a js / no-js class to have javascript / no javascript system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;!--[if lt IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie6 ielt7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie8 ielt9  no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 9 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if gt IE 9]&amp;gt;&amp;lt;!--&amp;gt;&amp;lt;body id=&amp;quot;body&amp;quot; class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} no-js&amp;quot;&amp;gt;&amp;lt;!--&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;script type=&#039;text/javascript&#039;&amp;gt;/*&amp;lt;![CDATA[*/(function(H){ H.className=H.className.replace(/\bno-js\b/,&#039;js&#039;) })(document.getElementsByTagName(&#039;body&#039;)[0]);/*]]&amp;gt;*/&amp;lt;/script&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
And in template.css use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;.ie6{/*specific for internet explorer 6*/}&lt;br /&gt;
.ielt8{/*specific for internet explorer 6 and 7*/}&lt;br /&gt;
.ie{/*specific for all internet explorer */}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Right-to-Left (RTL) Languages and justify== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
The text editor within LimeSurvey is able to format RTL text. However, the editor itself shows the RTL language in a left to right format when justified. This is just an editor display issue. The RTL and justified question or text will display correctly from right to left, even when justified, in your survey or on preview.&lt;br /&gt;
&lt;br /&gt;
==Keywords== &amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:309--&amp;gt;&lt;br /&gt;
{{Deprecated|3.0}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
Keywords within a template file get replaced by the current survey information. They are surrounded by curly brackets, for example: {SURVEYNAME}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
The following strings will be replaced by LimeSurvey when parsing the template file and presenting it to survey users. These field strings will work on almost every template except for the &#039;Completed Page&#039;. (Most of these strings can be found in the common.php file. If it&#039;s not there, look in the index.php file.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!&#039;&#039;&#039;Keyword&#039;&#039;&#039;!!&#039;&#039;&#039;Template files&#039;&#039;&#039;!!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYNAME}||All Files||The survey title&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYDESCRIPTION}||All Files||The survey description&lt;br /&gt;
|-&lt;br /&gt;
|{WELCOME}||All files (mainly for welcome.pstpl)||The survey &#039;welcome&#039; text&lt;br /&gt;
|-&lt;br /&gt;
|{PERCENTCOMPLETE}||survey.pstpl||A small graph showing the percentage of the survey completed&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPNAME}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group name&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPDESCRIPTION}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group description&lt;br /&gt;
|-&lt;br /&gt;
|{NUMBEROFQUESTIONS}||welcome.pstpl||Displays the total number of questions in the survey (just the number)&lt;br /&gt;
|-&lt;br /&gt;
|{THEREAREXQUESTIONS}||welcome.pstpl||Displays the sentence &amp;quot;There are X questions in this survey&amp;quot; - from the relevant language file. The X is replaced with the number of questions. Note that this will also work appropriately for singular or plural. If there is only 1 question, it will print &amp;quot;There is 1 question in this survey&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|{CHECKJAVASCRIPT}||All files (mainly for welcome.pstpl)||Warning message when end-user browser have javascript disabled&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION}||Question.pstpl||(&#039;&#039;&#039;Has been superseeded as of LS1.87&#039;&#039;&#039;) Displays the current question text (The format of {QUESTION} can customised by editing &#039;question_start.pstpl&#039;) Use the following: {QUESTION_TEXT}, {QUESTION_MANDATORY}, {QUESTION_HELP}, {QUESTION_MAN_MESSAGE}, {QUESTION_VALID_MESSAGE}, {QUESTION_INPUT_ERROR_CLASS}, and appropriate wrapping HTML instead of {QUESTION}&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWER}||question.pstpl, print_question.pstpl||presents the answer form for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{SGQ}||question.pstpl, question text||Can be used in the question text itself to reference the input field of the question dynamically by displaying the Survey-Group-Question id for the current question. (as of svn build 9755)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTIONHELP}||question.pstpl, print_question.pstpl||Displays help text (predefined tip for question type) for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CLASS}||question.pstpl, print_question.pstpl||unique class for each question type. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CODE}||question.pstpl, print_question.pstpl||Displays the current question code&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ESSENTIALS}||question.pstpl||the question ID and (if a question is conditional), &#039;style=&amp;quot;display:none;&amp;quot;&#039;. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_HELP}||question.pstp, question_start.pstpl||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TYPE_HELP}||print_question.pstp||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_INPUT_ERROR_CLASS}||question.pstp, question_start.pstpl||Provides a class if there was user input error&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ID}||print_question.pstp||Provides a unique ID for each question to allow styling for specific questions&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TEXT}||question.pstp, print_question.pstp, question_start.pstpl||Displays the text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MANDATORY}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_CLASS}||question.pstpl, print_question.pstpl||class if a question is mandatory. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_NUMBER}||print_question.pstpl||Incremental count of questions.&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_VALID_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated valid help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_SCENARIO}||print_question.pstp||Prints out the &#039;scenario&#039; text for conditional questions.&lt;br /&gt;
|-&lt;br /&gt;
|{NAVIGATOR}||navigator.pstpl||Displays navigation buttons (next, prev, last)&lt;br /&gt;
|-&lt;br /&gt;
|{CLEARALL}||All files (but intended for navigator.pstpl)||Displays the &amp;quot;Exit and Clear Results&amp;quot; link&lt;br /&gt;
|-&lt;br /&gt;
|{COMPLETED}||completed.pstpl||Displays the &#039;completed&#039; message for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{URL}||completed.pstpl||Displays the survey &#039;url&#039; and &#039;url text&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{PRIVACYMESSAGE}||privacy.pstpl||The privacy message is shown if you set your survey to be anonymous. [[Translating LimeSurvey|The text can be edited/translated]] in the language files. This can also be changed manually by editing the privacy.pstpl template you wish to use.&lt;br /&gt;
|-&lt;br /&gt;
|{TEMPLATEURL}||All Files||The URL to the current template location (useful for referencing image files in your template)&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYRESOURCESURL}||All Files||The URL to the current uploaded files for this survey location (useful for referencing image files in your question, group, ....)&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITCOMPLETE}||endpage.pstpl||The statement (from the language files) that tells the user they have completed the survey, and to press the &amp;quot;Submit&amp;quot; button&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITREVIEW}||survey.pstpl||The statement (from the language files) that tells the user they can review/change the answers they have made by clicking &amp;quot;&amp;lt;&amp;lt; prev&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{SAVEDID}||All Files||Displays &#039;Response ID&#039; of user&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|{QUEXMLPDF}||All Files||Displays button to export the queXML PDF of questionnaire including answers entered up until the point that has been completed in the survey.&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:FIRSTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users first name from the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:LASTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users last name from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:EMAIL}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users email from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_1}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_1 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_2}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_2 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWERSCLEARED}||Preferably in navigator.pstpl||The &amp;quot;Answers Cleared&amp;quot; statement from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{RESTART}||clearall.pstpl||URL to restart the survey&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERERROR}||register.pstpl||Shows any error messages in the register page (ie: &amp;quot;You must include an email address&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE1}||register.pstpl||The statement &amp;quot;You must be registered to complete this survey&amp;quot; from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE2}||register.pstpl||Details about registering from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERFORM}||register.pstpl||The actual form for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{SAVE}||Works suitable on navigator.pstpl||Displays the &#039;Save your responses so far&#039; button to offer the user to save and come back later to continue the survey. If the Save option is deactivated in the survey properties the tag will not be shown and ignored.&lt;br /&gt;
|-&lt;br /&gt;
|{LANGUAGECHANGER}||survey.pstpl||Displays a switch in multilingual surveys to change the question.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Input/Buttons== &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
Each &amp;quot;input&amp;quot; type in a survey has been given its own class name, so that you can add CSS to your &amp;quot;startpage.pstpl&amp;quot; file and have some control over the appearance of form buttons and inputs. These class names are as follows:&lt;br /&gt;
*&#039;&#039;&#039;submit&#039;&#039;&#039; (Submit Buttons)&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; (Text Inputs - for short free text, date, and numerical type)&lt;br /&gt;
*&#039;&#039;&#039;answertext&#039;&#039;&#039; (Text of answers)&lt;br /&gt;
*&#039;&#039;&#039;radio&#039;&#039;&#039; (Radio Buttons)&lt;br /&gt;
*&#039;&#039;&#039;checkbox&#039;&#039;&#039; (Check Boxes)&lt;br /&gt;
*&#039;&#039;&#039;select&#039;&#039;&#039; (Select / List Boxes)&lt;br /&gt;
*&#039;&#039;&#039;textarea&#039;&#039;&#039; (Large text inputs - for long free text)&lt;br /&gt;
*&#039;&#039;&#039;clearall&#039;&#039;&#039; (The &amp;quot;Exit and Clear Survey&amp;quot; link)&lt;br /&gt;
*&#039;&#039;&#039;rank&#039;&#039;&#039; (The rank style question. Doesn&#039;t set the colour of the select box or the text boxes, but it does allow the changing of background colour, text colour, size etc., for the rest of the ranking question)&lt;br /&gt;
*&#039;&#039;&#039;graph&#039;&#039;&#039; (The &amp;quot;percentage completed&amp;quot; graph table)&lt;br /&gt;
*&#039;&#039;&#039;innergraph&#039;&#039;&#039; (The table inside the graph table - this contains the 0% and 100% text. Use this for changing the size of this text)&lt;br /&gt;
*&#039;&#039;&#039;question&#039;&#039;&#039; (General settings for any question that is displayed within a table. Generally, you should use this to make sure that their font size and color is the same as you have used elsewhere as a default)&lt;br /&gt;
*&#039;&#039;&#039;mandatory&#039;&#039;&#039;  (Mandatory questions)&lt;br /&gt;
*&#039;&#039;&#039;input-error&#039;&#039;&#039; (User input error - for if a user has made a mistake with a mandatory question or question with validation)&lt;br /&gt;
*&#039;&#039;&#039;array1&#039;&#039;&#039; and &#039;&#039;&#039;array2&#039;&#039;&#039; (These two styles are cycled when presenting the range of answers for an array type question. This allows you to set an alternating background color for these question types. &#039;&#039;&#039;Array1&#039;&#039;&#039; is also used for the column headings in these question types)&lt;br /&gt;
*&#039;&#039;&#039;errormandatory&#039;&#039;&#039; (Sets the color and style of the &amp;quot;This question is mandatory&amp;quot; error message)&lt;br /&gt;
*&#039;&#039;&#039;warningjs&#039;&#039;&#039; (Sets the color and style of the warning message displayed if the participant&#039;s browser has javascript disabled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
There are also some elements that can be accessed using the ID of the element (&#039;&#039;&#039;#ID&#039;&#039;&#039; in CSS):&lt;br /&gt;
*&#039;&#039;&#039;surveycontact&#039;&#039;&#039; (The contact message shown on the start page)&lt;br /&gt;
*&#039;&#039;&#039;tokenmessage&#039;&#039;&#039; (used for messages inside the survey, e.g. the session expired error message)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
Because you can edit all the HTML aspects, there&#039;s no reason to surround your templates with a &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&#039;new_name&#039;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and then define a css for that new_name class.&lt;br /&gt;
&lt;br /&gt;
==Styling the progress bar== &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
The progress bar appearance can be modified with CSS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
To change the background color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-header {&lt;br /&gt;
 background-color: #3300FF;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
To change the border color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-content,&lt;br /&gt;
#progress-wrapper .ui-widget-header {&lt;br /&gt;
 border: 1px solid #FF0000;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Features Available to Developers== &amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
LimeSurvey has integrated some user-made patches that permits some special changes. These very advanced features (generally) require changes to the underlying code base of LimeSurvey and should be done carefully in order not to introduce security holes.&lt;br /&gt;
&lt;br /&gt;
===Support for your own Javascript functions=== &amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Some users may need to run Javascript on the survey pages, but calling &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; in the BODY element made it impossible to do so. This call has been replaced with a small JavaScript function in the HEAD that sniffs for the existence of &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; and &#039;&#039;&#039;template_onload()&#039;&#039;&#039; before calling them. In this way, a template author can create his or her own &#039;&#039;&#039;template_onload()&#039;&#039;&#039; function in the HEAD that replaces the default one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
*Disable XSS filter - in Global settings -&amp;gt; Security, set &amp;quot;Filter HTML for XSS&amp;quot; to No.&lt;br /&gt;
*Enter your script in the source of a question or group description.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:301--&amp;gt;&lt;br /&gt;
{{Note|For further details, see the [[Workarounds: Manipulating a survey at runtime using Javascript#How to use Script (eg. JavaScript etc.) in LimeSurvey|workaround section]].}}&lt;br /&gt;
&lt;br /&gt;
=Videos on Templates= &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
This video will demonstrate the basic and advanced template functions that are available to all LimeSurvey users. This includes changing the appearance of certain forms and inserting custom graphics. Additionally, it will thoroughly walk you through on how to edit and preview specific page templates, importing/exporting templates, modify appearance of questions in the CSS, and customizing survey description page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:302--&amp;gt;&lt;br /&gt;
Video - needed&lt;br /&gt;
&lt;br /&gt;
=Tips &amp;amp; Tricks= &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some language specific element== &amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
If you want to have some language specific sentence in a survey, for example a help at the end of each page, you can add in a .pstl file a sentence and hidding it for other language. If we hide it in the template.css, we can use the pseudo selector :lang, but we use some class for better compatibility.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
Below, there are two help sentences, in French and English. Put this on endpage.pstpl:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;fr&amp;quot; lang=&amp;quot;fr&amp;quot;&amp;gt;Pour de l&#039;aide en direct appelez le 000000&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;For some help, please call 000000&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
and in template.css:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:152--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.lang-fr .en{display:none}&lt;br /&gt;
.lang-en .fr{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change the layout of the survey page== &amp;lt;!--T:155--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:156--&amp;gt;&lt;br /&gt;
After editing and saving a template, it applies to a survey list page only if it is selected from the settings of the survey. To make it the default template, go under the &#039;&#039;&#039;General tab&#039;&#039;&#039; located in the &#039;&#039;&#039;Global settings&#039;&#039;&#039; of your LimeSurvey installation and choose the desired template. From now on, all the templates that use the &amp;quot;default&amp;quot; option as template plus the ones that are going to be newly created, will use the newly selected default template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
To use your current template for this page, you have to change the according setting from &#039;&#039;&#039;Global settings&#039;&#039;&#039;. In older versions, this change can be done by editing the $defaulttemplate setting from the config file: copy this setting from config-defaults.php to config.php which overrides config-defaults.php and edit this setting to &amp;lt;code lang=&amp;quot;html&amp;quot;&amp;gt;$defaulttemplate = &#039;yourtemplatename&#039;;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Import/Export of templates: Mac users== &amp;lt;!--T:158--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;Mac users&amp;lt;/u&amp;gt;, please note that the Mac OSX default archive utility may have problems with zip folders &amp;quot;generated on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:160--&amp;gt;&lt;br /&gt;
A workaround is to unix&#039;es unzip from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
$ unzip template.zip -d template&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:162--&amp;gt;&lt;br /&gt;
Archive: template.zip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
 inflating: template/startpage&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:164--&amp;gt;&lt;br /&gt;
 inflating: ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
Another workaround is to use scripts in their mac-compiled counterparts.&lt;br /&gt;
&lt;br /&gt;
==Replacing the help icon {{ObsoleteIn|2.50}} == &amp;lt;!--T:173--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:174--&amp;gt;&lt;br /&gt;
When a question help text is shown, then an help.gif image is used from the default template folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
You can replace this image by uploading a new help.gif, help.png or help.jpg in your custom template folder. It will then be automatically used instead of the default help icon.&lt;br /&gt;
&lt;br /&gt;
==Replacing an existing logo {{NewIn|2.50}} {{ObsoleteIn|3.0}}== &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:177--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In the &#039;&#039;&#039;default&#039;&#039; Template of 2.50, there is no preembedded logo. Read further our [[#Adding_your_own_logo |wiki on how to add your own logo]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
1. To edit the logo go to the &#039;&#039;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&#039;&#039; file which you can find it here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:179--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t1.PNG|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
2. Click the search button to find occurrences of logo related styles and search for &#039;&#039;logo&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:181--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:2.png|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
4. Edit the main style file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:185--&amp;gt;&lt;br /&gt;
You will see something similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t4.PNG|500px]]&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:187--&amp;gt;&lt;br /&gt;
If you want to change the image, just replace logo.gif with another image link. Example: (&amp;lt;u&amp;gt;logo.png&amp;lt;/u&amp;gt; or &amp;lt;u&amp;gt;logo.jpg&amp;lt;/u&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:188--&amp;gt;&lt;br /&gt;
If you want to change the image size, adjust width and height (in pixels) like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;width:100px; height:100px;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo {{ObsoleteIn|3.0}} == &amp;lt;!--T:190--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
1. Find and open the &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; template file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:192--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:startpage.pstpl.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
2. After this&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; &amp;gt;&amp;lt;div id=&amp;quot;topContainer&amp;quot; class=&amp;quot;jumbotron&amp;quot;&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
add this line to &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;img id=&#039;page_logo&#039; src=&#039;{TEMPLATEURL}/files/logo.png&#039; class=&amp;quot;clearfix pull-right&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
3. To upload your own logo, go to the template editor and upload your logo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:197--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:uploadyourlogo.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:199--&amp;gt;&lt;br /&gt;
To position your logo, please use one of the following css classes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:293--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the left side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:200--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-left&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:204--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the right side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:205--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-right&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:208--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want to center the logo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:209--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix center-block&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the same template with different logos== &amp;lt;!--T:214--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:215--&amp;gt;&lt;br /&gt;
If you want to use the same template for all surveys and just want to change the logo for each survey, you can use the {SID} placeholder in the template .pstpl file and thereby refer to different images:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:216--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;{TEMPLATEURL}files/logoImage-{SID}.png&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the default help to all question (hide_tip) {{ObsoleteIn|1.92}}== &amp;lt;!--T:217--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:218--&amp;gt;&lt;br /&gt;
There are 3 solutions to remove the default help:&lt;br /&gt;
# like a hide_tip attribute but for all question and survey.&lt;br /&gt;
# you can remove the {QUESTIONHELP} and its container from the file question.pstl. However, it can be a bad idea for the screenreader.&lt;br /&gt;
# for the default template and some other, add this at the end of tempate.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:219--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;span.questionhelp{display:none;}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display custom favicon== &amp;lt;!--T:220--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:221--&amp;gt;&lt;br /&gt;
A favicon is the little icon you see in the browser&#039;s address bar, list of bookmarks or tab. You can display your own icon as follows:&lt;br /&gt;
#Create a favicon - google will find you lots of free favicon generators.&lt;br /&gt;
#Name your new favicon &amp;quot;favicon.ico&amp;quot; and place it in your template /files directory.&lt;br /&gt;
#Add the following code to your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; before the &amp;lt;/head&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:222--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Different appearance for survey-/question-pages== &amp;lt;!--T:224--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:226--&amp;gt;&lt;br /&gt;
If you want LimeSurvey to change the appearance of every second page (i.e. of even and odd survey pages), you can use &#039;&#039;&#039;.page-odd&#039;&#039;&#039; class in your CSS file to change the appearance of odd pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:227--&amp;gt;&lt;br /&gt;
An example from default template of LimeSurvey 1.91+:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:228--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.page-odd table.question-group {&lt;br /&gt;
 background-color: #D2F2D3;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:232--&amp;gt;&lt;br /&gt;
If you do &#039;&#039;&#039;not&#039;&#039;&#039; want differentiate even and odd pages, find all instances of &#039;&#039;.page-odd&#039;&#039; in template.css and remove those styles.&lt;br /&gt;
&lt;br /&gt;
==Create a vertical separator  border for dual scale array== &amp;lt;!--T:233--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:234--&amp;gt;&lt;br /&gt;
To create a vertical separator border for a dual scale array, you can add the following lines to your &#039;&#039;&#039;template.css&#039;&#039;&#039;-file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:235--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
table.question thead td.header_separator,&lt;br /&gt;
table.question tbody td.dual_scale_separator&lt;br /&gt;
{&lt;br /&gt;
   border-right:solid 1px #00A8E1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:242--&amp;gt;&lt;br /&gt;
&#039;&#039;header_separator&#039;&#039; is used to adress the separator for the header &amp;quot;td&amp;quot;. The &amp;quot;dual_scale_separator&amp;quot; is used to address the separator column in the dual scale array.&lt;br /&gt;
&lt;br /&gt;
==Hide the survey contact message shown on the start page/survey list {{ObsoleteIn|3.0}} == &amp;lt;!--T:243--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:244--&amp;gt;&lt;br /&gt;
To hide the &amp;quot;Please contact ...&amp;quot; message on the start page (with the survey list), you can add the following to the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.js&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:245--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:246--&amp;gt;&lt;br /&gt;
$(&#039;#surveycontact&#039;).hide(); //Hides the survey contact message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:247--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the survey contact message shown on error messages {{ObsoleteIn|3.0}}== &amp;lt;!--T:248--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:249--&amp;gt;&lt;br /&gt;
If you want to remove the survey contact message from error messages, it&#039;ll be trickier. You can add the function from below. It calls the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.css&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:250--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
removeContactAdressFromMessage(); //Removes the survey contact message from error messages&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:253--&amp;gt;&lt;br /&gt;
and add the following function to your *template.js* file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:254--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
function removeContactAdressFromMessage()&lt;br /&gt;
{&lt;br /&gt;
if ($(&#039;#tokenmessage&#039;).length &amp;gt; 0)&lt;br /&gt;
   {&lt;br /&gt;
   var oldMessage = $(&#039;#tokenmessage&#039;).html();&lt;br /&gt;
   var indexContact = oldMessage.indexOf(&#039;Bitte kontaktieren&#039;);&lt;br /&gt;
   var newMessage = oldMessage.substr(0, indexContact);&lt;br /&gt;
   $(&#039;#tokenmessage&#039;).html(newMessage);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:266--&amp;gt;&lt;br /&gt;
It will probably not work for a survey in English language and has to be extended when used for multilingual surveys. But it&#039;s an idea/tip on how to solve this.&lt;br /&gt;
&lt;br /&gt;
==How to deal with multilingual question attributes {{ObsoleteIn|2.50}}== &amp;lt;!--T:267--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:268--&amp;gt;&lt;br /&gt;
If you have a multilingual survey and e. g. want to use a different string for the &amp;quot;other&amp;quot; field, this could only be done for the base language (until this feature was added at LimeSurvey 2.0). To work around this, paste in the field to change the label for &amp;quot;other&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:269--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;en&amp;quot;&amp;gt;New label&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;fr&amp;quot;&amp;gt;Nouveau label&amp;lt;/span&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:270--&amp;gt;&lt;br /&gt;
Add in the template.css of your template (at &#039;&#039;/limesurvey/upload/templates/&amp;lt;yourtemplatename&amp;gt;/template.css&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:271--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;html:lang(en) .fr{display:none}&lt;br /&gt;
html:lang(fr) .en{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo to the survey list {{ NewIn|3.0}} == &amp;lt;!--T:310--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:311--&amp;gt;&lt;br /&gt;
# First please open the theme editor for the theme you like to use. [[File:OpenThemeEditor.jpg]]&lt;br /&gt;
# We recommend to use fruity, it is our best theme currently. &lt;br /&gt;
# Then extend the theme and give it a name you will recognize. [[File:ExtendTheme.jpg]]&lt;br /&gt;
# In the following view you may upload the logo you want to use. [[File:UploadFileTheme.jpg]]&lt;br /&gt;
# Select the editor screen `Survey List´ in the Screen dropdown in the top right corner. [[File:OpenScreenSurveyList.jpg]]&lt;br /&gt;
# Then select `layout_survey_list.twig´ in the left side menu. [[File:EditLayoutSurveyListTwig.jpg]]&lt;br /&gt;
# In the editor scroll to line 126 and change the marked part to the filename of the image you uploaded to the theme before. [[File:ChangeSurveyListHeaderImageEditor.jpg]]&lt;br /&gt;
# Save your file. [[File:ThemeEditorSaveChanges.jpg]]&lt;br /&gt;
# Change default theme to your extended theme. [[File:ChangeDefaultTheme.jpg]]&lt;br /&gt;
&lt;br /&gt;
=Custom Question Views {{NewIn|3.0}}= &amp;lt;!--T:289--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:290--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; This is a temporary feature to be replaced in the future by question object (it will be very easy to move custom views to question object). It is disabled by default.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:291--&amp;gt;&lt;br /&gt;
As of version 2.5, you can create template-specific custom views for questions and some of their incorporated elements. This is useful if you want to modify the HTML layout of a particular question type for one or more surveys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:292--&amp;gt;&lt;br /&gt;
*In application/config/config.php, find &#039;config&#039;=&amp;gt;array and add this line to the array : &#039;allow_templates_to_overwrite_views&#039;=&amp;gt;1&lt;br /&gt;
*In /{your_template}/config.xml, set &amp;quot;overwrite_question_views&amp;quot; to true&lt;br /&gt;
*Copy application/views/survey/* to template/{your_view_directory}/survey/&lt;br /&gt;
*Note that you only need to copy the files that you intend to modify but the file structure must remain the same as in application/views/survey/&lt;br /&gt;
&lt;br /&gt;
=Insert Custom CSS or JavaScript files for template {{NewIn|2.50}}= &amp;lt;!--T:296--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:303--&amp;gt;&lt;br /&gt;
As of version 2.50, you can use the config.xml file to automatically load plugin files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:304--&amp;gt;&lt;br /&gt;
*Upload your files to the template /css or /scripts folder&lt;br /&gt;
*In /{your_template}/config.xml, add the file paths to the &amp;lt;css&amp;gt; or &amp;lt;js&amp;gt; blocks, something like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;css&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/jquery-ui-custom.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/bootstrap-slider.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:305--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/flat_and_modern.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:306--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/template.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:307--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/myCustomPlugin.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;js&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/template.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/bootstrap-slider.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:308--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;scripts/myCustomPlugin.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/js&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95831</id>
		<title>Theme editor</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95831"/>
		<updated>2018-04-04T10:16:47Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt; &amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
LimeSurvey has an advanced theme and style system providing to developers an efficient way to customize the survey appearance. Since LS3, we&#039;re not speaking anymore about &#039;&#039;&#039;&amp;quot;templates&amp;quot;&#039;&#039;&#039; like in previous versions, but about &#039;&#039;&#039;&amp;quot;themes&amp;quot;&#039;&#039;&#039;. The &#039;&#039;&#039;themes&#039;&#039;&#039; allow control over the look and feel of pages during a survey. A survey administrator can select a default theme that will be used for each survey to further personalize it and improve its look and feel. &#039;&#039;&#039;Themes&#039;&#039;&#039;  come with options that provide to admin without coding skill a simple way to add a logo on the welcome page, to change the background colors, to select a font, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
LimeSurvey comes with 3 themes right out of the box. These initial themes are defined by directories located in the LimeSurvey installation &amp;quot;themes/survey/&amp;quot; directory. Each theme has it&#039;s own directory. Within the main directory of a theme you&#039;ll find a configuration file in XML, and numerous directories containing the views &#039;&#039;themes (.twig)&#039;&#039;&#039;, &#039;&#039;&#039;cascading style sheets (.css)&#039;&#039;&#039;, &#039;&#039;&#039;scripts&#039;&#039;&#039;,  &#039;&#039;&#039;images&#039;&#039;&#039; (&#039;&#039;&#039;.jpg&#039;&#039;&#039; or &#039;&#039;&#039;.png&#039;&#039;&#039;), and maybe others. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Since LimeSurvey 2.50, the theme engine use [http://getbootstrap.com/docs/3.3/ Bootstrap 3]  as CSS framework. Bootstrap 3 being a standard framework, developers will find a lot of documentation, tutorials and forum threads about it on Internet. &lt;br /&gt;
&lt;br /&gt;
Since LimeSurvey 3, the theme engine use [https://twig.symfony.com Twig], so the theme developers can change the logic of the survey rendering in a safe and easy way. Twig replace the old system of replacement keywords that was used in the previous versions. The logic that was used to generate the HTML of the keywords are now available inside the theme&#039;s views. &lt;br /&gt;
&lt;br /&gt;
Snippet from Vanilla Theme:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;twig&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;{{ aSurveyInfo.class.answercontainer }} col-xs-12&amp;quot; {{ aSurveyInfo.attr.answercontainer }}&amp;gt;&lt;br /&gt;
    {# NOTE: If you want to customize the question rendering, use a question theme #}&lt;br /&gt;
    {{ aQuestion.answer | raw }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
One gets a result that looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:278--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;div style=&#039;text-align: center;&#039;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;My New Survey&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&#039;text-align: center;&#039;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;This is a survey written by me to find out what sort of chocolate people like.&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Templates, being HTML code, tend to define the positioning and type of text to be displayed and similar structural features of the page. They often reference or include other files. Most of them reference a common cascading style sheets (CSS) file that defines the font style, color, size, background, and similar parameters common to all pages in the survey. Style sheets reference HTML &#039;&#039;&#039;class&#039;&#039;&#039; parameters that are associated with the various types of objects in the HTML code. This allows the style sheet to describe how to display each of the many types of text or other objects that may appear in multiple places. There are unique classes for each question type in LimeSurvey and thus giving detailed control over the appearance of each. Image files, like logos or special progress-bar constructors, may be referenced as well in the Template file. Finally, special keywords in curly braces are replaced with text defined in the survey for each language translation correspondent (for example, the &#039;Survey Title&#039; or &#039;Question Text&#039; for each language defined).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
If you create a new custom template, please consider contributing it back to the LimeSurvey community and make it available to others. With your help, we can grow our repository of templates, surveys, and other add-ons to make LimeSurvey even better! &lt;br /&gt;
See our [https://www.limesurvey.org/index.php?option=com_sobipro&amp;amp;sid=55:Templates&amp;amp;Itemid=729 LimeSurvey template repository] where you can share your templates.&lt;br /&gt;
&lt;br /&gt;
=Creating a new template= &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To be able to create a new template (or edit an existing template), you need [[Manage users#Set global permissions for a user|Template Editing user permission]] in LimeSurvey as well as permission to manipulate the files in the underlying operating system hosting your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;Note of Warning:&#039;&#039;&#039;&amp;lt;/span&amp;gt; If you change templates, you could also affect all the pre-existing surveys from your LimeSurvey installation. Templates are an advanced feature that require experience and HTML knowledge in order to make them running smoothly.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
The preferred way to create a new template is through the &#039;&#039;&#039;Template Editor&#039;&#039;&#039; (see below), which is located in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; dialog. Some people may like to work directly with template files so that they can use their favorite text editor instead of the web interface. In this case, still use the Template Editor to first create your new template. This will create a new base template with all the files you need in the &#039;&#039;LimeSurvey_web_root/upload/templates/your_new_template&#039;&#039; directory. From there you can use your text editor to manually adjust the template files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; on unix/linux systems, these template files will be owned by the group and user where the web server is running (may be &amp;quot;www&amp;quot; for some systems). So, make sure you have enough access to edit these files, When you save them, make sure they don&#039;t change ownership! In this way, you can still use the web Template Editing interface if needed.&amp;lt;/div&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A number of &#039;public&#039; elements of LimeSurvey can be adjusted by a series of templates. The next section provides a very brief explanation of these templates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
{{Note|Template files may seem complex. Besides HTML, you might also need to understand CSS.}}&lt;br /&gt;
&lt;br /&gt;
=The LimeSurvey template editor= &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
To ease the understanding and quick update of a Template, LimeSurvey provides a &#039;&#039;&#039;Template Editor&#039;&#039;&#039; in the main &#039;&#039;&#039;administrative&#039;&#039;&#039; toolbar of the application. This Template Editor is only available to users [[Manage users#Set global permissions for a user|with the Templates permission]] and to superadministrators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:297--&amp;gt;&lt;br /&gt;
{{Alert|title=Attention|text=A template that is not correctly constructed can render a survey (that uses the respective template) inoperable. }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
The LimeSurvey template editor allows you to edit the contents of your templates online. Start the Template Editor by clicking on &#039;&#039;&#039;Template editor&#039;&#039;&#039; in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; menu. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:285--&amp;gt;&lt;br /&gt;
[[File:templates.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:286--&amp;gt;&lt;br /&gt;
The template editor page allows you to select the template you would like to edit/view. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:279--&amp;gt;&lt;br /&gt;
[[File:Template-editor-2013-7-10_11_38_16.png|center]]&lt;br /&gt;
&lt;br /&gt;
==The template menu== &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:298--&amp;gt;&lt;br /&gt;
The following options are available:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:280--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Create&#039;&#039;&#039;: Allows you to create a new template. In order not to start from scratch, the template &#039;default&#039; is copied.&lt;br /&gt;
*&#039;&#039;&#039;Import&#039;&#039;&#039;: Allows you to import a template from a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Export&#039;&#039;&#039;: Allows you to export the current template to a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Copy&#039;&#039;&#039;: Allows you to make a new template by copying the current one.&lt;br /&gt;
*&#039;&#039;&#039;Rename&#039;&#039;&#039;: Allows you to change the name of the template. It is generally used after copying or importing a template.&lt;br /&gt;
*&#039;&#039;&#039;Template&#039;&#039;&#039;: It is a drop-down list that shows all the available templates that are located in your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Screen&#039;&#039;&#039;: It is a drop-down list which allows you to choose which particular survey page of that template you want to look at.&lt;br /&gt;
*&#039;&#039;&#039;Return to admin panel&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Import/export/copy a template== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
When you &#039;&#039;&#039;export &#039;&#039;&#039;a template, a ZIP-file archive with all the files your template consists of will be created (.pstpl files, images, css files, ...). You can simply &#039;&#039;&#039;import&#039;&#039;&#039; the exported zip-file into another LimeSurvey installation by using the import feature or you can manually copy the archive into another LimeSurvey installation and extract it into the corresponding [[Theme editor#Template files location|template directory there]]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:288--&amp;gt;&lt;br /&gt;
However, it is preferred to use the LimeSurvey template import/export/copy functions in the template editor.&lt;br /&gt;
&lt;br /&gt;
==Page Structure / Template Use== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;The Welcome Page:&#039;&#039;&#039; startpage.pstpl, welcome.pstpl, privacy.pstpl,  navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Questions Pages:&#039;&#039;&#039; startpage.pstpl, survey.pstpl, startgroup.pstpl, groupdescription.pstpl, question.pstpl, endgroup.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Final Page:&#039;&#039;&#039; startpage.pstpl, assessment.pstpl, completed.pstpl, endpage.pstpl&lt;br /&gt;
&lt;br /&gt;
==Template Files== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The following template files are used to produce your public survey and must exist in any new template folder you create:&lt;br /&gt;
*&#039;&#039;&#039;startpage.pstpl:&#039;&#039;&#039; Produces the start of each html page. It starts at the &amp;quot;&amp;lt;head&amp;gt;&amp;quot; tag, and should not contain the &amp;quot;&amp;lt;html&amp;gt;&amp;quot; tag. This &#039;very beginning&#039; of a standard html page is written by the scripts. Please ensure that your startpage.pstpl files contains a &amp;lt;body&amp;gt; tag. Even though many browsers do not require strict adherence to the W3 HTML standards, the LimeSurvey script needs to find a &amp;lt;body&amp;gt; tag to run certain javascript elements. It is not expected to see many &#039;keywords&#039; used in the startpage.pstpl file. However, you may wish to put the {SURVEYNAME} into the title. The startpage.pstpl file can contain code that ends in the corresponding endpage.pstpl file. For example, you can start a table in this file and close the table in the endpage.pstpl file. The startpage.pstpl and endpage.pstpl files wrap around every possible page used by LimeSurvey.&lt;br /&gt;
*&#039;&#039;&#039;survey.pstpl:&#039;&#039;&#039; This template is the second used on most pages and provides a space to put the survey name and description. This template does not have a corresponding &#039;closing&#039; template, and subsequently you should close all tags opened in this template file (i.e.: don&#039;t leave a table open here because there is nowhere else to close it).&lt;br /&gt;
*&#039;&#039;&#039;welcome.pstpl:&#039;&#039;&#039; This template is only used in the welcome screen (which is also on the main page for &#039;all in one&#039; surveys). You can use this to print out the welcome text, and other information that should be provided in the introduction. Like the &#039;survey.pstpl&#039; file, there is no corresponding &#039;closing&#039; template, so all tags opened in this template file should be closed as well.&lt;br /&gt;
*&#039;&#039;&#039;startgroup.pstpl:&#039;&#039;&#039; This template can provide a &#039;summary&#039; wrap around for questions within a group. It has a matching &#039;endgroup.pstpl&#039; template that can be used to close any opened tags in this file, so you can open a table within this.&lt;br /&gt;
*&#039;&#039;&#039;groupdescription.pstpl:&#039;&#039;&#039; This template file is used to display a description of a group. Please note that in the survey settings (access the &#039;&#039;Presentation &amp;amp; navigation settings&#039;&#039; by clicking on the &#039;&#039;&#039;Presentation&#039;&#039;&#039; tab) you can set if the group description should be shown or not. If not, then this file is not included at all.&lt;br /&gt;
*&#039;&#039;&#039;question.pstpl:&#039;&#039;&#039; This file contains the question, answer, and help text sections of your survey. In the &amp;quot;group by group&amp;quot; and &amp;quot;all in one&amp;quot; surveys, this template is cycled repeatedly with each question. There is no corresponding closing file for this and all tags should be closed.&lt;br /&gt;
*&#039;&#039;&#039;question_start.pstpl:&#039;&#039;&#039; This file contains the individual elements found at the start of a question. It is included within &#039;question.pstpl&#039; via the {QUESTION} keyword. It is intended to allow template designers more control over the layout of a question. This template sits outside the normal templating system and &#039;&#039;&#039;was superseeded (as of LimeSurvey 1.87)&#039;&#039;&#039;. All keywords from this template are now available directly in question.pstpl. &lt;br /&gt;
*&#039;&#039;&#039;completed.pstpl:&#039;&#039;&#039; This page is displayed as the final page when the survey responses have been saved and the survey is over. It can be used to display a &amp;quot;forwarding link&amp;quot; as set in the survey setup.&lt;br /&gt;
*&#039;&#039;&#039;endgroup.pstpl:&#039;&#039;&#039; This file closes the group, and can be used to close off any tags opened in the startgroup.pstpl file&lt;br /&gt;
*&#039;&#039;&#039;navigator.pstpl:&#039;&#039;&#039; This file contains the buttons that navigate through the survey, &amp;quot;next&amp;quot;, &amp;quot;prev&amp;quot;, &amp;quot;last&amp;quot;, &amp;quot;submit&amp;quot;, &amp;quot;save so far&amp;quot;  and the &amp;quot;clear all&amp;quot; link. It is used in all pages except the completed page.&lt;br /&gt;
*&#039;&#039;&#039;printanswers.pstpl:&#039;&#039;&#039; This file has the HTML wrapper necessary for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_group.pstpl:&#039;&#039;&#039; This file is the same as startgroup.pstpl and endgroup.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_question.pstpl:&#039;&#039;&#039; This file is the same as question.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_survey.pstpl:&#039;&#039;&#039; This file is the same as survey.pstpl, but for the print version of the survey.&lt;br /&gt;
&lt;br /&gt;
== CSS and Javascript== &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
Two files that are always used in a template are template.css (for CSS) and template.js (for Javascript).&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATECSS}:&#039;&#039;&#039; Add lines for default css, template.css, and template-rtl.css for rtl language.&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATEJS}:&#039;&#039;&#039; Add lines for default javascript files, template.js, and all js files needed for LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
=== Using Bootstrap=== &amp;lt;!--T:294--&amp;gt;&lt;br /&gt;
LimeSurvey has Bootstrap 3 embedded, so you can style all your templates with the well documented Bootstrap classes.&lt;br /&gt;
For more information please refer to the [https://getbootstrap.com Bootstrap documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:295--&amp;gt;&lt;br /&gt;
The [https://github.com/flatlogic/awesome-bootstrap-checkbox Awesome-Bootstrap-Checkbox] plugin is also included. With it, you can use the typical Bootstrap color-classes (info,warning,danger,etc.) also with the suffix &amp;quot;-checkbox&amp;quot; or &amp;quot;-radio&amp;quot;, though styling checkboxes and radios as you prefer.&lt;br /&gt;
&lt;br /&gt;
=== Replacing default CSS or Javascript=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Some questions use specific files for Javascript or CSS. If you need to replace a function, use a cascading system. For javascript function, the last function read is the function used.&lt;br /&gt;
&lt;br /&gt;
==Other Template Files== &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The &#039;&#039;&#039;privacy.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;invitationemail.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;reminderemail.pstpl&#039;&#039;&#039;, and &#039;&#039;&#039;confirmationemail.pstpl&#039;&#039;&#039; are no longer used by LimeSurvey and defaults are instead set in the applicable language files. The email messages can now be edited on a survey by survey basis.&lt;br /&gt;
&lt;br /&gt;
==Standard Pages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
There are ten standard pages that a survey participant may see in the course of taking or accessing the LimeSurvey application.  Each is constructed from a number of common &#039;&#039;&#039;Template&#039;&#039;&#039; files from the &#039;&#039;&#039;Template&#039;&#039;&#039; specified in the settings of the survey. The table below indicates which template files are used in constructing each of these pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!  &#039;&#039;&#039;Survey Pages/&#039;&#039;&#039;&amp;lt;br /&amp;gt;&#039;&#039;&#039;Template Files&#039;&#039;&#039;!!Survey&amp;lt;br /&amp;gt;List!!Welcome!!Question!!Completed!!Clear All!!Register!!Load!!Save!!Print&amp;lt;br /&amp;gt;Answers!!Print&amp;lt;br /&amp;gt;Survey&lt;br /&gt;
|-&lt;br /&gt;
|SurveyList||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Welcome|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Privacy|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Navigator|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Survey|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|StartGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|GroupDescription|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Question&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|EndGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Assessment|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Completed|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ClearAll|| || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Register|| || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Load|| || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||&lt;br /&gt;
|-&lt;br /&gt;
|Save|| || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| ||&lt;br /&gt;
|-&lt;br /&gt;
|PrintAnswers|| || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||&lt;br /&gt;
|-&lt;br /&gt;
|Print Survey || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Group || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Question || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|StartPage&amp;lt;br /&amp;gt;EndPage&amp;lt;br /&amp;gt;Template.css||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.90+, this replaces question.pstpl AND question_start.pstpl. If you are using an old custom template, you need to add the following line to the beginning of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div {QUESTION_ESSENTIALS} class=&amp;quot;{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;And then add the corresponding closing tag to the end of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.91 and earlier, LimeSurvey js files are not included in the template. In version 2, &#039;&#039;&#039;you have to use {TEMPLATEJS} in one of your template file&#039;&#039;&#039; to add the link to the js file. You can add it in startpage.pstpl or in endpage.pstpl. You can remove the {TEMPLATEURL}/template.js line and you have to replace with {TEMPLATEJS} to update a personal template.&lt;br /&gt;
&lt;br /&gt;
==The File Control Section== &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
In the &amp;quot;file control&amp;quot; window on the left, you can click on one of the template files that is used to compile the page. You can see the &#039;&#039;Screen part&#039;&#039;, JavaScript, and CSS files. The HTML code for that file will then appear in the &amp;quot;Now editing&amp;quot; window in the center. If the template is editable (determined by directory permissions) you can then make any changes and save them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:299--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:File Control Section.png|center]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The &amp;quot;Other files&amp;quot; window shows a list of all other files from the template directory. You can use the right side to &#039;&#039;&#039;upload and select image files (your pics, logos,...) or other files needed to create your template&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:300--&amp;gt;&lt;br /&gt;
Instead of using a link for each picture, utilize the field string {TEMPLATEURL}. So, instead of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;/limesurvey/templates/yourtemplate/files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
You can use {{NewIn|2.50}}:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:287--&amp;gt;&lt;br /&gt;
In LimeSurvey versions before 2.50 use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
A &amp;quot;sample&amp;quot; of the template page you are editing will be visible in the bottom of the screen. There is no way to delete a template from the template editor. This must be done by accessing the underlying directory and deleting manually the files from there. You also have the possibility to select different screen resolutions in order to better evaluate the feel and look of the template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The shipped templates cannot be edited using the template editor. If you want to modify them, create a copy first and edit the copy.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Template files location== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
LimeSurvey stores each of the &#039;standard&#039; templates in their own distinct sub-directory within the &#039;&#039;/templates&#039;&#039; directory that is kept in the public directory with the other LimeSurvey public files. Customized user templates are stored in the &#039;&#039;/upload/templates&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
There should &#039;&#039;&#039;ALWAYS&#039;&#039;&#039; be a &amp;quot;default&amp;quot; directory in the templates directory. This template is used by default and as a fall-back if a template folder doesn&#039;t exist, or can&#039;t be found. It comes installed by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
You can use any image files that you upload into the template management area with the help of this syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{TEMPLATEURL}filename.xyz&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Styling questions with CSS= &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
Styling of questions in CSS has become much easier. Each question type has now a unique class. The mandatory questions have an additional mandatory class. For example, for a non-mandatory question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
and if the question is mandatory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
and if the question is mandatory, but the user didn&#039;t answer it or if there is validation on a question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
and if the question has validation applied, but the user hasn&#039;t answered correctly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question6&amp;quot; class=&amp;quot;text-short input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Global classes for question part== &amp;lt;!--T:273--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:274--&amp;gt;&lt;br /&gt;
These classes are used for each question type. Some question types use only one or two classes, while others may use much more.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:281--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable alternance&amp;quot;&lt;br /&gt;
|+ Global classes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Class name&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Part&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Question type&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Examples&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Note&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question {{ObsoleteIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;p class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;question&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-answers {{NewIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;div class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;ls-answers&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .subquestions-list&lt;br /&gt;
| List of subquestion&lt;br /&gt;
| Multi choice question, array question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;subquestions-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;subquestions-list&amp;quot;&amp;gt;&lt;br /&gt;
| .questions-list is used too&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answers-list&lt;br /&gt;
| List of answers&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;answers-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;answers-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answer-item&lt;br /&gt;
| The answer part: one answer&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;answer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;answer-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .noanswer-item&lt;br /&gt;
| The answer part for no answer&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;noanswer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
| No answer is an answer too, then have double class noanswer-item and answer-item&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question-item&lt;br /&gt;
| The question part: one question&lt;br /&gt;
| Multi text question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;question-item&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;question-item&amp;quot;&amp;gt;&lt;br /&gt;
| Some answers are questions too. Then we have a lot of class=&amp;quot;question-item answer-item&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-list&lt;br /&gt;
| A list of checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;checkbox-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| Some question types use multi-list class, like checkbox with comment: class=&amp;quot;checkbox-list text-list&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of checkbox&lt;br /&gt;
| Array (numbers) with checkbox option&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-item&lt;br /&gt;
| The answer part with a checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;checkbox-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;checkbox-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-list&lt;br /&gt;
| A list of radio item&lt;br /&gt;
| Single choice question, array question type (each row)&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;radio-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;radio-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-array {{NewIn|3.0}}&lt;br /&gt;
| A array of radio item&lt;br /&gt;
| Array question type&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;radio-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-item&lt;br /&gt;
| The answer part with a radio&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;radio-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;radio-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-list&lt;br /&gt;
| A list of text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-item&lt;br /&gt;
| The answer part of a text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;text-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;text-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .numeric-list&lt;br /&gt;
| A list of text input with numeric only answer&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-list&lt;br /&gt;
| A list of text input with numeric only answer (each row)&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-array  {{NewIn|3.0}}&lt;br /&gt;
| The answer part of a numeric input&lt;br /&gt;
| Array of number&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;number-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-list  {{ObsoleteIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;select-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-list  {{NewIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select) (each row)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of dropdown&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-item  {{ObsoleteIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;select-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;select-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-item  {{NewIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;dropdown-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;dropdown-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .hide  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Used for accessibility: hidden with css but read by screenreader, since 2.50 : you can use sr-only from bootstrap&lt;br /&gt;
| Short text question&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;hide&amp;quot;&amp;gt;&lt;br /&gt;
| Can be used for other purposes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is activated&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it, but you can use it too in your template&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden-sr {{NewIn|3.0}}&lt;br /&gt;
| Used for accessibility: hide it if js is activated, but always show if user use a screenreader&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-js-hidden-sr&amp;quot;&amp;gt;&lt;br /&gt;
| Button&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-no-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is not activated&lt;br /&gt;
| Link&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it for inactive link if javascript is not activated&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-label-xs-visibility {{NewIn|3.0}}&lt;br /&gt;
|  Label to be hidden in big screen, but show with little screen (with no more table) and to screenreader&lt;br /&gt;
| label&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| Used for label inside table cell of array question type&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-input-group-extra {{NewIn|3.0}}&lt;br /&gt;
| Same usage of boostrap input-group-addon, but without the border and the background.&lt;br /&gt;
| right suffix&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-input-group-extra&amp;quot;&amp;gt;&lt;br /&gt;
| Used for right and left suffix (global)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=checkbox]&lt;br /&gt;
| Question with checkbox&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;checkbox&amp;quot; class=&amp;quot;checkbox&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=radio]&lt;br /&gt;
| Question with radio&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;radio&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text&lt;br /&gt;
| input[type=text]&lt;br /&gt;
| Question with input text, or textarea&lt;br /&gt;
| &amp;amp;lt;textarea class=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answertext&lt;br /&gt;
| Array question type&lt;br /&gt;
| Answer part of array question type&lt;br /&gt;
| &amp;amp;lt;th class=&amp;quot;answertext&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .col-answers&lt;br /&gt;
| Array question type&lt;br /&gt;
| Column of answers&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .odd .even {{ObsoleteIn|2.50}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for column&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .array1 .array2  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for line&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;array1&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-odd .ls-even  {{NewIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for sub-question and Y axis&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;ls-odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Some example of question part with classes=== &amp;lt;!--T:275--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:276--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Text-short question type:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;question answer-item text-item &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;label class=&amp;quot;hide label&amp;quot; for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Answer&amp;lt;/label&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;50&amp;quot; class=&amp;quot;text  empty&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:277--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Multiple short text&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;subquestions-list questions-list text-list&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li class=&amp;quot;question-item answer-item text-item&amp;quot; id=&amp;quot;javatbdSGQA&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;label for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Some example subquestion&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;span&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;20&amp;quot; class=&amp;quot;text empty&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:282--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Array question type&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;question subquestion-list questions-list &amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;caption class=&amp;quot;hide read&amp;quot;&amp;gt;Some explanation for accessibility.&amp;lt;/caption&amp;gt;&lt;br /&gt;
	&amp;lt;colgroup class=&amp;quot;col-responses&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;50%&amp;quot; class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;25%&amp;quot; class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;13.3%&amp;quot; class=&amp;quot;col-no-answer even&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;/colgroup&amp;gt;&lt;br /&gt;
	&amp;lt;thead&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array1 dontread&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;1&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;No answer&amp;lt;/th&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/thead&amp;gt;&lt;br /&gt;
	&amp;lt;tbody&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array2 answers-list radio-list&amp;quot; id=&amp;quot;javatbdSGQ&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;20%&amp;quot; class=&amp;quot;answertext&amp;quot;&amp;gt;Some example subquestion&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer_cell_001 answer-item radio-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;1&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer-item radio-item noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;No answer&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The full list of question classes== &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Question Type&#039;&#039;&#039;||&#039;&#039;&#039;Question Class&#039;&#039;&#039;||&#039;&#039;&#039;Question ID&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|5 point choice||.choice-5-pt-radio||5&lt;br /&gt;
|-&lt;br /&gt;
|Array (10 point choice)||.array-10-pt||B&lt;br /&gt;
|-&lt;br /&gt;
|Array (5 point choice)||.array-5-pt||A&lt;br /&gt;
|-&lt;br /&gt;
|Array (Flexible Labels) dual scale||.array-flexible-duel-scale ||1&lt;br /&gt;
|-&lt;br /&gt;
|Array (Increase, Same, Decrease)||.array-increase-same-decrease||E&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Numbers)||.array-multi-flexi ||:&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Text)||.array-multi-flexi-text||;&lt;br /&gt;
|-&lt;br /&gt;
|Array (Yes/No/Uncertain)||.array-yes-uncertain-no||C&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels)||.array-flexible-row ||F&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels) by column||.array-flexible-column||H&lt;br /&gt;
|-&lt;br /&gt;
|Boilerplate question||.boilerplate||X&lt;br /&gt;
|-&lt;br /&gt;
|Date||.date||D&lt;br /&gt;
|-&lt;br /&gt;
|Gender||.gender||G&lt;br /&gt;
|-&lt;br /&gt;
|Huge free text||.text-huge||U&lt;br /&gt;
|-&lt;br /&gt;
|Language switch||.language||I&lt;br /&gt;
|-&lt;br /&gt;
|List (dropdown)||.list-dropdown||!&lt;br /&gt;
|-&lt;br /&gt;
|List (radio)||.list-radio||L&lt;br /&gt;
|-&lt;br /&gt;
|List with comment||.list-with-comment||O&lt;br /&gt;
|-&lt;br /&gt;
|Long free text||.text-long||T&lt;br /&gt;
|-&lt;br /&gt;
|Multiple numerical input||.numeric-multi||K&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options||.multiple-opt||M&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options with comments||.multiple-opt-comments||P&lt;br /&gt;
|-&lt;br /&gt;
|Multiple short text||.multiple-short-txt||Q&lt;br /&gt;
|-&lt;br /&gt;
|Numerical input||.numeric||N&lt;br /&gt;
|-&lt;br /&gt;
|Ranking||.ranking||R&lt;br /&gt;
|-&lt;br /&gt;
|Short free text||.text-short||S&lt;br /&gt;
|-&lt;br /&gt;
|Yes/No||.yes-no||Y&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==The full list of validation classes== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Note:  Prior to 1.92, only .mandatory and .input-error classes were available.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
These apply to the help and/or validation tip messages so that each type can be individually styled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
The .hide-tip option and .input-error options interact by default so that you can have validation tips hidden. However, they do appear when there are validation errors and disappear again when those errors are rectified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
All of these are designed to eliminate the need for pop-up alert messages. Instead, tips can appear/disappear as needed and are color-coded to indicate whether the answers pass the validation criteria.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Furthermore, when you first visit a page that has unmet validation criteria, you can color-code the tips in a pleasing color to show which validation criteria have not been met yet; then re-display the page using a harsher color if the person submits the page with lingering validation errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Purpose&#039;&#039;&#039;||&#039;&#039;&#039;CSS Class&#039;&#039;&#039;||&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Mandatory||.mandatory||the question is mandatory&lt;br /&gt;
|-&lt;br /&gt;
|User input error||.input-error||the question had at least one validation error&lt;br /&gt;
|-&lt;br /&gt;
|Hide Tip||.hide-tip||added if you use the hide_tip option&lt;br /&gt;
|-&lt;br /&gt;
|Num answers||.em_num_answers||for for min_answers and max_answers&lt;br /&gt;
|-&lt;br /&gt;
|Value range||.em_value_range||for min/max_num_value_n and multiflexible_min/max&lt;br /&gt;
|-&lt;br /&gt;
|Sum range||.em_sum_range||for min/max/equals_num_value&lt;br /&gt;
|-&lt;br /&gt;
|Regex validation||.em_regex_validation||for regular-expression validation of the question&lt;br /&gt;
|-&lt;br /&gt;
|Question-level validation function||.em_q_fn_validation||for the em_validation_q option&lt;br /&gt;
|-&lt;br /&gt;
|Subquestion-level validation function||.em_sq_fn_validation||for the em_validation_sq option&lt;br /&gt;
|-&lt;br /&gt;
|Other comment mandatory||.em_other_comment_mandatory||for other_comment_mandatory option - shows when &amp;quot;other&amp;quot; is selected but associated comment is missing.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing styles into your custom template== &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
The custom question styles are near the bottom of each template&#039;s CSS file and start with:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;/* --------------------------- START: Question styles  ------------------------------ */&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
If you&#039;re styling your own custom template, you should be able to copy everything after the above one from &#039;&#039;templates/default/template.css&#039;&#039; (for table-based layouts) or &#039;&#039;/templates/limespired/template.css&#039;&#039; (for CSS-based layouts) into your own style sheet without any impact on your other styles.&lt;br /&gt;
&lt;br /&gt;
==Internet Explorer conditional style sheets== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
Because of the marked discrepancies in rendering between IE6 &amp;amp; IE7 and the other browsers, there are special IE conditional style sheets included for each template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_all-versions.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if lt IE 7]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_older-than-7.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8]&amp;gt;&lt;br /&gt;
		&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}ie_fix_8.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You should include the above code within your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; and copies of both the IE style sheets from either &#039;&#039;/templates/default/&#039;&#039; or &#039;&#039;/templates/limespired&#039;&#039; for Tables base layout and CSS based layout respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; If you copy the styles into your own style sheet you will almost certainly need to tweak them.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alternative solution for Internet explorer=== &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
You can put a conditional class for body in startpage.pstpl and use this class in your template.css. This method is used in the citronade template{{ObsoleteIn|2.06}}. Adding a js / no-js class to have javascript / no javascript system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;!--[if lt IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie6 ielt7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie8 ielt9  no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 9 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if gt IE 9]&amp;gt;&amp;lt;!--&amp;gt;&amp;lt;body id=&amp;quot;body&amp;quot; class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} no-js&amp;quot;&amp;gt;&amp;lt;!--&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;script type=&#039;text/javascript&#039;&amp;gt;/*&amp;lt;![CDATA[*/(function(H){ H.className=H.className.replace(/\bno-js\b/,&#039;js&#039;) })(document.getElementsByTagName(&#039;body&#039;)[0]);/*]]&amp;gt;*/&amp;lt;/script&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
And in template.css use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;.ie6{/*specific for internet explorer 6*/}&lt;br /&gt;
.ielt8{/*specific for internet explorer 6 and 7*/}&lt;br /&gt;
.ie{/*specific for all internet explorer */}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Right-to-Left (RTL) Languages and justify== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
The text editor within LimeSurvey is able to format RTL text. However, the editor itself shows the RTL language in a left to right format when justified. This is just an editor display issue. The RTL and justified question or text will display correctly from right to left, even when justified, in your survey or on preview.&lt;br /&gt;
&lt;br /&gt;
==Keywords== &amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:309--&amp;gt;&lt;br /&gt;
{{Deprecated|3.0}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
Keywords within a template file get replaced by the current survey information. They are surrounded by curly brackets, for example: {SURVEYNAME}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
The following strings will be replaced by LimeSurvey when parsing the template file and presenting it to survey users. These field strings will work on almost every template except for the &#039;Completed Page&#039;. (Most of these strings can be found in the common.php file. If it&#039;s not there, look in the index.php file.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!&#039;&#039;&#039;Keyword&#039;&#039;&#039;!!&#039;&#039;&#039;Template files&#039;&#039;&#039;!!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYNAME}||All Files||The survey title&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYDESCRIPTION}||All Files||The survey description&lt;br /&gt;
|-&lt;br /&gt;
|{WELCOME}||All files (mainly for welcome.pstpl)||The survey &#039;welcome&#039; text&lt;br /&gt;
|-&lt;br /&gt;
|{PERCENTCOMPLETE}||survey.pstpl||A small graph showing the percentage of the survey completed&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPNAME}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group name&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPDESCRIPTION}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group description&lt;br /&gt;
|-&lt;br /&gt;
|{NUMBEROFQUESTIONS}||welcome.pstpl||Displays the total number of questions in the survey (just the number)&lt;br /&gt;
|-&lt;br /&gt;
|{THEREAREXQUESTIONS}||welcome.pstpl||Displays the sentence &amp;quot;There are X questions in this survey&amp;quot; - from the relevant language file. The X is replaced with the number of questions. Note that this will also work appropriately for singular or plural. If there is only 1 question, it will print &amp;quot;There is 1 question in this survey&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|{CHECKJAVASCRIPT}||All files (mainly for welcome.pstpl)||Warning message when end-user browser have javascript disabled&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION}||Question.pstpl||(&#039;&#039;&#039;Has been superseeded as of LS1.87&#039;&#039;&#039;) Displays the current question text (The format of {QUESTION} can customised by editing &#039;question_start.pstpl&#039;) Use the following: {QUESTION_TEXT}, {QUESTION_MANDATORY}, {QUESTION_HELP}, {QUESTION_MAN_MESSAGE}, {QUESTION_VALID_MESSAGE}, {QUESTION_INPUT_ERROR_CLASS}, and appropriate wrapping HTML instead of {QUESTION}&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWER}||question.pstpl, print_question.pstpl||presents the answer form for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{SGQ}||question.pstpl, question text||Can be used in the question text itself to reference the input field of the question dynamically by displaying the Survey-Group-Question id for the current question. (as of svn build 9755)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTIONHELP}||question.pstpl, print_question.pstpl||Displays help text (predefined tip for question type) for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CLASS}||question.pstpl, print_question.pstpl||unique class for each question type. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CODE}||question.pstpl, print_question.pstpl||Displays the current question code&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ESSENTIALS}||question.pstpl||the question ID and (if a question is conditional), &#039;style=&amp;quot;display:none;&amp;quot;&#039;. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_HELP}||question.pstp, question_start.pstpl||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TYPE_HELP}||print_question.pstp||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_INPUT_ERROR_CLASS}||question.pstp, question_start.pstpl||Provides a class if there was user input error&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ID}||print_question.pstp||Provides a unique ID for each question to allow styling for specific questions&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TEXT}||question.pstp, print_question.pstp, question_start.pstpl||Displays the text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MANDATORY}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_CLASS}||question.pstpl, print_question.pstpl||class if a question is mandatory. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_NUMBER}||print_question.pstpl||Incremental count of questions.&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_VALID_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated valid help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_SCENARIO}||print_question.pstp||Prints out the &#039;scenario&#039; text for conditional questions.&lt;br /&gt;
|-&lt;br /&gt;
|{NAVIGATOR}||navigator.pstpl||Displays navigation buttons (next, prev, last)&lt;br /&gt;
|-&lt;br /&gt;
|{CLEARALL}||All files (but intended for navigator.pstpl)||Displays the &amp;quot;Exit and Clear Results&amp;quot; link&lt;br /&gt;
|-&lt;br /&gt;
|{COMPLETED}||completed.pstpl||Displays the &#039;completed&#039; message for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{URL}||completed.pstpl||Displays the survey &#039;url&#039; and &#039;url text&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{PRIVACYMESSAGE}||privacy.pstpl||The privacy message is shown if you set your survey to be anonymous. [[Translating LimeSurvey|The text can be edited/translated]] in the language files. This can also be changed manually by editing the privacy.pstpl template you wish to use.&lt;br /&gt;
|-&lt;br /&gt;
|{TEMPLATEURL}||All Files||The URL to the current template location (useful for referencing image files in your template)&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYRESOURCESURL}||All Files||The URL to the current uploaded files for this survey location (useful for referencing image files in your question, group, ....)&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITCOMPLETE}||endpage.pstpl||The statement (from the language files) that tells the user they have completed the survey, and to press the &amp;quot;Submit&amp;quot; button&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITREVIEW}||survey.pstpl||The statement (from the language files) that tells the user they can review/change the answers they have made by clicking &amp;quot;&amp;lt;&amp;lt; prev&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{SAVEDID}||All Files||Displays &#039;Response ID&#039; of user&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|{QUEXMLPDF}||All Files||Displays button to export the queXML PDF of questionnaire including answers entered up until the point that has been completed in the survey.&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:FIRSTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users first name from the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:LASTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users last name from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:EMAIL}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users email from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_1}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_1 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_2}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_2 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWERSCLEARED}||Preferably in navigator.pstpl||The &amp;quot;Answers Cleared&amp;quot; statement from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{RESTART}||clearall.pstpl||URL to restart the survey&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERERROR}||register.pstpl||Shows any error messages in the register page (ie: &amp;quot;You must include an email address&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE1}||register.pstpl||The statement &amp;quot;You must be registered to complete this survey&amp;quot; from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE2}||register.pstpl||Details about registering from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERFORM}||register.pstpl||The actual form for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{SAVE}||Works suitable on navigator.pstpl||Displays the &#039;Save your responses so far&#039; button to offer the user to save and come back later to continue the survey. If the Save option is deactivated in the survey properties the tag will not be shown and ignored.&lt;br /&gt;
|-&lt;br /&gt;
|{LANGUAGECHANGER}||survey.pstpl||Displays a switch in multilingual surveys to change the question.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Input/Buttons== &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
Each &amp;quot;input&amp;quot; type in a survey has been given its own class name, so that you can add CSS to your &amp;quot;startpage.pstpl&amp;quot; file and have some control over the appearance of form buttons and inputs. These class names are as follows:&lt;br /&gt;
*&#039;&#039;&#039;submit&#039;&#039;&#039; (Submit Buttons)&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; (Text Inputs - for short free text, date, and numerical type)&lt;br /&gt;
*&#039;&#039;&#039;answertext&#039;&#039;&#039; (Text of answers)&lt;br /&gt;
*&#039;&#039;&#039;radio&#039;&#039;&#039; (Radio Buttons)&lt;br /&gt;
*&#039;&#039;&#039;checkbox&#039;&#039;&#039; (Check Boxes)&lt;br /&gt;
*&#039;&#039;&#039;select&#039;&#039;&#039; (Select / List Boxes)&lt;br /&gt;
*&#039;&#039;&#039;textarea&#039;&#039;&#039; (Large text inputs - for long free text)&lt;br /&gt;
*&#039;&#039;&#039;clearall&#039;&#039;&#039; (The &amp;quot;Exit and Clear Survey&amp;quot; link)&lt;br /&gt;
*&#039;&#039;&#039;rank&#039;&#039;&#039; (The rank style question. Doesn&#039;t set the colour of the select box or the text boxes, but it does allow the changing of background colour, text colour, size etc., for the rest of the ranking question)&lt;br /&gt;
*&#039;&#039;&#039;graph&#039;&#039;&#039; (The &amp;quot;percentage completed&amp;quot; graph table)&lt;br /&gt;
*&#039;&#039;&#039;innergraph&#039;&#039;&#039; (The table inside the graph table - this contains the 0% and 100% text. Use this for changing the size of this text)&lt;br /&gt;
*&#039;&#039;&#039;question&#039;&#039;&#039; (General settings for any question that is displayed within a table. Generally, you should use this to make sure that their font size and color is the same as you have used elsewhere as a default)&lt;br /&gt;
*&#039;&#039;&#039;mandatory&#039;&#039;&#039;  (Mandatory questions)&lt;br /&gt;
*&#039;&#039;&#039;input-error&#039;&#039;&#039; (User input error - for if a user has made a mistake with a mandatory question or question with validation)&lt;br /&gt;
*&#039;&#039;&#039;array1&#039;&#039;&#039; and &#039;&#039;&#039;array2&#039;&#039;&#039; (These two styles are cycled when presenting the range of answers for an array type question. This allows you to set an alternating background color for these question types. &#039;&#039;&#039;Array1&#039;&#039;&#039; is also used for the column headings in these question types)&lt;br /&gt;
*&#039;&#039;&#039;errormandatory&#039;&#039;&#039; (Sets the color and style of the &amp;quot;This question is mandatory&amp;quot; error message)&lt;br /&gt;
*&#039;&#039;&#039;warningjs&#039;&#039;&#039; (Sets the color and style of the warning message displayed if the participant&#039;s browser has javascript disabled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
There are also some elements that can be accessed using the ID of the element (&#039;&#039;&#039;#ID&#039;&#039;&#039; in CSS):&lt;br /&gt;
*&#039;&#039;&#039;surveycontact&#039;&#039;&#039; (The contact message shown on the start page)&lt;br /&gt;
*&#039;&#039;&#039;tokenmessage&#039;&#039;&#039; (used for messages inside the survey, e.g. the session expired error message)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
Because you can edit all the HTML aspects, there&#039;s no reason to surround your templates with a &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&#039;new_name&#039;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and then define a css for that new_name class.&lt;br /&gt;
&lt;br /&gt;
==Styling the progress bar== &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
The progress bar appearance can be modified with CSS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
To change the background color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-header {&lt;br /&gt;
 background-color: #3300FF;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
To change the border color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-content,&lt;br /&gt;
#progress-wrapper .ui-widget-header {&lt;br /&gt;
 border: 1px solid #FF0000;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Features Available to Developers== &amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
LimeSurvey has integrated some user-made patches that permits some special changes. These very advanced features (generally) require changes to the underlying code base of LimeSurvey and should be done carefully in order not to introduce security holes.&lt;br /&gt;
&lt;br /&gt;
===Support for your own Javascript functions=== &amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Some users may need to run Javascript on the survey pages, but calling &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; in the BODY element made it impossible to do so. This call has been replaced with a small JavaScript function in the HEAD that sniffs for the existence of &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; and &#039;&#039;&#039;template_onload()&#039;&#039;&#039; before calling them. In this way, a template author can create his or her own &#039;&#039;&#039;template_onload()&#039;&#039;&#039; function in the HEAD that replaces the default one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
*Disable XSS filter - in Global settings -&amp;gt; Security, set &amp;quot;Filter HTML for XSS&amp;quot; to No.&lt;br /&gt;
*Enter your script in the source of a question or group description.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:301--&amp;gt;&lt;br /&gt;
{{Note|For further details, see the [[Workarounds: Manipulating a survey at runtime using Javascript#How to use Script (eg. JavaScript etc.) in LimeSurvey|workaround section]].}}&lt;br /&gt;
&lt;br /&gt;
=Videos on Templates= &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
This video will demonstrate the basic and advanced template functions that are available to all LimeSurvey users. This includes changing the appearance of certain forms and inserting custom graphics. Additionally, it will thoroughly walk you through on how to edit and preview specific page templates, importing/exporting templates, modify appearance of questions in the CSS, and customizing survey description page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:302--&amp;gt;&lt;br /&gt;
Video - needed&lt;br /&gt;
&lt;br /&gt;
=Tips &amp;amp; Tricks= &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some language specific element== &amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
If you want to have some language specific sentence in a survey, for example a help at the end of each page, you can add in a .pstl file a sentence and hidding it for other language. If we hide it in the template.css, we can use the pseudo selector :lang, but we use some class for better compatibility.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
Below, there are two help sentences, in French and English. Put this on endpage.pstpl:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;fr&amp;quot; lang=&amp;quot;fr&amp;quot;&amp;gt;Pour de l&#039;aide en direct appelez le 000000&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;For some help, please call 000000&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
and in template.css:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:152--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.lang-fr .en{display:none}&lt;br /&gt;
.lang-en .fr{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change the layout of the survey page== &amp;lt;!--T:155--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:156--&amp;gt;&lt;br /&gt;
After editing and saving a template, it applies to a survey list page only if it is selected from the settings of the survey. To make it the default template, go under the &#039;&#039;&#039;General tab&#039;&#039;&#039; located in the &#039;&#039;&#039;Global settings&#039;&#039;&#039; of your LimeSurvey installation and choose the desired template. From now on, all the templates that use the &amp;quot;default&amp;quot; option as template plus the ones that are going to be newly created, will use the newly selected default template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
To use your current template for this page, you have to change the according setting from &#039;&#039;&#039;Global settings&#039;&#039;&#039;. In older versions, this change can be done by editing the $defaulttemplate setting from the config file: copy this setting from config-defaults.php to config.php which overrides config-defaults.php and edit this setting to &amp;lt;code lang=&amp;quot;html&amp;quot;&amp;gt;$defaulttemplate = &#039;yourtemplatename&#039;;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Import/Export of templates: Mac users== &amp;lt;!--T:158--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;Mac users&amp;lt;/u&amp;gt;, please note that the Mac OSX default archive utility may have problems with zip folders &amp;quot;generated on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:160--&amp;gt;&lt;br /&gt;
A workaround is to unix&#039;es unzip from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
$ unzip template.zip -d template&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:162--&amp;gt;&lt;br /&gt;
Archive: template.zip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
 inflating: template/startpage&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:164--&amp;gt;&lt;br /&gt;
 inflating: ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
Another workaround is to use scripts in their mac-compiled counterparts.&lt;br /&gt;
&lt;br /&gt;
==Replacing the help icon {{ObsoleteIn|2.50}} == &amp;lt;!--T:173--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:174--&amp;gt;&lt;br /&gt;
When a question help text is shown, then an help.gif image is used from the default template folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
You can replace this image by uploading a new help.gif, help.png or help.jpg in your custom template folder. It will then be automatically used instead of the default help icon.&lt;br /&gt;
&lt;br /&gt;
==Replacing an existing logo {{NewIn|2.50}} {{ObsoleteIn|3.0}}== &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:177--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In the &#039;&#039;&#039;default&#039;&#039; Template of 2.50, there is no preembedded logo. Read further our [[#Adding_your_own_logo |wiki on how to add your own logo]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
1. To edit the logo go to the &#039;&#039;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&#039;&#039; file which you can find it here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:179--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t1.PNG|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
2. Click the search button to find occurrences of logo related styles and search for &#039;&#039;logo&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:181--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:2.png|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
4. Edit the main style file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:185--&amp;gt;&lt;br /&gt;
You will see something similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t4.PNG|500px]]&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:187--&amp;gt;&lt;br /&gt;
If you want to change the image, just replace logo.gif with another image link. Example: (&amp;lt;u&amp;gt;logo.png&amp;lt;/u&amp;gt; or &amp;lt;u&amp;gt;logo.jpg&amp;lt;/u&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:188--&amp;gt;&lt;br /&gt;
If you want to change the image size, adjust width and height (in pixels) like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;width:100px; height:100px;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo {{ObsoleteIn|3.0}} == &amp;lt;!--T:190--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
1. Find and open the &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; template file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:192--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:startpage.pstpl.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
2. After this&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; &amp;gt;&amp;lt;div id=&amp;quot;topContainer&amp;quot; class=&amp;quot;jumbotron&amp;quot;&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
add this line to &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;img id=&#039;page_logo&#039; src=&#039;{TEMPLATEURL}/files/logo.png&#039; class=&amp;quot;clearfix pull-right&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
3. To upload your own logo, go to the template editor and upload your logo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:197--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:uploadyourlogo.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:199--&amp;gt;&lt;br /&gt;
To position your logo, please use one of the following css classes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:293--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the left side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:200--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-left&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:204--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the right side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:205--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-right&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:208--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want to center the logo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:209--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix center-block&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the same template with different logos== &amp;lt;!--T:214--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:215--&amp;gt;&lt;br /&gt;
If you want to use the same template for all surveys and just want to change the logo for each survey, you can use the {SID} placeholder in the template .pstpl file and thereby refer to different images:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:216--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;{TEMPLATEURL}files/logoImage-{SID}.png&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the default help to all question (hide_tip) {{ObsoleteIn|1.92}}== &amp;lt;!--T:217--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:218--&amp;gt;&lt;br /&gt;
There are 3 solutions to remove the default help:&lt;br /&gt;
# like a hide_tip attribute but for all question and survey.&lt;br /&gt;
# you can remove the {QUESTIONHELP} and its container from the file question.pstl. However, it can be a bad idea for the screenreader.&lt;br /&gt;
# for the default template and some other, add this at the end of tempate.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:219--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;span.questionhelp{display:none;}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display custom favicon== &amp;lt;!--T:220--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:221--&amp;gt;&lt;br /&gt;
A favicon is the little icon you see in the browser&#039;s address bar, list of bookmarks or tab. You can display your own icon as follows:&lt;br /&gt;
#Create a favicon - google will find you lots of free favicon generators.&lt;br /&gt;
#Name your new favicon &amp;quot;favicon.ico&amp;quot; and place it in your template /files directory.&lt;br /&gt;
#Add the following code to your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; before the &amp;lt;/head&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:222--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Different appearance for survey-/question-pages== &amp;lt;!--T:224--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:226--&amp;gt;&lt;br /&gt;
If you want LimeSurvey to change the appearance of every second page (i.e. of even and odd survey pages), you can use &#039;&#039;&#039;.page-odd&#039;&#039;&#039; class in your CSS file to change the appearance of odd pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:227--&amp;gt;&lt;br /&gt;
An example from default template of LimeSurvey 1.91+:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:228--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.page-odd table.question-group {&lt;br /&gt;
 background-color: #D2F2D3;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:232--&amp;gt;&lt;br /&gt;
If you do &#039;&#039;&#039;not&#039;&#039;&#039; want differentiate even and odd pages, find all instances of &#039;&#039;.page-odd&#039;&#039; in template.css and remove those styles.&lt;br /&gt;
&lt;br /&gt;
==Create a vertical separator  border for dual scale array== &amp;lt;!--T:233--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:234--&amp;gt;&lt;br /&gt;
To create a vertical separator border for a dual scale array, you can add the following lines to your &#039;&#039;&#039;template.css&#039;&#039;&#039;-file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:235--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
table.question thead td.header_separator,&lt;br /&gt;
table.question tbody td.dual_scale_separator&lt;br /&gt;
{&lt;br /&gt;
   border-right:solid 1px #00A8E1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:242--&amp;gt;&lt;br /&gt;
&#039;&#039;header_separator&#039;&#039; is used to adress the separator for the header &amp;quot;td&amp;quot;. The &amp;quot;dual_scale_separator&amp;quot; is used to address the separator column in the dual scale array.&lt;br /&gt;
&lt;br /&gt;
==Hide the survey contact message shown on the start page/survey list {{ObsoleteIn|3.0}} == &amp;lt;!--T:243--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:244--&amp;gt;&lt;br /&gt;
To hide the &amp;quot;Please contact ...&amp;quot; message on the start page (with the survey list), you can add the following to the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.js&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:245--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:246--&amp;gt;&lt;br /&gt;
$(&#039;#surveycontact&#039;).hide(); //Hides the survey contact message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:247--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the survey contact message shown on error messages {{ObsoleteIn|3.0}}== &amp;lt;!--T:248--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:249--&amp;gt;&lt;br /&gt;
If you want to remove the survey contact message from error messages, it&#039;ll be trickier. You can add the function from below. It calls the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.css&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:250--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
removeContactAdressFromMessage(); //Removes the survey contact message from error messages&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:253--&amp;gt;&lt;br /&gt;
and add the following function to your *template.js* file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:254--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
function removeContactAdressFromMessage()&lt;br /&gt;
{&lt;br /&gt;
if ($(&#039;#tokenmessage&#039;).length &amp;gt; 0)&lt;br /&gt;
   {&lt;br /&gt;
   var oldMessage = $(&#039;#tokenmessage&#039;).html();&lt;br /&gt;
   var indexContact = oldMessage.indexOf(&#039;Bitte kontaktieren&#039;);&lt;br /&gt;
   var newMessage = oldMessage.substr(0, indexContact);&lt;br /&gt;
   $(&#039;#tokenmessage&#039;).html(newMessage);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:266--&amp;gt;&lt;br /&gt;
It will probably not work for a survey in English language and has to be extended when used for multilingual surveys. But it&#039;s an idea/tip on how to solve this.&lt;br /&gt;
&lt;br /&gt;
==How to deal with multilingual question attributes {{ObsoleteIn|2.50}}== &amp;lt;!--T:267--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:268--&amp;gt;&lt;br /&gt;
If you have a multilingual survey and e. g. want to use a different string for the &amp;quot;other&amp;quot; field, this could only be done for the base language (until this feature was added at LimeSurvey 2.0). To work around this, paste in the field to change the label for &amp;quot;other&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:269--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;en&amp;quot;&amp;gt;New label&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;fr&amp;quot;&amp;gt;Nouveau label&amp;lt;/span&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:270--&amp;gt;&lt;br /&gt;
Add in the template.css of your template (at &#039;&#039;/limesurvey/upload/templates/&amp;lt;yourtemplatename&amp;gt;/template.css&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:271--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;html:lang(en) .fr{display:none}&lt;br /&gt;
html:lang(fr) .en{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo to the survey list {{ NewIn|3.0}} == &amp;lt;!--T:310--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:311--&amp;gt;&lt;br /&gt;
# First please open the theme editor for the theme you like to use. [[File:OpenThemeEditor.jpg]]&lt;br /&gt;
# We recommend to use fruity, it is our best theme currently. &lt;br /&gt;
# Then extend the theme and give it a name you will recognize. [[File:ExtendTheme.jpg]]&lt;br /&gt;
# In the following view you may upload the logo you want to use. [[File:UploadFileTheme.jpg]]&lt;br /&gt;
# Select the editor screen `Survey List´ in the Screen dropdown in the top right corner. [[File:OpenScreenSurveyList.jpg]]&lt;br /&gt;
# Then select `layout_survey_list.twig´ in the left side menu. [[File:EditLayoutSurveyListTwig.jpg]]&lt;br /&gt;
# In the editor scroll to line 126 and change the marked part to the filename of the image you uploaded to the theme before. [[File:ChangeSurveyListHeaderImageEditor.jpg]]&lt;br /&gt;
# Save your file. [[File:ThemeEditorSaveChanges.jpg]]&lt;br /&gt;
# Change default theme to your extended theme. [[File:ChangeDefaultTheme.jpg]]&lt;br /&gt;
&lt;br /&gt;
=Custom Question Views {{NewIn|3.0}}= &amp;lt;!--T:289--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:290--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; This is a temporary feature to be replaced in the future by question object (it will be very easy to move custom views to question object). It is disabled by default.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:291--&amp;gt;&lt;br /&gt;
As of version 2.5, you can create template-specific custom views for questions and some of their incorporated elements. This is useful if you want to modify the HTML layout of a particular question type for one or more surveys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:292--&amp;gt;&lt;br /&gt;
*In application/config/config.php, find &#039;config&#039;=&amp;gt;array and add this line to the array : &#039;allow_templates_to_overwrite_views&#039;=&amp;gt;1&lt;br /&gt;
*In /{your_template}/config.xml, set &amp;quot;overwrite_question_views&amp;quot; to true&lt;br /&gt;
*Copy application/views/survey/* to template/{your_view_directory}/survey/&lt;br /&gt;
*Note that you only need to copy the files that you intend to modify but the file structure must remain the same as in application/views/survey/&lt;br /&gt;
&lt;br /&gt;
=Insert Custom CSS or JavaScript files for template {{NewIn|2.50}}= &amp;lt;!--T:296--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:303--&amp;gt;&lt;br /&gt;
As of version 2.50, you can use the config.xml file to automatically load plugin files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:304--&amp;gt;&lt;br /&gt;
*Upload your files to the template /css or /scripts folder&lt;br /&gt;
*In /{your_template}/config.xml, add the file paths to the &amp;lt;css&amp;gt; or &amp;lt;js&amp;gt; blocks, something like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;css&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/jquery-ui-custom.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/bootstrap-slider.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:305--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/flat_and_modern.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:306--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/template.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:307--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/myCustomPlugin.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;js&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/template.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/bootstrap-slider.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:308--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;scripts/myCustomPlugin.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/js&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95821</id>
		<title>Theme editor</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=Theme_editor&amp;diff=95821"/>
		<updated>2018-04-04T10:06:21Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: updating to LS3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt; &amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Introduction= &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
LimeSurvey has an advanced theme and style system providing to developers an efficient way to customize the survey appearance. Since LS3, we&#039;re not speaking anymore about &#039;&#039;&#039;&amp;quot;templates&amp;quot;&#039;&#039;&#039; like in previous versions, but about &#039;&#039;&#039;&amp;quot;themes&amp;quot;&#039;&#039;&#039;. The &#039;&#039;&#039;themes&#039;&#039;&#039; allow control over the look and feel of pages during a survey. A survey administrator can select a default theme that will be used for each survey to further personalize it and improve its look and feel. &#039;&#039;&#039;&amp;quot;Themes&amp;quot;&#039;&#039;&#039; come with options that provide to admin without coding skill a simple way to add a logo on the welcome page, to change the background colors, to select a font, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
LimeSurvey comes with 3 themes right out of the box. These initial themes are defined by directories located in the LimeSurvey installation &amp;quot;themes/survey/&amp;quot; directory. Each theme has it&#039;s own directory. Within the main directory of a theme you&#039;ll find a configuration file in XML, and numerous directories containing the views &#039;&#039;themes (.twig)&#039;&#039;&#039;, &#039;&#039;&#039;cascading style sheets (.css)&#039;&#039;&#039;, &#039;&#039;&#039;scripts&#039;&#039;&#039;,  &#039;&#039;&#039;images&#039;&#039;&#039; (&#039;&#039;&#039;.jpg&#039;&#039;&#039; or &#039;&#039;&#039;.png&#039;&#039;&#039;), and maybe others. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Like in other theme-based systems, fragments of HTML code are stored in the .pstpl template files. These fragments are read and used to construct the page to be display to the end user (survey participant). Often &#039;&#039;&#039;keywords&#039;&#039;&#039; surrounded by curly braces are included in the files that are then replaced with the relevant text. You may find below an example of a template file content and its result when used in a survey page:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&#039;text-align: center;&#039;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;My New Survey&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&#039;text-align: center;&#039;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;This is a survey written by me to find out what sort of chocolate people like.&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
One gets a result that looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:278--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;div style=&#039;text-align: center;&#039;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;My New Survey&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&#039;text-align: center;&#039;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;This is a survey written by me to find out what sort of chocolate people like.&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
Templates, being HTML code, tend to define the positioning and type of text to be displayed and similar structural features of the page. They often reference or include other files. Most of them reference a common cascading style sheets (CSS) file that defines the font style, color, size, background, and similar parameters common to all pages in the survey. Style sheets reference HTML &#039;&#039;&#039;class&#039;&#039;&#039; parameters that are associated with the various types of objects in the HTML code. This allows the style sheet to describe how to display each of the many types of text or other objects that may appear in multiple places. There are unique classes for each question type in LimeSurvey and thus giving detailed control over the appearance of each. Image files, like logos or special progress-bar constructors, may be referenced as well in the Template file. Finally, special keywords in curly braces are replaced with text defined in the survey for each language translation correspondent (for example, the &#039;Survey Title&#039; or &#039;Question Text&#039; for each language defined).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
If you create a new custom template, please consider contributing it back to the LimeSurvey community and make it available to others. With your help, we can grow our repository of templates, surveys, and other add-ons to make LimeSurvey even better! &lt;br /&gt;
See our [https://www.limesurvey.org/index.php?option=com_sobipro&amp;amp;sid=55:Templates&amp;amp;Itemid=729 LimeSurvey template repository] where you can share your templates.&lt;br /&gt;
&lt;br /&gt;
=Creating a new template= &amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
To be able to create a new template (or edit an existing template), you need [[Manage users#Set global permissions for a user|Template Editing user permission]] in LimeSurvey as well as permission to manipulate the files in the underlying operating system hosting your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;Note of Warning:&#039;&#039;&#039;&amp;lt;/span&amp;gt; If you change templates, you could also affect all the pre-existing surveys from your LimeSurvey installation. Templates are an advanced feature that require experience and HTML knowledge in order to make them running smoothly.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
The preferred way to create a new template is through the &#039;&#039;&#039;Template Editor&#039;&#039;&#039; (see below), which is located in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; dialog. Some people may like to work directly with template files so that they can use their favorite text editor instead of the web interface. In this case, still use the Template Editor to first create your new template. This will create a new base template with all the files you need in the &#039;&#039;LimeSurvey_web_root/upload/templates/your_new_template&#039;&#039; directory. From there you can use your text editor to manually adjust the template files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Permissions Note:&#039;&#039;&#039; on unix/linux systems, these template files will be owned by the group and user where the web server is running (may be &amp;quot;www&amp;quot; for some systems). So, make sure you have enough access to edit these files, When you save them, make sure they don&#039;t change ownership! In this way, you can still use the web Template Editing interface if needed.&amp;lt;/div&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
A number of &#039;public&#039; elements of LimeSurvey can be adjusted by a series of templates. The next section provides a very brief explanation of these templates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
{{Note|Template files may seem complex. Besides HTML, you might also need to understand CSS.}}&lt;br /&gt;
&lt;br /&gt;
=The LimeSurvey template editor= &amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
To ease the understanding and quick update of a Template, LimeSurvey provides a &#039;&#039;&#039;Template Editor&#039;&#039;&#039; in the main &#039;&#039;&#039;administrative&#039;&#039;&#039; toolbar of the application. This Template Editor is only available to users [[Manage users#Set global permissions for a user|with the Templates permission]] and to superadministrators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:297--&amp;gt;&lt;br /&gt;
{{Alert|title=Attention|text=A template that is not correctly constructed can render a survey (that uses the respective template) inoperable. }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
The LimeSurvey template editor allows you to edit the contents of your templates online. Start the Template Editor by clicking on &#039;&#039;&#039;Template editor&#039;&#039;&#039; in the &#039;&#039;&#039;Configuration&#039;&#039;&#039; menu. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:285--&amp;gt;&lt;br /&gt;
[[File:templates.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:286--&amp;gt;&lt;br /&gt;
The template editor page allows you to select the template you would like to edit/view. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:279--&amp;gt;&lt;br /&gt;
[[File:Template-editor-2013-7-10_11_38_16.png|center]]&lt;br /&gt;
&lt;br /&gt;
==The template menu== &amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:298--&amp;gt;&lt;br /&gt;
The following options are available:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:280--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Create&#039;&#039;&#039;: Allows you to create a new template. In order not to start from scratch, the template &#039;default&#039; is copied.&lt;br /&gt;
*&#039;&#039;&#039;Import&#039;&#039;&#039;: Allows you to import a template from a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Export&#039;&#039;&#039;: Allows you to export the current template to a ZIP file.&lt;br /&gt;
*&#039;&#039;&#039;Copy&#039;&#039;&#039;: Allows you to make a new template by copying the current one.&lt;br /&gt;
*&#039;&#039;&#039;Rename&#039;&#039;&#039;: Allows you to change the name of the template. It is generally used after copying or importing a template.&lt;br /&gt;
*&#039;&#039;&#039;Template&#039;&#039;&#039;: It is a drop-down list that shows all the available templates that are located in your LimeSurvey installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;Screen&#039;&#039;&#039;: It is a drop-down list which allows you to choose which particular survey page of that template you want to look at.&lt;br /&gt;
*&#039;&#039;&#039;Return to admin panel&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Import/export/copy a template== &amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
When you &#039;&#039;&#039;export &#039;&#039;&#039;a template, a ZIP-file archive with all the files your template consists of will be created (.pstpl files, images, css files, ...). You can simply &#039;&#039;&#039;import&#039;&#039;&#039; the exported zip-file into another LimeSurvey installation by using the import feature or you can manually copy the archive into another LimeSurvey installation and extract it into the corresponding [[Theme editor#Template files location|template directory there]]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:288--&amp;gt;&lt;br /&gt;
However, it is preferred to use the LimeSurvey template import/export/copy functions in the template editor.&lt;br /&gt;
&lt;br /&gt;
==Page Structure / Template Use== &amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;The Welcome Page:&#039;&#039;&#039; startpage.pstpl, welcome.pstpl, privacy.pstpl,  navigator.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Questions Pages:&#039;&#039;&#039; startpage.pstpl, survey.pstpl, startgroup.pstpl, groupdescription.pstpl, question.pstpl, endgroup.pstpl, endpage.pstpl&lt;br /&gt;
*&#039;&#039;&#039;The Final Page:&#039;&#039;&#039; startpage.pstpl, assessment.pstpl, completed.pstpl, endpage.pstpl&lt;br /&gt;
&lt;br /&gt;
==Template Files== &amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
The following template files are used to produce your public survey and must exist in any new template folder you create:&lt;br /&gt;
*&#039;&#039;&#039;startpage.pstpl:&#039;&#039;&#039; Produces the start of each html page. It starts at the &amp;quot;&amp;lt;head&amp;gt;&amp;quot; tag, and should not contain the &amp;quot;&amp;lt;html&amp;gt;&amp;quot; tag. This &#039;very beginning&#039; of a standard html page is written by the scripts. Please ensure that your startpage.pstpl files contains a &amp;lt;body&amp;gt; tag. Even though many browsers do not require strict adherence to the W3 HTML standards, the LimeSurvey script needs to find a &amp;lt;body&amp;gt; tag to run certain javascript elements. It is not expected to see many &#039;keywords&#039; used in the startpage.pstpl file. However, you may wish to put the {SURVEYNAME} into the title. The startpage.pstpl file can contain code that ends in the corresponding endpage.pstpl file. For example, you can start a table in this file and close the table in the endpage.pstpl file. The startpage.pstpl and endpage.pstpl files wrap around every possible page used by LimeSurvey.&lt;br /&gt;
*&#039;&#039;&#039;survey.pstpl:&#039;&#039;&#039; This template is the second used on most pages and provides a space to put the survey name and description. This template does not have a corresponding &#039;closing&#039; template, and subsequently you should close all tags opened in this template file (i.e.: don&#039;t leave a table open here because there is nowhere else to close it).&lt;br /&gt;
*&#039;&#039;&#039;welcome.pstpl:&#039;&#039;&#039; This template is only used in the welcome screen (which is also on the main page for &#039;all in one&#039; surveys). You can use this to print out the welcome text, and other information that should be provided in the introduction. Like the &#039;survey.pstpl&#039; file, there is no corresponding &#039;closing&#039; template, so all tags opened in this template file should be closed as well.&lt;br /&gt;
*&#039;&#039;&#039;startgroup.pstpl:&#039;&#039;&#039; This template can provide a &#039;summary&#039; wrap around for questions within a group. It has a matching &#039;endgroup.pstpl&#039; template that can be used to close any opened tags in this file, so you can open a table within this.&lt;br /&gt;
*&#039;&#039;&#039;groupdescription.pstpl:&#039;&#039;&#039; This template file is used to display a description of a group. Please note that in the survey settings (access the &#039;&#039;Presentation &amp;amp; navigation settings&#039;&#039; by clicking on the &#039;&#039;&#039;Presentation&#039;&#039;&#039; tab) you can set if the group description should be shown or not. If not, then this file is not included at all.&lt;br /&gt;
*&#039;&#039;&#039;question.pstpl:&#039;&#039;&#039; This file contains the question, answer, and help text sections of your survey. In the &amp;quot;group by group&amp;quot; and &amp;quot;all in one&amp;quot; surveys, this template is cycled repeatedly with each question. There is no corresponding closing file for this and all tags should be closed.&lt;br /&gt;
*&#039;&#039;&#039;question_start.pstpl:&#039;&#039;&#039; This file contains the individual elements found at the start of a question. It is included within &#039;question.pstpl&#039; via the {QUESTION} keyword. It is intended to allow template designers more control over the layout of a question. This template sits outside the normal templating system and &#039;&#039;&#039;was superseeded (as of LimeSurvey 1.87)&#039;&#039;&#039;. All keywords from this template are now available directly in question.pstpl. &lt;br /&gt;
*&#039;&#039;&#039;completed.pstpl:&#039;&#039;&#039; This page is displayed as the final page when the survey responses have been saved and the survey is over. It can be used to display a &amp;quot;forwarding link&amp;quot; as set in the survey setup.&lt;br /&gt;
*&#039;&#039;&#039;endgroup.pstpl:&#039;&#039;&#039; This file closes the group, and can be used to close off any tags opened in the startgroup.pstpl file&lt;br /&gt;
*&#039;&#039;&#039;navigator.pstpl:&#039;&#039;&#039; This file contains the buttons that navigate through the survey, &amp;quot;next&amp;quot;, &amp;quot;prev&amp;quot;, &amp;quot;last&amp;quot;, &amp;quot;submit&amp;quot;, &amp;quot;save so far&amp;quot;  and the &amp;quot;clear all&amp;quot; link. It is used in all pages except the completed page.&lt;br /&gt;
*&#039;&#039;&#039;printanswers.pstpl:&#039;&#039;&#039; This file has the HTML wrapper necessary for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_group.pstpl:&#039;&#039;&#039; This file is the same as startgroup.pstpl and endgroup.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_question.pstpl:&#039;&#039;&#039; This file is the same as question.pstpl, but for the print version of the survey.&lt;br /&gt;
*&#039;&#039;&#039;print_survey.pstpl:&#039;&#039;&#039; This file is the same as survey.pstpl, but for the print version of the survey.&lt;br /&gt;
&lt;br /&gt;
== CSS and Javascript== &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
Two files that are always used in a template are template.css (for CSS) and template.js (for Javascript).&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATECSS}:&#039;&#039;&#039; Add lines for default css, template.css, and template-rtl.css for rtl language.&lt;br /&gt;
*&#039;&#039;&#039;{TEMPLATEJS}:&#039;&#039;&#039; Add lines for default javascript files, template.js, and all js files needed for LimeSurvey.&lt;br /&gt;
&lt;br /&gt;
=== Using Bootstrap=== &amp;lt;!--T:294--&amp;gt;&lt;br /&gt;
LimeSurvey has Bootstrap 3 embedded, so you can style all your templates with the well documented Bootstrap classes.&lt;br /&gt;
For more information please refer to the [https://getbootstrap.com Bootstrap documentation].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:295--&amp;gt;&lt;br /&gt;
The [https://github.com/flatlogic/awesome-bootstrap-checkbox Awesome-Bootstrap-Checkbox] plugin is also included. With it, you can use the typical Bootstrap color-classes (info,warning,danger,etc.) also with the suffix &amp;quot;-checkbox&amp;quot; or &amp;quot;-radio&amp;quot;, though styling checkboxes and radios as you prefer.&lt;br /&gt;
&lt;br /&gt;
=== Replacing default CSS or Javascript=== &amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
Some questions use specific files for Javascript or CSS. If you need to replace a function, use a cascading system. For javascript function, the last function read is the function used.&lt;br /&gt;
&lt;br /&gt;
==Other Template Files== &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
The &#039;&#039;&#039;privacy.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;invitationemail.pstpl&#039;&#039;&#039;, &#039;&#039;&#039;reminderemail.pstpl&#039;&#039;&#039;, and &#039;&#039;&#039;confirmationemail.pstpl&#039;&#039;&#039; are no longer used by LimeSurvey and defaults are instead set in the applicable language files. The email messages can now be edited on a survey by survey basis.&lt;br /&gt;
&lt;br /&gt;
==Standard Pages== &amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
There are ten standard pages that a survey participant may see in the course of taking or accessing the LimeSurvey application.  Each is constructed from a number of common &#039;&#039;&#039;Template&#039;&#039;&#039; files from the &#039;&#039;&#039;Template&#039;&#039;&#039; specified in the settings of the survey. The table below indicates which template files are used in constructing each of these pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!  &#039;&#039;&#039;Survey Pages/&#039;&#039;&#039;&amp;lt;br /&amp;gt;&#039;&#039;&#039;Template Files&#039;&#039;&#039;!!Survey&amp;lt;br /&amp;gt;List!!Welcome!!Question!!Completed!!Clear All!!Register!!Load!!Save!!Print&amp;lt;br /&amp;gt;Answers!!Print&amp;lt;br /&amp;gt;Survey&lt;br /&gt;
|-&lt;br /&gt;
|SurveyList||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Welcome|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Privacy|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Navigator|| ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Survey|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|StartGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|GroupDescription|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Question&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|EndGroup|| || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Assessment|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Completed|| || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ClearAll|| || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Register|| || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Load|| || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| || ||&lt;br /&gt;
|-&lt;br /&gt;
|Save|| || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| ||&lt;br /&gt;
|-&lt;br /&gt;
|PrintAnswers|| || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||&lt;br /&gt;
|-&lt;br /&gt;
|Print Survey || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Group || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|Print Question || || || || || || || || || ||align=&amp;quot;center&amp;quot; | [[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|StartPage&amp;lt;br /&amp;gt;EndPage&amp;lt;br /&amp;gt;Template.css||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]||align=&amp;quot;center&amp;quot; | [[File:check.gif]]|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.90+, this replaces question.pstpl AND question_start.pstpl. If you are using an old custom template, you need to add the following line to the beginning of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div {QUESTION_ESSENTIALS} class=&amp;quot;{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;And then add the corresponding closing tag to the end of question.pstpl:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&#039;color:red&#039;&amp;gt;&#039;&#039;&#039;*&#039;&#039;&#039;&amp;lt;/span&amp;gt;NOTE: In version 1.91 and earlier, LimeSurvey js files are not included in the template. In version 2, &#039;&#039;&#039;you have to use {TEMPLATEJS} in one of your template file&#039;&#039;&#039; to add the link to the js file. You can add it in startpage.pstpl or in endpage.pstpl. You can remove the {TEMPLATEURL}/template.js line and you have to replace with {TEMPLATEJS} to update a personal template.&lt;br /&gt;
&lt;br /&gt;
==The File Control Section== &amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:42--&amp;gt;&lt;br /&gt;
In the &amp;quot;file control&amp;quot; window on the left, you can click on one of the template files that is used to compile the page. You can see the &#039;&#039;Screen part&#039;&#039;, JavaScript, and CSS files. The HTML code for that file will then appear in the &amp;quot;Now editing&amp;quot; window in the center. If the template is editable (determined by directory permissions) you can then make any changes and save them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:299--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:File Control Section.png|center]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:43--&amp;gt;&lt;br /&gt;
The &amp;quot;Other files&amp;quot; window shows a list of all other files from the template directory. You can use the right side to &#039;&#039;&#039;upload and select image files (your pics, logos,...) or other files needed to create your template&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:300--&amp;gt;&lt;br /&gt;
Instead of using a link for each picture, utilize the field string {TEMPLATEURL}. So, instead of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:44--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;/limesurvey/templates/yourtemplate/files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
You can use {{NewIn|2.50}}:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}files/mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:287--&amp;gt;&lt;br /&gt;
In LimeSurvey versions before 2.50 use:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;img src=&#039;{TEMPLATEURL}mypicture.jpg&#039;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:46--&amp;gt;&lt;br /&gt;
A &amp;quot;sample&amp;quot; of the template page you are editing will be visible in the bottom of the screen. There is no way to delete a template from the template editor. This must be done by accessing the underlying directory and deleting manually the files from there. You also have the possibility to select different screen resolutions in order to better evaluate the feel and look of the template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:47--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; The shipped templates cannot be edited using the template editor. If you want to modify them, create a copy first and edit the copy.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Template files location== &amp;lt;!--T:48--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:49--&amp;gt;&lt;br /&gt;
LimeSurvey stores each of the &#039;standard&#039; templates in their own distinct sub-directory within the &#039;&#039;/templates&#039;&#039; directory that is kept in the public directory with the other LimeSurvey public files. Customized user templates are stored in the &#039;&#039;/upload/templates&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:51--&amp;gt;&lt;br /&gt;
There should &#039;&#039;&#039;ALWAYS&#039;&#039;&#039; be a &amp;quot;default&amp;quot; directory in the templates directory. This template is used by default and as a fall-back if a template folder doesn&#039;t exist, or can&#039;t be found. It comes installed by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:52--&amp;gt;&lt;br /&gt;
You can use any image files that you upload into the template management area with the help of this syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:53--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;{TEMPLATEURL}filename.xyz&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Styling questions with CSS= &amp;lt;!--T:54--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:55--&amp;gt;&lt;br /&gt;
Styling of questions in CSS has become much easier. Each question type has now a unique class. The mandatory questions have an additional mandatory class. For example, for a non-mandatory question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:56--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:59--&amp;gt;&lt;br /&gt;
and if the question is mandatory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:60--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:63--&amp;gt;&lt;br /&gt;
and if the question is mandatory, but the user didn&#039;t answer it or if there is validation on a question:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:64--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question5&amp;quot; class=&amp;quot;gender mandatory input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:67--&amp;gt;&lt;br /&gt;
and if the question has validation applied, but the user hasn&#039;t answered correctly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:68--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;question6&amp;quot; class=&amp;quot;text-short input-error&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Global classes for question part== &amp;lt;!--T:273--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:274--&amp;gt;&lt;br /&gt;
These classes are used for each question type. Some question types use only one or two classes, while others may use much more.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:281--&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable alternance&amp;quot;&lt;br /&gt;
|+ Global classes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Class name&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Part&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Question type&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Examples&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Note&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question {{ObsoleteIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;p class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;question&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;question&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-answers {{NewIn|3.0}}&lt;br /&gt;
| All question block&lt;br /&gt;
| All question type&lt;br /&gt;
|&amp;amp;lt;div class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;ul class=&amp;quot;ls-answers &amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;ls-answers&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .subquestions-list&lt;br /&gt;
| List of subquestion&lt;br /&gt;
| Multi choice question, array question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;subquestions-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;subquestions-list&amp;quot;&amp;gt;&lt;br /&gt;
| .questions-list is used too&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answers-list&lt;br /&gt;
| List of answers&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;answers-list&amp;quot;&amp;gt;, &amp;amp;lt;table class=&amp;quot;answers-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answer-item&lt;br /&gt;
| The answer part: one answer&lt;br /&gt;
| Single choice question, array question type, Multi input text question&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;answer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;answer-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .noanswer-item&lt;br /&gt;
| The answer part for no answer&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;noanswer-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
| No answer is an answer too, then have double class noanswer-item and answer-item&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .question-item&lt;br /&gt;
| The question part: one question&lt;br /&gt;
| Multi text question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;question-item&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;question-item&amp;quot;&amp;gt;&lt;br /&gt;
| Some answers are questions too. Then we have a lot of class=&amp;quot;question-item answer-item&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-list&lt;br /&gt;
| A list of checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;checkbox-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| Some question types use multi-list class, like checkbox with comment: class=&amp;quot;checkbox-list text-list&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of checkbox&lt;br /&gt;
| Array (numbers) with checkbox option&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;checkbox-list&amp;quot;&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox-item&lt;br /&gt;
| The answer part with a checkbox&lt;br /&gt;
| Multi choice question, array number (checkbox) question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;checkbox-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;checkbox-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-list&lt;br /&gt;
| A list of radio item&lt;br /&gt;
| Single choice question, array question type (each row)&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;radio-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;radio-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-array {{NewIn|3.0}}&lt;br /&gt;
| A array of radio item&lt;br /&gt;
| Array question type&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;radio-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio-item&lt;br /&gt;
| The answer part with a radio&lt;br /&gt;
| Single choice question, array question type&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;radio-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;radio-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-list&lt;br /&gt;
| A list of text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text-item&lt;br /&gt;
| The answer part of a text input&lt;br /&gt;
| Multi text question type, array of text&lt;br /&gt;
| &amp;amp;lt;li class=&amp;quot;text-item&amp;quot;&amp;gt;, &amp;lt;td class=&amp;quot;text-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .numeric-list&lt;br /&gt;
| A list of text input with numeric only answer&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-list&lt;br /&gt;
| A list of text input with numeric only answer (each row)&lt;br /&gt;
| Multi numeric question type, array of number&lt;br /&gt;
| &amp;amp;lt;ul class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;, &amp;amp;lt;tr class=&amp;quot;text-list numeric-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .number-array  {{NewIn|3.0}}&lt;br /&gt;
| The answer part of a numeric input&lt;br /&gt;
| Array of number&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;number-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-list  {{ObsoleteIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;select-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-list  {{NewIn|2.50}}&lt;br /&gt;
| A list of select&lt;br /&gt;
| Array numbers, Dual scale array (select) (each row)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-list&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-array  {{NewIn|3.0}}&lt;br /&gt;
| A array of dropdown&lt;br /&gt;
| Array numbers, Dual scale array (select)&lt;br /&gt;
| &amp;amp;lt;table class=&amp;quot;dropdown-array&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .select-item  {{ObsoleteIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;select-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;select-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .dropdown-item  {{NewIn|2.50}}&lt;br /&gt;
| The answer part of a select&lt;br /&gt;
| Array numbers, Dual scale array (select), single choice with select&lt;br /&gt;
| &amp;amp;lt;p class=&amp;quot;dropdown-item&amp;quot;&amp;gt;, &amp;amp;lt;td class=&amp;quot;dropdown-item&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .hide  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Used for accessibility: hidden with css but read by screenreader, since 2.50 : you can use sr-only from bootstrap&lt;br /&gt;
| Short text question&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;hide&amp;quot;&amp;gt;&lt;br /&gt;
| Can be used for other purposes&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is activated&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it, but you can use it too in your template&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-js-hidden-sr {{NewIn|3.0}}&lt;br /&gt;
| Used for accessibility: hide it if js is activated, but always show if user use a screenreader&lt;br /&gt;
| Button for example&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-js-hidden-sr&amp;quot;&amp;gt;&lt;br /&gt;
| Button&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-no-js-hidden {{NewIn|3.0}}&lt;br /&gt;
| Used for part to be hidden if javascript is not activated&lt;br /&gt;
| Link&lt;br /&gt;
| &amp;amp;lt;a class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| LimeSurvey core used it for inactive link if javascript is not activated&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-label-xs-visibility {{NewIn|3.0}}&lt;br /&gt;
|  Label to be hidden in big screen, but show with little screen (with no more table) and to screenreader&lt;br /&gt;
| label&lt;br /&gt;
| &amp;amp;lt;label class=&amp;quot;ls-no-js-hidden&amp;quot;&amp;gt;&lt;br /&gt;
| Used for label inside table cell of array question type&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-input-group-extra {{NewIn|3.0}}&lt;br /&gt;
| Same usage of boostrap input-group-addon, but without the border and the background.&lt;br /&gt;
| right suffix&lt;br /&gt;
| &amp;amp;lt;div class=&amp;quot;ls-input-group-extra&amp;quot;&amp;gt;&lt;br /&gt;
| Used for right and left suffix (global)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .checkbox {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=checkbox]&lt;br /&gt;
| Question with checkbox&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;checkbox&amp;quot; class=&amp;quot;checkbox&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .radio {{ObsoleteIn|3.0}}&lt;br /&gt;
| input[type=radio]&lt;br /&gt;
| Question with radio&lt;br /&gt;
| &amp;amp;lt;input type=&amp;quot;radio&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
| With modern browser: not needed, but some old browser need this&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .text&lt;br /&gt;
| input[type=text]&lt;br /&gt;
| Question with input text, or textarea&lt;br /&gt;
| &amp;amp;lt;textarea class=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .answertext&lt;br /&gt;
| Array question type&lt;br /&gt;
| Answer part of array question type&lt;br /&gt;
| &amp;amp;lt;th class=&amp;quot;answertext&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .col-answers&lt;br /&gt;
| Array question type&lt;br /&gt;
| Column of answers&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .odd .even {{ObsoleteIn|2.50}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for column&lt;br /&gt;
| &amp;amp;lt;col class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .array1 .array2  {{ObsoleteIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for line&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;array1&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | .ls-odd .ls-even  {{NewIn|3.0}}&lt;br /&gt;
| Array question type&lt;br /&gt;
| Alternation for sub-question and Y axis&lt;br /&gt;
| &amp;amp;lt;tr class=&amp;quot;ls-odd&amp;quot;&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Some example of question part with classes=== &amp;lt;!--T:275--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:276--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Text-short question type:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;question answer-item text-item &amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;label class=&amp;quot;hide label&amp;quot; for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Answer&amp;lt;/label&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;50&amp;quot; class=&amp;quot;text  empty&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:277--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Multiple short text&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;subquestions-list questions-list text-list&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;li class=&amp;quot;question-item answer-item text-item&amp;quot; id=&amp;quot;javatbdSGQA&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;label for=&amp;quot;answerSGQA&amp;quot;&amp;gt;Some example subquestion&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;span&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; size=&amp;quot;20&amp;quot; class=&amp;quot;text empty&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:282--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Array question type&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;table class=&amp;quot;question subquestion-list questions-list &amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;caption class=&amp;quot;hide read&amp;quot;&amp;gt;Some explanation for accessibility.&amp;lt;/caption&amp;gt;&lt;br /&gt;
	&amp;lt;colgroup class=&amp;quot;col-responses&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;50%&amp;quot; class=&amp;quot;col-answers&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;25%&amp;quot; class=&amp;quot;odd&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;col width=&amp;quot;13.3%&amp;quot; class=&amp;quot;col-no-answer even&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;/colgroup&amp;gt;&lt;br /&gt;
	&amp;lt;thead&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array1 dontread&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;1&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;th&amp;gt;No answer&amp;lt;/th&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/thead&amp;gt;&lt;br /&gt;
	&amp;lt;tbody&amp;gt;&lt;br /&gt;
		&amp;lt;tr class=&amp;quot;array2 answers-list radio-list&amp;quot; id=&amp;quot;javatbdSGQ&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;th width=&amp;quot;20%&amp;quot; class=&amp;quot;answertext&amp;quot;&amp;gt;Some example subquestion&lt;br /&gt;
			&amp;lt;/th&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer_cell_001 answer-item radio-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;1&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;1&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
			&amp;lt;td class=&amp;quot;answer-item radio-item noanswer-item&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;label for=&amp;quot;answerSGQA&amp;quot; class=&amp;quot;hide read&amp;quot;&amp;gt;No answer&amp;lt;/label&amp;gt;&lt;br /&gt;
				&amp;lt;input type=&amp;quot;radio&amp;quot; value=&amp;quot;&amp;quot; id=&amp;quot;answerSGQA&amp;quot; name=&amp;quot;SGQA&amp;quot; class=&amp;quot;radio&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;/td&amp;gt;&lt;br /&gt;
		&amp;lt;/tr&amp;gt;&lt;br /&gt;
	&amp;lt;/tbody&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The full list of question classes== &amp;lt;!--T:71--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:72--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Question Type&#039;&#039;&#039;||&#039;&#039;&#039;Question Class&#039;&#039;&#039;||&#039;&#039;&#039;Question ID&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|5 point choice||.choice-5-pt-radio||5&lt;br /&gt;
|-&lt;br /&gt;
|Array (10 point choice)||.array-10-pt||B&lt;br /&gt;
|-&lt;br /&gt;
|Array (5 point choice)||.array-5-pt||A&lt;br /&gt;
|-&lt;br /&gt;
|Array (Flexible Labels) dual scale||.array-flexible-duel-scale ||1&lt;br /&gt;
|-&lt;br /&gt;
|Array (Increase, Same, Decrease)||.array-increase-same-decrease||E&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Numbers)||.array-multi-flexi ||:&lt;br /&gt;
|-&lt;br /&gt;
|Array (Multi Flexible) (Text)||.array-multi-flexi-text||;&lt;br /&gt;
|-&lt;br /&gt;
|Array (Yes/No/Uncertain)||.array-yes-uncertain-no||C&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels)||.array-flexible-row ||F&lt;br /&gt;
|-&lt;br /&gt;
|Array (flexible labels) by column||.array-flexible-column||H&lt;br /&gt;
|-&lt;br /&gt;
|Boilerplate question||.boilerplate||X&lt;br /&gt;
|-&lt;br /&gt;
|Date||.date||D&lt;br /&gt;
|-&lt;br /&gt;
|Gender||.gender||G&lt;br /&gt;
|-&lt;br /&gt;
|Huge free text||.text-huge||U&lt;br /&gt;
|-&lt;br /&gt;
|Language switch||.language||I&lt;br /&gt;
|-&lt;br /&gt;
|List (dropdown)||.list-dropdown||!&lt;br /&gt;
|-&lt;br /&gt;
|List (radio)||.list-radio||L&lt;br /&gt;
|-&lt;br /&gt;
|List with comment||.list-with-comment||O&lt;br /&gt;
|-&lt;br /&gt;
|Long free text||.text-long||T&lt;br /&gt;
|-&lt;br /&gt;
|Multiple numerical input||.numeric-multi||K&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options||.multiple-opt||M&lt;br /&gt;
|-&lt;br /&gt;
|Multiple options with comments||.multiple-opt-comments||P&lt;br /&gt;
|-&lt;br /&gt;
|Multiple short text||.multiple-short-txt||Q&lt;br /&gt;
|-&lt;br /&gt;
|Numerical input||.numeric||N&lt;br /&gt;
|-&lt;br /&gt;
|Ranking||.ranking||R&lt;br /&gt;
|-&lt;br /&gt;
|Short free text||.text-short||S&lt;br /&gt;
|-&lt;br /&gt;
|Yes/No||.yes-no||Y&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==The full list of validation classes== &amp;lt;!--T:73--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:74--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Note:  Prior to 1.92, only .mandatory and .input-error classes were available.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:75--&amp;gt;&lt;br /&gt;
These apply to the help and/or validation tip messages so that each type can be individually styled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:76--&amp;gt;&lt;br /&gt;
The .hide-tip option and .input-error options interact by default so that you can have validation tips hidden. However, they do appear when there are validation errors and disappear again when those errors are rectified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:77--&amp;gt;&lt;br /&gt;
All of these are designed to eliminate the need for pop-up alert messages. Instead, tips can appear/disappear as needed and are color-coded to indicate whether the answers pass the validation criteria.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:78--&amp;gt;&lt;br /&gt;
Furthermore, when you first visit a page that has unmet validation criteria, you can color-code the tips in a pleasing color to show which validation criteria have not been met yet; then re-display the page using a harsher color if the person submits the page with lingering validation errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:79--&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Purpose&#039;&#039;&#039;||&#039;&#039;&#039;CSS Class&#039;&#039;&#039;||&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|Mandatory||.mandatory||the question is mandatory&lt;br /&gt;
|-&lt;br /&gt;
|User input error||.input-error||the question had at least one validation error&lt;br /&gt;
|-&lt;br /&gt;
|Hide Tip||.hide-tip||added if you use the hide_tip option&lt;br /&gt;
|-&lt;br /&gt;
|Num answers||.em_num_answers||for for min_answers and max_answers&lt;br /&gt;
|-&lt;br /&gt;
|Value range||.em_value_range||for min/max_num_value_n and multiflexible_min/max&lt;br /&gt;
|-&lt;br /&gt;
|Sum range||.em_sum_range||for min/max/equals_num_value&lt;br /&gt;
|-&lt;br /&gt;
|Regex validation||.em_regex_validation||for regular-expression validation of the question&lt;br /&gt;
|-&lt;br /&gt;
|Question-level validation function||.em_q_fn_validation||for the em_validation_q option&lt;br /&gt;
|-&lt;br /&gt;
|Subquestion-level validation function||.em_sq_fn_validation||for the em_validation_sq option&lt;br /&gt;
|-&lt;br /&gt;
|Other comment mandatory||.em_other_comment_mandatory||for other_comment_mandatory option - shows when &amp;quot;other&amp;quot; is selected but associated comment is missing.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Importing styles into your custom template== &amp;lt;!--T:80--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:81--&amp;gt;&lt;br /&gt;
The custom question styles are near the bottom of each template&#039;s CSS file and start with:&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;/* --------------------------- START: Question styles  ------------------------------ */&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:83--&amp;gt;&lt;br /&gt;
If you&#039;re styling your own custom template, you should be able to copy everything after the above one from &#039;&#039;templates/default/template.css&#039;&#039; (for table-based layouts) or &#039;&#039;/templates/limespired/template.css&#039;&#039; (for CSS-based layouts) into your own style sheet without any impact on your other styles.&lt;br /&gt;
&lt;br /&gt;
==Internet Explorer conditional style sheets== &amp;lt;!--T:84--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:85--&amp;gt;&lt;br /&gt;
Because of the marked discrepancies in rendering between IE6 &amp;amp; IE7 and the other browsers, there are special IE conditional style sheets included for each template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:86--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_all-versions.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if lt IE 7]&amp;gt;&lt;br /&gt;
  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}IE_fix_older-than-7.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8]&amp;gt;&lt;br /&gt;
		&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;{TEMPLATEURL}ie_fix_8.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:87--&amp;gt;&lt;br /&gt;
You should include the above code within your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; and copies of both the IE style sheets from either &#039;&#039;/templates/default/&#039;&#039; or &#039;&#039;/templates/limespired&#039;&#039; for Tables base layout and CSS based layout respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:88--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; If you copy the styles into your own style sheet you will almost certainly need to tweak them.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alternative solution for Internet explorer=== &amp;lt;!--T:89--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:90--&amp;gt;&lt;br /&gt;
You can put a conditional class for body in startpage.pstpl and use this class in your template.css. This method is used in the citronade template{{ObsoleteIn|2.06}}. Adding a js / no-js class to have javascript / no javascript system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:91--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&amp;lt;!--[if lt IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie6 ielt7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 7 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie7 ielt8 ielt9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 8 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie8 ielt9  no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if IE 9 ]&amp;gt; &amp;lt;body class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} ie ie9 no-js&amp;quot;&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;!--[if gt IE 9]&amp;gt;&amp;lt;!--&amp;gt;&amp;lt;body id=&amp;quot;body&amp;quot; class=&amp;quot;lang-{SURVEYLANGUAGE} {SURVEYFORMAT} no-js&amp;quot;&amp;gt;&amp;lt;!--&amp;lt;![endif]--&amp;gt;&lt;br /&gt;
&amp;lt;script type=&#039;text/javascript&#039;&amp;gt;/*&amp;lt;![CDATA[*/(function(H){ H.className=H.className.replace(/\bno-js\b/,&#039;js&#039;) })(document.getElementsByTagName(&#039;body&#039;)[0]);/*]]&amp;gt;*/&amp;lt;/script&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:93--&amp;gt;&lt;br /&gt;
And in template.css use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:94--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;.ie6{/*specific for internet explorer 6*/}&lt;br /&gt;
.ielt8{/*specific for internet explorer 6 and 7*/}&lt;br /&gt;
.ie{/*specific for all internet explorer */}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Right-to-Left (RTL) Languages and justify== &amp;lt;!--T:97--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:98--&amp;gt;&lt;br /&gt;
The text editor within LimeSurvey is able to format RTL text. However, the editor itself shows the RTL language in a left to right format when justified. This is just an editor display issue. The RTL and justified question or text will display correctly from right to left, even when justified, in your survey or on preview.&lt;br /&gt;
&lt;br /&gt;
==Keywords== &amp;lt;!--T:99--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:309--&amp;gt;&lt;br /&gt;
{{Deprecated|3.0}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:100--&amp;gt;&lt;br /&gt;
Keywords within a template file get replaced by the current survey information. They are surrounded by curly brackets, for example: {SURVEYNAME}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:101--&amp;gt;&lt;br /&gt;
The following strings will be replaced by LimeSurvey when parsing the template file and presenting it to survey users. These field strings will work on almost every template except for the &#039;Completed Page&#039;. (Most of these strings can be found in the common.php file. If it&#039;s not there, look in the index.php file.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:102--&amp;gt;&lt;br /&gt;
{|class=wikitable&lt;br /&gt;
!&#039;&#039;&#039;Keyword&#039;&#039;&#039;!!&#039;&#039;&#039;Template files&#039;&#039;&#039;!!&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYNAME}||All Files||The survey title&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYDESCRIPTION}||All Files||The survey description&lt;br /&gt;
|-&lt;br /&gt;
|{WELCOME}||All files (mainly for welcome.pstpl)||The survey &#039;welcome&#039; text&lt;br /&gt;
|-&lt;br /&gt;
|{PERCENTCOMPLETE}||survey.pstpl||A small graph showing the percentage of the survey completed&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPNAME}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group name&lt;br /&gt;
|-&lt;br /&gt;
|{GROUPDESCRIPTION}||startgroup.pstpl, groupdescription.pstpl, endgroup.pstpl||Displays the current group description&lt;br /&gt;
|-&lt;br /&gt;
|{NUMBEROFQUESTIONS}||welcome.pstpl||Displays the total number of questions in the survey (just the number)&lt;br /&gt;
|-&lt;br /&gt;
|{THEREAREXQUESTIONS}||welcome.pstpl||Displays the sentence &amp;quot;There are X questions in this survey&amp;quot; - from the relevant language file. The X is replaced with the number of questions. Note that this will also work appropriately for singular or plural. If there is only 1 question, it will print &amp;quot;There is 1 question in this survey&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|{CHECKJAVASCRIPT}||All files (mainly for welcome.pstpl)||Warning message when end-user browser have javascript disabled&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION}||Question.pstpl||(&#039;&#039;&#039;Has been superseeded as of LS1.87&#039;&#039;&#039;) Displays the current question text (The format of {QUESTION} can customised by editing &#039;question_start.pstpl&#039;) Use the following: {QUESTION_TEXT}, {QUESTION_MANDATORY}, {QUESTION_HELP}, {QUESTION_MAN_MESSAGE}, {QUESTION_VALID_MESSAGE}, {QUESTION_INPUT_ERROR_CLASS}, and appropriate wrapping HTML instead of {QUESTION}&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWER}||question.pstpl, print_question.pstpl||presents the answer form for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{SGQ}||question.pstpl, question text||Can be used in the question text itself to reference the input field of the question dynamically by displaying the Survey-Group-Question id for the current question. (as of svn build 9755)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTIONHELP}||question.pstpl, print_question.pstpl||Displays help text (predefined tip for question type) for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CLASS}||question.pstpl, print_question.pstpl||unique class for each question type. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_CODE}||question.pstpl, print_question.pstpl||Displays the current question code&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ESSENTIALS}||question.pstpl||the question ID and (if a question is conditional), &#039;style=&amp;quot;display:none;&amp;quot;&#039;. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_HELP}||question.pstp, question_start.pstpl||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TYPE_HELP}||print_question.pstp||Displays the user defined help text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_INPUT_ERROR_CLASS}||question.pstp, question_start.pstpl||Provides a class if there was user input error&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_ID}||print_question.pstp||Provides a unique ID for each question to allow styling for specific questions&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_TEXT}||question.pstp, print_question.pstp, question_start.pstpl||Displays the text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MANDATORY}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_CLASS}||question.pstpl, print_question.pstpl||class if a question is mandatory. (To be included in the question&#039;s wrapping tag.)&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_MAN_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated &#039;Mandatory&#039; help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_NUMBER}||print_question.pstpl||Incremental count of questions.&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_VALID_MESSAGE}||question.pstp, print_question.pstp, question_start.pstpl||Displays the translated valid help message text for the current question&lt;br /&gt;
|-&lt;br /&gt;
|{QUESTION_SCENARIO}||print_question.pstp||Prints out the &#039;scenario&#039; text for conditional questions.&lt;br /&gt;
|-&lt;br /&gt;
|{NAVIGATOR}||navigator.pstpl||Displays navigation buttons (next, prev, last)&lt;br /&gt;
|-&lt;br /&gt;
|{CLEARALL}||All files (but intended for navigator.pstpl)||Displays the &amp;quot;Exit and Clear Results&amp;quot; link&lt;br /&gt;
|-&lt;br /&gt;
|{COMPLETED}||completed.pstpl||Displays the &#039;completed&#039; message for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{URL}||completed.pstpl||Displays the survey &#039;url&#039; and &#039;url text&#039;&lt;br /&gt;
|-&lt;br /&gt;
|{PRIVACYMESSAGE}||privacy.pstpl||The privacy message is shown if you set your survey to be anonymous. [[Translating LimeSurvey|The text can be edited/translated]] in the language files. This can also be changed manually by editing the privacy.pstpl template you wish to use.&lt;br /&gt;
|-&lt;br /&gt;
|{TEMPLATEURL}||All Files||The URL to the current template location (useful for referencing image files in your template)&lt;br /&gt;
|-&lt;br /&gt;
|{SURVEYRESOURCESURL}||All Files||The URL to the current uploaded files for this survey location (useful for referencing image files in your question, group, ....)&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITCOMPLETE}||endpage.pstpl||The statement (from the language files) that tells the user they have completed the survey, and to press the &amp;quot;Submit&amp;quot; button&lt;br /&gt;
|-&lt;br /&gt;
|{SUBMITREVIEW}||survey.pstpl||The statement (from the language files) that tells the user they can review/change the answers they have made by clicking &amp;quot;&amp;lt;&amp;lt; prev&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{SAVEDID}||All Files||Displays &#039;Response ID&#039; of user&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|{QUEXMLPDF}||All Files||Displays button to export the queXML PDF of questionnaire including answers entered up until the point that has been completed in the survey.&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:FIRSTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users first name from the tokens table&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:LASTNAME}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users last name from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:EMAIL}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users email from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_1}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_1 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{TOKEN:ATTRIBUTE_2}||All Files||***If survey answers are NOT ANONYMOUS - gets replaced with the users attribute_2 from the tokens table***&lt;br /&gt;
|-&lt;br /&gt;
|{ANSWERSCLEARED}||Preferably in navigator.pstpl||The &amp;quot;Answers Cleared&amp;quot; statement from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{RESTART}||clearall.pstpl||URL to restart the survey&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERERROR}||register.pstpl||Shows any error messages in the register page (ie: &amp;quot;You must include an email address&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE1}||register.pstpl||The statement &amp;quot;You must be registered to complete this survey&amp;quot; from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERMESSAGE2}||register.pstpl||Details about registering from the language files&lt;br /&gt;
|-&lt;br /&gt;
|{REGISTERFORM}||register.pstpl||The actual form for registering, will change depending on whether the attribute_1 and attribute_2 fields are set.&lt;br /&gt;
|-&lt;br /&gt;
|{SAVE}||Works suitable on navigator.pstpl||Displays the &#039;Save your responses so far&#039; button to offer the user to save and come back later to continue the survey. If the Save option is deactivated in the survey properties the tag will not be shown and ignored.&lt;br /&gt;
|-&lt;br /&gt;
|{LANGUAGECHANGER}||survey.pstpl||Displays a switch in multilingual surveys to change the question.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Input/Buttons== &amp;lt;!--T:103--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:104--&amp;gt;&lt;br /&gt;
Each &amp;quot;input&amp;quot; type in a survey has been given its own class name, so that you can add CSS to your &amp;quot;startpage.pstpl&amp;quot; file and have some control over the appearance of form buttons and inputs. These class names are as follows:&lt;br /&gt;
*&#039;&#039;&#039;submit&#039;&#039;&#039; (Submit Buttons)&lt;br /&gt;
*&#039;&#039;&#039;text&#039;&#039;&#039; (Text Inputs - for short free text, date, and numerical type)&lt;br /&gt;
*&#039;&#039;&#039;answertext&#039;&#039;&#039; (Text of answers)&lt;br /&gt;
*&#039;&#039;&#039;radio&#039;&#039;&#039; (Radio Buttons)&lt;br /&gt;
*&#039;&#039;&#039;checkbox&#039;&#039;&#039; (Check Boxes)&lt;br /&gt;
*&#039;&#039;&#039;select&#039;&#039;&#039; (Select / List Boxes)&lt;br /&gt;
*&#039;&#039;&#039;textarea&#039;&#039;&#039; (Large text inputs - for long free text)&lt;br /&gt;
*&#039;&#039;&#039;clearall&#039;&#039;&#039; (The &amp;quot;Exit and Clear Survey&amp;quot; link)&lt;br /&gt;
*&#039;&#039;&#039;rank&#039;&#039;&#039; (The rank style question. Doesn&#039;t set the colour of the select box or the text boxes, but it does allow the changing of background colour, text colour, size etc., for the rest of the ranking question)&lt;br /&gt;
*&#039;&#039;&#039;graph&#039;&#039;&#039; (The &amp;quot;percentage completed&amp;quot; graph table)&lt;br /&gt;
*&#039;&#039;&#039;innergraph&#039;&#039;&#039; (The table inside the graph table - this contains the 0% and 100% text. Use this for changing the size of this text)&lt;br /&gt;
*&#039;&#039;&#039;question&#039;&#039;&#039; (General settings for any question that is displayed within a table. Generally, you should use this to make sure that their font size and color is the same as you have used elsewhere as a default)&lt;br /&gt;
*&#039;&#039;&#039;mandatory&#039;&#039;&#039;  (Mandatory questions)&lt;br /&gt;
*&#039;&#039;&#039;input-error&#039;&#039;&#039; (User input error - for if a user has made a mistake with a mandatory question or question with validation)&lt;br /&gt;
*&#039;&#039;&#039;array1&#039;&#039;&#039; and &#039;&#039;&#039;array2&#039;&#039;&#039; (These two styles are cycled when presenting the range of answers for an array type question. This allows you to set an alternating background color for these question types. &#039;&#039;&#039;Array1&#039;&#039;&#039; is also used for the column headings in these question types)&lt;br /&gt;
*&#039;&#039;&#039;errormandatory&#039;&#039;&#039; (Sets the color and style of the &amp;quot;This question is mandatory&amp;quot; error message)&lt;br /&gt;
*&#039;&#039;&#039;warningjs&#039;&#039;&#039; (Sets the color and style of the warning message displayed if the participant&#039;s browser has javascript disabled)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:105--&amp;gt;&lt;br /&gt;
There are also some elements that can be accessed using the ID of the element (&#039;&#039;&#039;#ID&#039;&#039;&#039; in CSS):&lt;br /&gt;
*&#039;&#039;&#039;surveycontact&#039;&#039;&#039; (The contact message shown on the start page)&lt;br /&gt;
*&#039;&#039;&#039;tokenmessage&#039;&#039;&#039; (used for messages inside the survey, e.g. the session expired error message)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:107--&amp;gt;&lt;br /&gt;
Because you can edit all the HTML aspects, there&#039;s no reason to surround your templates with a &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&#039;new_name&#039;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and then define a css for that new_name class.&lt;br /&gt;
&lt;br /&gt;
==Styling the progress bar== &amp;lt;!--T:108--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:112--&amp;gt;&lt;br /&gt;
The progress bar appearance can be modified with CSS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:113--&amp;gt;&lt;br /&gt;
To change the background color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:114--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-header {&lt;br /&gt;
 background-color: #3300FF;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:117--&amp;gt;&lt;br /&gt;
To change the border color of the bar, add something like the following to the end of your template.css file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:118--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;#progress-wrapper .ui-widget-content,&lt;br /&gt;
#progress-wrapper .ui-widget-header {&lt;br /&gt;
 border: 1px solid #FF0000;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advanced Features Available to Developers== &amp;lt;!--T:121--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:122--&amp;gt;&lt;br /&gt;
LimeSurvey has integrated some user-made patches that permits some special changes. These very advanced features (generally) require changes to the underlying code base of LimeSurvey and should be done carefully in order not to introduce security holes.&lt;br /&gt;
&lt;br /&gt;
===Support for your own Javascript functions=== &amp;lt;!--T:134--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:135--&amp;gt;&lt;br /&gt;
Some users may need to run Javascript on the survey pages, but calling &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; in the BODY element made it impossible to do so. This call has been replaced with a small JavaScript function in the HEAD that sniffs for the existence of &#039;&#039;&#039;checkconditions()&#039;&#039;&#039; and &#039;&#039;&#039;template_onload()&#039;&#039;&#039; before calling them. In this way, a template author can create his or her own &#039;&#039;&#039;template_onload()&#039;&#039;&#039; function in the HEAD that replaces the default one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:136--&amp;gt;&lt;br /&gt;
*Disable XSS filter - in Global settings -&amp;gt; Security, set &amp;quot;Filter HTML for XSS&amp;quot; to No.&lt;br /&gt;
*Enter your script in the source of a question or group description.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:301--&amp;gt;&lt;br /&gt;
{{Note|For further details, see the [[Workarounds: Manipulating a survey at runtime using Javascript#How to use Script (eg. JavaScript etc.) in LimeSurvey|workaround section]].}}&lt;br /&gt;
&lt;br /&gt;
=Videos on Templates= &amp;lt;!--T:137--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:138--&amp;gt;&lt;br /&gt;
This video will demonstrate the basic and advanced template functions that are available to all LimeSurvey users. This includes changing the appearance of certain forms and inserting custom graphics. Additionally, it will thoroughly walk you through on how to edit and preview specific page templates, importing/exporting templates, modify appearance of questions in the CSS, and customizing survey description page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:302--&amp;gt;&lt;br /&gt;
Video - needed&lt;br /&gt;
&lt;br /&gt;
=Tips &amp;amp; Tricks= &amp;lt;!--T:145--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some language specific element== &amp;lt;!--T:146--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:147--&amp;gt;&lt;br /&gt;
If you want to have some language specific sentence in a survey, for example a help at the end of each page, you can add in a .pstl file a sentence and hidding it for other language. If we hide it in the template.css, we can use the pseudo selector :lang, but we use some class for better compatibility.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:148--&amp;gt;&lt;br /&gt;
Below, there are two help sentences, in French and English. Put this on endpage.pstpl:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:149--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;fr&amp;quot; lang=&amp;quot;fr&amp;quot;&amp;gt;Pour de l&#039;aide en direct appelez le 000000&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;en&amp;quot; lang=&amp;quot;en&amp;quot;&amp;gt;For some help, please call 000000&amp;lt;/div&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:151--&amp;gt;&lt;br /&gt;
and in template.css:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:152--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;.lang-fr .en{display:none}&lt;br /&gt;
.lang-en .fr{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change the layout of the survey page== &amp;lt;!--T:155--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:156--&amp;gt;&lt;br /&gt;
After editing and saving a template, it applies to a survey list page only if it is selected from the settings of the survey. To make it the default template, go under the &#039;&#039;&#039;General tab&#039;&#039;&#039; located in the &#039;&#039;&#039;Global settings&#039;&#039;&#039; of your LimeSurvey installation and choose the desired template. From now on, all the templates that use the &amp;quot;default&amp;quot; option as template plus the ones that are going to be newly created, will use the newly selected default template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:157--&amp;gt;&lt;br /&gt;
To use your current template for this page, you have to change the according setting from &#039;&#039;&#039;Global settings&#039;&#039;&#039;. In older versions, this change can be done by editing the $defaulttemplate setting from the config file: copy this setting from config-defaults.php to config.php which overrides config-defaults.php and edit this setting to &amp;lt;code lang=&amp;quot;html&amp;quot;&amp;gt;$defaulttemplate = &#039;yourtemplatename&#039;;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Import/Export of templates: Mac users== &amp;lt;!--T:158--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:159--&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;Mac users&amp;lt;/u&amp;gt;, please note that the Mac OSX default archive utility may have problems with zip folders &amp;quot;generated on the fly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:160--&amp;gt;&lt;br /&gt;
A workaround is to unix&#039;es unzip from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:161--&amp;gt;&lt;br /&gt;
$ unzip template.zip -d template&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:162--&amp;gt;&lt;br /&gt;
Archive: template.zip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:163--&amp;gt;&lt;br /&gt;
 inflating: template/startpage&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:164--&amp;gt;&lt;br /&gt;
 inflating: ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:165--&amp;gt;&lt;br /&gt;
Another workaround is to use scripts in their mac-compiled counterparts.&lt;br /&gt;
&lt;br /&gt;
==Replacing the help icon {{ObsoleteIn|2.50}} == &amp;lt;!--T:173--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:174--&amp;gt;&lt;br /&gt;
When a question help text is shown, then an help.gif image is used from the default template folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:175--&amp;gt;&lt;br /&gt;
You can replace this image by uploading a new help.gif, help.png or help.jpg in your custom template folder. It will then be automatically used instead of the default help icon.&lt;br /&gt;
&lt;br /&gt;
==Replacing an existing logo {{NewIn|2.50}} {{ObsoleteIn|3.0}}== &amp;lt;!--T:176--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:177--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In the &#039;&#039;&#039;default&#039;&#039; Template of 2.50, there is no preembedded logo. Read further our [[#Adding_your_own_logo |wiki on how to add your own logo]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:178--&amp;gt;&lt;br /&gt;
1. To edit the logo go to the &#039;&#039;&amp;lt;u&amp;gt;template.css&amp;lt;/u&amp;gt;&#039;&#039; file which you can find it here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:179--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t1.PNG|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:180--&amp;gt;&lt;br /&gt;
2. Click the search button to find occurrences of logo related styles and search for &#039;&#039;logo&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:181--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:2.png|200px]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:184--&amp;gt;&lt;br /&gt;
4. Edit the main style file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:185--&amp;gt;&lt;br /&gt;
You will see something similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:186--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:t4.PNG|500px]]&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:187--&amp;gt;&lt;br /&gt;
If you want to change the image, just replace logo.gif with another image link. Example: (&amp;lt;u&amp;gt;logo.png&amp;lt;/u&amp;gt; or &amp;lt;u&amp;gt;logo.jpg&amp;lt;/u&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:188--&amp;gt;&lt;br /&gt;
If you want to change the image size, adjust width and height (in pixels) like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:189--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;width:100px; height:100px;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo {{ObsoleteIn|3.0}} == &amp;lt;!--T:190--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
1. Find and open the &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; template file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:192--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:startpage.pstpl.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
2. After this&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot; &amp;gt;&amp;lt;div id=&amp;quot;topContainer&amp;quot; class=&amp;quot;jumbotron&amp;quot;&amp;gt;&amp;lt;/source&amp;gt; &lt;br /&gt;
add this line to &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;img id=&#039;page_logo&#039; src=&#039;{TEMPLATEURL}/files/logo.png&#039; class=&amp;quot;clearfix pull-right&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
3. To upload your own logo, go to the template editor and upload your logo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:197--&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:uploadyourlogo.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:199--&amp;gt;&lt;br /&gt;
To position your logo, please use one of the following css classes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:293--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the left side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:200--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-left&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:204--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want the logo to be placed on the right side:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:205--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix pull-right&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:208--&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;If you want to center the logo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:209--&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;html&amp;quot;&amp;gt;clearfix center-block&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the same template with different logos== &amp;lt;!--T:214--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:215--&amp;gt;&lt;br /&gt;
If you want to use the same template for all surveys and just want to change the logo for each survey, you can use the {SID} placeholder in the template .pstpl file and thereby refer to different images:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:216--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;{TEMPLATEURL}files/logoImage-{SID}.png&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the default help to all question (hide_tip) {{ObsoleteIn|1.92}}== &amp;lt;!--T:217--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:218--&amp;gt;&lt;br /&gt;
There are 3 solutions to remove the default help:&lt;br /&gt;
# like a hide_tip attribute but for all question and survey.&lt;br /&gt;
# you can remove the {QUESTIONHELP} and its container from the file question.pstl. However, it can be a bad idea for the screenreader.&lt;br /&gt;
# for the default template and some other, add this at the end of tempate.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:219--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;span.questionhelp{display:none;}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Display custom favicon== &amp;lt;!--T:220--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:221--&amp;gt;&lt;br /&gt;
A favicon is the little icon you see in the browser&#039;s address bar, list of bookmarks or tab. You can display your own icon as follows:&lt;br /&gt;
#Create a favicon - google will find you lots of free favicon generators.&lt;br /&gt;
#Name your new favicon &amp;quot;favicon.ico&amp;quot; and place it in your template /files directory.&lt;br /&gt;
#Add the following code to your &#039;&#039;&#039;startpage.pstpl&#039;&#039;&#039; before the &amp;lt;/head&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:222--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html4strict&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;link rel=&amp;quot;shortcut icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;icon&amp;quot; href=&amp;quot;{TEMPLATEURL}files/favicon.ico&amp;quot; type=&amp;quot;image/x-icon&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Different appearance for survey-/question-pages== &amp;lt;!--T:224--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:226--&amp;gt;&lt;br /&gt;
If you want LimeSurvey to change the appearance of every second page (i.e. of even and odd survey pages), you can use &#039;&#039;&#039;.page-odd&#039;&#039;&#039; class in your CSS file to change the appearance of odd pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:227--&amp;gt;&lt;br /&gt;
An example from default template of LimeSurvey 1.91+:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:228--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.page-odd table.question-group {&lt;br /&gt;
 background-color: #D2F2D3;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:232--&amp;gt;&lt;br /&gt;
If you do &#039;&#039;&#039;not&#039;&#039;&#039; want differentiate even and odd pages, find all instances of &#039;&#039;.page-odd&#039;&#039; in template.css and remove those styles.&lt;br /&gt;
&lt;br /&gt;
==Create a vertical separator  border for dual scale array== &amp;lt;!--T:233--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:234--&amp;gt;&lt;br /&gt;
To create a vertical separator border for a dual scale array, you can add the following lines to your &#039;&#039;&#039;template.css&#039;&#039;&#039;-file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:235--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
table.question thead td.header_separator,&lt;br /&gt;
table.question tbody td.dual_scale_separator&lt;br /&gt;
{&lt;br /&gt;
   border-right:solid 1px #00A8E1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:242--&amp;gt;&lt;br /&gt;
&#039;&#039;header_separator&#039;&#039; is used to adress the separator for the header &amp;quot;td&amp;quot;. The &amp;quot;dual_scale_separator&amp;quot; is used to address the separator column in the dual scale array.&lt;br /&gt;
&lt;br /&gt;
==Hide the survey contact message shown on the start page/survey list {{ObsoleteIn|3.0}} == &amp;lt;!--T:243--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:244--&amp;gt;&lt;br /&gt;
To hide the &amp;quot;Please contact ...&amp;quot; message on the start page (with the survey list), you can add the following to the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.js&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:245--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:246--&amp;gt;&lt;br /&gt;
$(&#039;#surveycontact&#039;).hide(); //Hides the survey contact message&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:247--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remove the survey contact message shown on error messages {{ObsoleteIn|3.0}}== &amp;lt;!--T:248--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:249--&amp;gt;&lt;br /&gt;
If you want to remove the survey contact message from error messages, it&#039;ll be trickier. You can add the function from below. It calls the &#039;&#039;&#039;$(document).ready&#039;&#039;&#039; function in the &#039;&#039;&#039;template.css&#039;&#039;&#039; of your used design template:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:250--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
removeContactAdressFromMessage(); //Removes the survey contact message from error messages&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:253--&amp;gt;&lt;br /&gt;
and add the following function to your *template.js* file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:254--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
function removeContactAdressFromMessage()&lt;br /&gt;
{&lt;br /&gt;
if ($(&#039;#tokenmessage&#039;).length &amp;gt; 0)&lt;br /&gt;
   {&lt;br /&gt;
   var oldMessage = $(&#039;#tokenmessage&#039;).html();&lt;br /&gt;
   var indexContact = oldMessage.indexOf(&#039;Bitte kontaktieren&#039;);&lt;br /&gt;
   var newMessage = oldMessage.substr(0, indexContact);&lt;br /&gt;
   $(&#039;#tokenmessage&#039;).html(newMessage);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:266--&amp;gt;&lt;br /&gt;
It will probably not work for a survey in English language and has to be extended when used for multilingual surveys. But it&#039;s an idea/tip on how to solve this.&lt;br /&gt;
&lt;br /&gt;
==How to deal with multilingual question attributes {{ObsoleteIn|2.50}}== &amp;lt;!--T:267--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:268--&amp;gt;&lt;br /&gt;
If you have a multilingual survey and e. g. want to use a different string for the &amp;quot;other&amp;quot; field, this could only be done for the base language (until this feature was added at LimeSurvey 2.0). To work around this, paste in the field to change the label for &amp;quot;other&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:269--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;en&amp;quot;&amp;gt;New label&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;fr&amp;quot;&amp;gt;Nouveau label&amp;lt;/span&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:270--&amp;gt;&lt;br /&gt;
Add in the template.css of your template (at &#039;&#039;/limesurvey/upload/templates/&amp;lt;yourtemplatename&amp;gt;/template.css&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:271--&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;html:lang(en) .fr{display:none}&lt;br /&gt;
html:lang(fr) .en{display:none}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Adding your own logo to the survey list {{ NewIn|3.0}} == &amp;lt;!--T:310--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:311--&amp;gt;&lt;br /&gt;
# First please open the theme editor for the theme you like to use. [[File:OpenThemeEditor.jpg]]&lt;br /&gt;
# We recommend to use fruity, it is our best theme currently. &lt;br /&gt;
# Then extend the theme and give it a name you will recognize. [[File:ExtendTheme.jpg]]&lt;br /&gt;
# In the following view you may upload the logo you want to use. [[File:UploadFileTheme.jpg]]&lt;br /&gt;
# Select the editor screen `Survey List´ in the Screen dropdown in the top right corner. [[File:OpenScreenSurveyList.jpg]]&lt;br /&gt;
# Then select `layout_survey_list.twig´ in the left side menu. [[File:EditLayoutSurveyListTwig.jpg]]&lt;br /&gt;
# In the editor scroll to line 126 and change the marked part to the filename of the image you uploaded to the theme before. [[File:ChangeSurveyListHeaderImageEditor.jpg]]&lt;br /&gt;
# Save your file. [[File:ThemeEditorSaveChanges.jpg]]&lt;br /&gt;
# Change default theme to your extended theme. [[File:ChangeDefaultTheme.jpg]]&lt;br /&gt;
&lt;br /&gt;
=Custom Question Views {{NewIn|3.0}}= &amp;lt;!--T:289--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:290--&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; This is a temporary feature to be replaced in the future by question object (it will be very easy to move custom views to question object). It is disabled by default.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:291--&amp;gt;&lt;br /&gt;
As of version 2.5, you can create template-specific custom views for questions and some of their incorporated elements. This is useful if you want to modify the HTML layout of a particular question type for one or more surveys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:292--&amp;gt;&lt;br /&gt;
*In application/config/config.php, find &#039;config&#039;=&amp;gt;array and add this line to the array : &#039;allow_templates_to_overwrite_views&#039;=&amp;gt;1&lt;br /&gt;
*In /{your_template}/config.xml, set &amp;quot;overwrite_question_views&amp;quot; to true&lt;br /&gt;
*Copy application/views/survey/* to template/{your_view_directory}/survey/&lt;br /&gt;
*Note that you only need to copy the files that you intend to modify but the file structure must remain the same as in application/views/survey/&lt;br /&gt;
&lt;br /&gt;
=Insert Custom CSS or JavaScript files for template {{NewIn|2.50}}= &amp;lt;!--T:296--&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:303--&amp;gt;&lt;br /&gt;
As of version 2.50, you can use the config.xml file to automatically load plugin files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:304--&amp;gt;&lt;br /&gt;
*Upload your files to the template /css or /scripts folder&lt;br /&gt;
*In /{your_template}/config.xml, add the file paths to the &amp;lt;css&amp;gt; or &amp;lt;js&amp;gt; blocks, something like this:&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;css&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/jquery-ui-custom.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/bootstrap-slider.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:305--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;css/flat_and_modern.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:306--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/template.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:307--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;css/myCustomPlugin.css&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/css&amp;gt;&lt;br /&gt;
&amp;lt;js&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/template.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
	&amp;lt;filename&amp;gt;scripts/bootstrap-slider.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;!--T:308--&amp;gt;&lt;br /&gt;
&amp;lt;filename&amp;gt;scripts/myCustomPlugin.js&amp;lt;/filename&amp;gt;&lt;br /&gt;
&amp;lt;/js&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87948</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87948"/>
		<updated>2018-02-15T17:50:20Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Creating a template from scratch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  to avoid that, you can force the use to the XML rather than DB. In config.php turn debug mode on and uncommment:&lt;br /&gt;
&lt;br /&gt;
&#039;force_xmlsettings_for_survey_rendering&#039; =&amp;gt; true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development) &lt;br /&gt;
&lt;br /&gt;
Becareful: everything will be loaded from the XML (included options, etc)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Teeme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87695</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87695"/>
		<updated>2018-02-14T13:21:55Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
[[File:Clearassets-ls3 3.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Teeme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=File:Clearassets-ls3_3.png&amp;diff=87673</id>
		<title>File:Clearassets-ls3 3.png</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=File:Clearassets-ls3_3.png&amp;diff=87673"/>
		<updated>2018-02-14T09:55:45Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: clear assets button in global settings in LS 3.3.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;clear assets button in global settings in LS 3.3.0&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87672</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87672"/>
		<updated>2018-02-14T09:39:36Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can refresh the  assets cache&#039;&#039;&#039;: from Global Settings -&amp;gt; General -&amp;gt; Clear asset cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Teeme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87671</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87671"/>
		<updated>2018-02-14T09:35:30Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Creating a template from scratch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;:  if you manually edit the CSS/JS files (without using the Teeme Editor), and if debug mode is off, you can now force the asset to be flushed. In &amp;quot;Global Settings&amp;quot;, &amp;quot;General tab&amp;quot;, click the button &amp;quot;Clear assets cache:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87670</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87670"/>
		<updated>2018-02-14T09:34:34Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Creating a template from scratch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
 NOTE:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account. &lt;br /&gt;
&lt;br /&gt;
 NOTE:  if you manually edit the CSS/JS files (without using the Teeme Editor), and if debug mode is off, you can now force the asset to be flush from Global Settings (General tab, &amp;quot;Clear assets cache:&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87669</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87669"/>
		<updated>2018-02-14T09:34:10Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Creating a template from scratch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
NOTE:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account.&lt;br /&gt;
NOTE:  if you manually edit the CSS/JS files (without using the Teeme Editor), and if debug mode is off, you can now force the asset to be flush from Global Settings (General tab, &amp;quot;Clear assets cache:&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87375</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=87375"/>
		<updated>2018-02-13T18:02:09Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Creating a template from scratch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
NOTE:  if you edit the XML file of a theme, you must uninstall and reinstall the theme so it&#039;s taken into account.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84834</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84834"/>
		<updated>2018-01-18T16:36:38Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Adding custom fonts to my theme */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84833</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84833"/>
		<updated>2018-01-18T12:46:29Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Creating your own font selector in options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.font-my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you only needs to add a new option in the files options.twig and options.js, to be able to replace my_custom_font by my_custom_other_font. It will be very similar to the fruity custom theme selector. So, first, let&#039;s have a look to the fruity custom theme selector. The options of the selectors are defined here:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.twig#L215-L224&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.twig#L873-L894&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The values are parsed from simple option to advanced form automagically via the JS, so if you use our option.js you will not need to change it:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.js&lt;br /&gt;
&lt;br /&gt;
* So, in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84832</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84832"/>
		<updated>2018-01-18T12:44:52Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* The easy way: using Google Font CDN */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L230&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you only needs to add a new option in the files options.twig and options.js, to be able to replace my_custom_font by my_custom_other_font. It will be very similar to the fruity custom theme selector. So, first, let&#039;s have a look to the fruity custom theme selector. The options of the selectors are defined here:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.twig#L215-L224&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.twig#L873-L894&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The values are parsed from simple option to advanced form automagically via the JS, so if you use our option.js you will not need to change it:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.js&lt;br /&gt;
&lt;br /&gt;
* So, in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84831</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84831"/>
		<updated>2018-01-18T12:33:19Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Creating your own font selector in options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L225&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you only needs to add a new option in the files options.twig and options.js, to be able to replace my_custom_font by my_custom_other_font. It will be very similar to the fruity custom theme selector. So, first, let&#039;s have a look to the fruity custom theme selector. The options of the selectors are defined here:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.twig#L215-L224&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.twig#L873-L894&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The values are parsed from simple option to advanced form automagically via the JS, so if you use our option.js you will not need to change it:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.js&lt;br /&gt;
&lt;br /&gt;
* So, in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84830</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84830"/>
		<updated>2018-01-18T12:32:47Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Adding custom fonts to my theme */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L225&lt;br /&gt;
&lt;br /&gt;
=== Using local font  ===&lt;br /&gt;
Of course, you can also download the font files and use them from local server rather than from Google CDN (better for privacy). To have an example of how to it, here our local version of noto font:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  font-weight: 300;&lt;br /&gt;
  font-style: normal;&lt;br /&gt;
  src: url(&#039;./font-src/Noto/NotoSans-Regular.ttf&#039;);&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use a very similar definition in your theme css file, and then by copying the file NotoSans-Regular.ttf  in your theme css/font-src/ folder. &lt;br /&gt;
&lt;br /&gt;
Then, apply that font to your body (or any other element) like above, and remove the default option font selector.&lt;br /&gt;
&lt;br /&gt;
=== Creating your own font selector in options  ===&lt;br /&gt;
For now, you can&#039;t easily use the core font selector to add your own font in options. We need first to give the possibility to end user to upload custom packages (see next paragraph: A look into the Fruity Font Selector ) &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here how to proceed:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Add two fonts (my_custom_font and my_custom_other_font) into your theme, using CDN or local server &lt;br /&gt;
*Then, in your css file, add two new classes:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
.font-my_custom_font {&lt;br /&gt;
 font-family: &#039;my_custom_font &#039;;&lt;br /&gt;
}&lt;br /&gt;
.my_custom_other_font {&lt;br /&gt;
 font-family: &#039;my_custom_other_font&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*In the XML file of your theme, add a font option (default one will be my_custom_font) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;my_custom_font&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you only needs to add a new option in the files options.twig and options.js, to be able to replace my_custom_font by my_custom_other_font. It will be very similar to the fruity custom theme selector. So, first, let&#039;s have a look to the fruity custom theme selector. The options of the selectors are defined here:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.twig#L215-L224&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.twig#L873-L894&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The values are parsed from simple option to advanced form automagically via the JS, so if you use our option.js you will not need to change it:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/fruity/options/options.js&lt;br /&gt;
&lt;br /&gt;
* So, in option.twig, add you font picker adding those lines (untested for now, so come complain to the forum if it doesn&#039;t work):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
            &amp;lt;div class=&#039;row ls-space margin top-15 bottom-15 action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;hr/&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;div class=&#039;row action_hide_on_inherit&#039;&amp;gt;&lt;br /&gt;
                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&#039;panel panel-default&#039;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-heading&#039;&amp;gt;{{ &amp;quot;My custom fonts&amp;quot; | t }}&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&#039;panel-body&#039;&amp;gt;&lt;br /&gt;
                            &amp;lt;div class=&#039;form-group row&#039;&amp;gt;&lt;br /&gt;
                                &amp;lt;label for=&#039;simple_edit_font&#039; class=&#039;control-label&#039;&amp;gt;{{ &amp;quot;Select font:&amp;quot; | t }}&amp;lt;/label&amp;gt;&lt;br /&gt;
                                &amp;lt;div class=&#039;col-sm-12&#039;&amp;gt;&lt;br /&gt;
                                    &amp;lt;select class=&#039;form-control selector_option_value_field&#039; id=&#039;simple_edit_font&#039; name=&#039;font&#039;&amp;gt;&lt;br /&gt;
                                    {% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}&lt;br /&gt;
                                        {% set fontOptions = fontOptions ~ &#039;&amp;lt;option value = &amp;quot;inherit&amp;quot; &amp;gt; Inherit&amp;lt;/option&amp;gt;&#039; %}&lt;br /&gt;
                                    {% endif %}&lt;br /&gt;
                                   &amp;lt;optgroup  label=&amp;quot;{{ &amp;quot;My Custom fonts&amp;quot; | t }}&amp;quot;&amp;gt;&lt;br /&gt;
                                   &amp;lt;option class=&amp;quot;font-my_custom_font&amp;quot;     value=&amp;quot;custom_font&amp;quot;   data-font-package=&amp;quot;&amp;quot;  &amp;gt;Custom&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;option class=&amp;quot;font-my_custom_other_font&amp;quot; value=&amp;quot;my_custom_other_font&amp;quot; data-font-package=&amp;quot;&amp;quot;  &amp;gt;Other&amp;lt;/option&amp;gt;&lt;br /&gt;
                                  &amp;lt;/optgroup&amp;gt;&lt;br /&gt;
                                   &lt;br /&gt;
                                    &amp;lt;/select&amp;gt;&lt;br /&gt;
                                &amp;lt;/div&amp;gt;&lt;br /&gt;
                            &amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now your users should be able to choose between those two fonts.&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84829</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84829"/>
		<updated>2018-01-18T12:00:11Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Adding custom fonts to my theme */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
=== The easy way: using Google Font CDN  ===&lt;br /&gt;
Bootswatch Survey Theme uses Google Font CDN. Let&#039;s have a look to how ti works:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/bootswatch/css/variations/flatly.min.css&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@import url(&amp;quot;https://fonts.googleapis.com/css?family=Lato:400,700,400italic&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the Lato font is used via CSS rules:&lt;br /&gt;
https://github.com/thomaspark/bootswatch/blob/master/dist/flatly/bootstrap.css#L72&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
body {&lt;br /&gt;
  ...&lt;br /&gt;
 font-family: &amp;quot;Lato&amp;quot;;&lt;br /&gt;
 ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can use any google font that way in your custom theme. Of course, you should remove the font selector from the options of your theme. Delete those lines in options.twig:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.twig#L209-L225&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A look into the Fruity Font Selector ===&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Of course, the XML file only contains the default values for your template configuration. But indeed, those values are defined and read inside the database (table &amp;quot;template_configuration&amp;quot;) as json strings. The option.js file just use the value of the font selector of the simple option to change the value inside the advanced tab form:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/options/options.js#L148-L174&lt;br /&gt;
&lt;br /&gt;
So when the &amp;quot;upload asset package&amp;quot; functionality will be available, it will be easy to add a script that scan all the existing font packages to add them in the selector.&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84828</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84828"/>
		<updated>2018-01-18T11:48:53Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Adding custom fonts to my theme */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &#039;font-noto&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;devBaseUrl&#039; =&amp;gt; &#039;assets/fonts/&#039;,&lt;br /&gt;
        &#039;basePath&#039; =&amp;gt; &#039;fonts&#039;,&lt;br /&gt;
        &#039;css&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;noto.css&#039;,&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The noto.css file it contains is here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notice the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
@font-face {&lt;br /&gt;
  font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
.font-noto{&lt;br /&gt;
    font-family: &#039;Noto Sans&#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, in Vanilla Theme, noto font is used by adding the noto package and defining the font option to noto:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L79&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;packages&amp;gt;&lt;br /&gt;
             ....&lt;br /&gt;
            &amp;lt;add&amp;gt;font-noto&amp;lt;/add&amp;gt;&lt;br /&gt;
        &amp;lt;/packages&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight &amp;gt;&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/config.xml#L58&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;options&amp;gt;&lt;br /&gt;
        ....&lt;br /&gt;
        &amp;lt;font&amp;gt;noto&amp;lt;/font&amp;gt;&lt;br /&gt;
    &amp;lt;/options&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, the body class font is defined using this value:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/themes/survey/vanilla/views/layout_global.twig#L76&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body class=&amp;quot; ...  font-{{  aSurveyInfo.options.font }} ... &amp;quot; ... &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84827</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84827"/>
		<updated>2018-01-18T11:40:57Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FAQ about theme customization =&lt;br /&gt;
&lt;br /&gt;
You&#039;ll find here some answers to questions that have been asked in the forum and that could help you to customize your theme.&lt;br /&gt;
&lt;br /&gt;
==Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) ==&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
== Adding custom fonts to my theme ==&lt;br /&gt;
&lt;br /&gt;
In the future, we&#039;ll give the possibility to final user to upload their own asset packages, including font packages. It will make very easy any customization of fonts. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To understand Yii Packages:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.yiiframework.com/doc/api/1.1/CClientScript#packages-detail&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
LimeSurvey packages are defined in different files. Fonts packages are defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php&lt;br /&gt;
&lt;br /&gt;
For example, the Noto font package is defined here:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/application/config/fonts.php#L47-L53&lt;br /&gt;
&lt;br /&gt;
The noto.css file it contains is here, not the definition of the css class &amp;quot;.font-noto&amp;quot; at the end of it:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/blob/4c40b61afb0dba8fd80154b50f5831045df8d814/assets/fonts/noto.css&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84826</id>
		<title>New Template System in LS3.x</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=New_Template_System_in_LS3.x&amp;diff=84826"/>
		<updated>2018-01-18T10:46:25Z</updated>

		<summary type="html">&lt;p&gt;LouisGac: /* Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied&amp;quot;) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
On this page you&#039;ll learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use the new template system of LimeSurvey 3.0.&lt;br /&gt;
* Use inheritance to manage your own templates.&lt;br /&gt;
* Add a picture to your template&lt;br /&gt;
* Manage template options for your surveys and survey groups&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LimeSurvey 3 introduces a complete new template engine system, based on Twig 1.29, Bootstrap, and allowing template inheritance and template options.  It completely removes the old replacement keywords system. So now, 100% of the frontend HTML can be customized. For example, in the old template system, there was a keyword {ASSESSMENTS} that was replaced by the assessment HTML at execution time. A template designer had no way to customize this HTML (other than using JavaScript). Now, there is a file called assessments.twig that contains the logic (written in Twig) to generate this HTML. In these pages, we will give you some explanation about how to use this new template engine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]]  We will not detail here how Twig works. It’s kind of very simplified PHP that offers a high level of security thanks to the “sandbox” system (we’ll see that in more detail in the part about the Template Engine Core code). If you already know PHP, it will be extremely easy for you to master. If you don’t know PHP, it still should be pretty easy to learn. Please, have a look to the Twig 1.X documentation:&lt;br /&gt;
https://twig.symfony.com/ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Editing Using the Admin Interface=&lt;br /&gt;
==Template list==&lt;br /&gt;
On the admin dashboard, there is now a box to access the template list:&lt;br /&gt;
[[File:Template list.jpg|thumb|800px|center|baseline|border|&#039;&#039;The template list after a fresh install of RC3&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The list is divided in 5 columns:&lt;br /&gt;
* a preview of the template: it’s just a picture file called “preview.png” at the root of the template&lt;br /&gt;
* the “name” of the template: the directory name of the template. Before we release the LS3 master, it will become the template “Title” (can be different from directory name, and it can contain special cgunnarhars)&lt;br /&gt;
* the description of the template: a string set in its manifest&lt;br /&gt;
* the type of template: Core template (provided with LimeSurvey), User template (added in upload directory), XML template (not loaded in database)&lt;br /&gt;
* Extends: if the template extends another template, its name will be indicated here&lt;br /&gt;
* Some action buttons:&lt;br /&gt;
** Install: it will load the manifest of a template to add it to database and make it available for selection at the survey level&lt;br /&gt;
** Uninstall: it will delete the configuration entries of a template in the database&lt;br /&gt;
** Template editor: it will redirect you to the template editor&lt;br /&gt;
** Template option: it will lead you the global configuration of template options&lt;br /&gt;
&lt;br /&gt;
==Template Editor==&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This documentation supposes you already know how to use the Template Editor in the previous version of LS. &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The Template Editor has been kept as close as possible to the original one. So, when you open a Core Template, you can’t edit it. But now, instead of a “copy” button, you have an “extend button”.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extends default.png|center|baseline|border|&#039;&#039;Now you &#039;&#039;&#039;extend&#039;&#039;&#039; template&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
====A quick overview of the concept of template inheritance====&lt;br /&gt;
&lt;br /&gt;
In LS3, a template can now inherit from another template, it can “extend” another template. This means that the template directory will be practically empty, it will only contain the files (views, style sheets, scripts, resources etc.) that differ from the original ones. Doing so, it will be easy for you to create a fleet of templates for your different users without having to maintain a lot of different templates. For example: you can have your own home-made template, and then a version for a company (with its logo, its style, maybe a link to its website on the footer etc.), another version for another company etc. If then you update the CSS or the global layout of your custom template, all the templates that inherit from it will be updated automatically. Note that the inheritance is recursive: a template can extend a template that extends another one etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] It also means that if you extend one of the core templates of LimeSurvey, you will still benefit from its updates.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Novelties in the user interface====&lt;br /&gt;
&lt;br /&gt;
To extend the Monochrome template of LimeSurvey, go to the Template list, click on the button “Template Editor” of the Monochrome template. Then, click on “extend” and validate the new name “extends_monochrome”.&lt;br /&gt;
&lt;br /&gt;
If you now go to the upload directory (with your file/ftp client), you’ll see that a new directory has been created: &#039;&#039;&#039;upload/templates/extends_monochrome&#039;&#039;&#039;&lt;br /&gt;
It contains an XML file and directories, but most directories are empty. It has neither views nor CSS nor JS. But, you can still select this template as a normal one from a survey and it will look exactly like the monochrome template.&lt;br /&gt;
&lt;br /&gt;
[[File:Extends monochrome empty.jpg|center|baseline|border|&#039;&#039;The template tree (directory and files) just after its creation. It&#039;s practically empty&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The ressources (jpg, png etc.) from the original template are copied when extending a template. This is because if you copy a CSS file from the original template locally, and if it refers to those files (like in background-image statement), it will need to find those pictures in the current template path. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template editor for the extends_monochrome template looks like that:&lt;br /&gt;
[[File:Editing extends monochrome.jpg|center|baseline|border|&#039;&#039; Editing extends_monochrome template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
There is no big difference with the old template editor. Let’s list the main ones:&lt;br /&gt;
 &amp;lt;br /&amp;gt;&lt;br /&gt;
* The keyword &#039;&#039;&#039;inherited&#039;&#039;&#039; on the file list. It means that the file is not present in the template directory and that the file from the original template will be used.&lt;br /&gt;
[[File:Inherited.jpg|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*  The main editor ( [https://ace.c9.io ACE editor ] ) shows the content of the selected file. The files not only contain HTML, CSS or JS, but also Twig statements. Those Twig statements give us the possibility to push some logic to template views that were located deep in the core before, and that now can be customized.&lt;br /&gt;
[[File:Twig code in editor.jpg|center|&#039;&#039;Some twig code, for Survey List&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* This is why you have more screen types available in the dropdown selector of the top menu now. You’ll notice pages such as ‘Survey List’, ‘Load’, ‘Save’, ‘Error’, ‘Registration’, ‘Assessments’, ‘Print Answers’ that weren’t available before, or that you couldn’t really be customized before.&lt;br /&gt;
[[File:Newscreens editables.jpg|195px|center|&#039;&#039;Now, you can customize all screens&#039;&#039;]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The ‘tip’ link at the bottom of the file list gives you the Twig way to add a picture in your HTML&lt;br /&gt;
[[File:Tip picture.png|605px|center]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* The button ‘save changes’ becomes a button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039;&lt;br /&gt;
[[File:Copytolocal.png|360px|center]]&lt;br /&gt;
&lt;br /&gt;
====Quick example: adding a picture ====&lt;br /&gt;
&lt;br /&gt;
The button &#039;&#039;&#039;Copy to local template and save changes&#039;&#039;&#039; 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 template you’re editing, and save your changes.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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 &#039;&#039;&#039;save changes&#039;&#039;&#039;. &lt;br /&gt;
[[File:After edition.png|center|&#039;&#039;just after clicking on the button &#039;&#039;&#039; Copy to local template and save changes &#039;&#039;&#039;&#039;|]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
[[File:Tree with layout global arrow.png|center|&#039;&#039;Now the file is present in your template&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now instead of addind a random text, we will add a picture.  If you click on the tip link, it will tell you:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To use a picture in a .twig file:&lt;br /&gt;
&#039;&#039;&#039;{{ image(&#039;./files/myfile.png&#039;, &#039;alt-text for my file&#039;, {&amp;quot;class&amp;quot;: &amp;quot;myclass&amp;quot;}) }}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you have read the Twig documentation (and you should have done so at this point), you know that &#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; function( ) }}&amp;lt;nowiki /&amp;gt;&#039;&#039;&#039; will echo the result of a function on screen. Here, the function is image( ). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[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]&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
You should use the function image() for two reasons:&lt;br /&gt;
* 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.&lt;br /&gt;
* 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/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;&lt;br /&gt;
So, to add a picture to your template:&lt;br /&gt;
* just upload it as usual with the file uploader on the right and then add it to where you want it in any twig file:&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;) }}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If you want to add an alternate text for your picture (for screen readers and HTML validation), add:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), &#039;&#039;&#039; ‘my alternative text’ &#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
* If you want to add a class attribute and add an id to it:&lt;br /&gt;
&amp;amp;#123;&amp;amp;#123; image(&#039;./files/myfile.png&#039;), ‘my alternative text’, &#039;&#039;&#039; &amp;amp;#123;“class”: “a_nice_css_class”, “id”: “any_id”} &#039;&#039;&#039; }}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Some things on our TO-DO list====&lt;br /&gt;
* Give users the possibility to upload a custom preview file from the editor itself&lt;br /&gt;
* Add a button to delete the local file and return to the inherited statement&lt;br /&gt;
* Only copy the picture used in the CSS files (by listing them in the manifest as file to copy)&lt;br /&gt;
* Remind which template the current one extends (if any)&lt;br /&gt;
&lt;br /&gt;
==Template options==&lt;br /&gt;
Another novelty of LS3 is the template option page. As we’ll see later, template creators can create their own options and even their own admin option page. Here, we’ll quickly see how the option page of the Core Templates work. To access the template options at global level: click on “template options” in the template list&lt;br /&gt;
====Advanced options====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{QS:Theme editor - advanced options}}&lt;br /&gt;
&lt;br /&gt;
====Simple options====&lt;br /&gt;
&lt;br /&gt;
The Simple option page comes from the Template itself. It’s made via a twig file and some javascript inside the template/options/ directory:&lt;br /&gt;
https://github.com/LimeSurvey/LimeSurvey/tree/develop/templates/default/options&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] This page can be completely different from a template to another, and template providers are strongly encouraged to create their own look &amp;amp; feel. &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Options.png|thumb|750px|center]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The simple option page simply fills in the advanced form inputs. You can see it by turning on or off a setting in the simple page, and see how the related input in the advanced form is modified accordingly. For example, in Default Template’s simple options,, if you change the Bootswatch theme to “Darkly” and then click on the tab for advanced options (even without saving)  you’ll see that the field “Cssframework Css” changed from&lt;br /&gt;
&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/flatly.css&amp;quot;]]}&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;#123;&amp;quot;replace&amp;quot;: &amp;amp;#91;&amp;amp;#91;&amp;quot;css/bootstrap.css&amp;quot;,&amp;quot;css/darkly.css&amp;quot;]]}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the different simple options for the Core templates:&lt;br /&gt;
*&#039;&#039;&#039;Ajax mode:&#039;&#039;&#039; Should the next page be loaded via ajax (faster) or via page reload (better for debugging purpose)&lt;br /&gt;
*&#039;&#039;&#039;Background image:&#039;&#039;&#039; if set to Yes, the image called pattern.png will be loaded (will be replaced by a file selector in Master)&lt;br /&gt;
*&#039;&#039;&#039;Box container:&#039;&#039;&#039; if set to No, the questions will not be contained in a box (so you can use large arrays bigger than the screen width)&lt;br /&gt;
*&#039;&#039;&#039;Brandlogo:&#039;&#039;&#039; if set to no, the name of the survey will be shown in top bar, else, you can select one of the pictures inside the file directory to be used as logo picture.&lt;br /&gt;
*&#039;&#039;&#039;Animate body:&#039;&#039;&#039; if set to yes, you can choose one of the animations to apply when the body of the survey is loaded&lt;br /&gt;
*&#039;&#039;&#039;Animate question:&#039;&#039;&#039; same with questions&lt;br /&gt;
*&#039;&#039;&#039;Animate alerts:&#039;&#039;&#039; same with alerts&lt;br /&gt;
*&#039;&#039;&#039;Bootstrap theme:&#039;&#039;&#039; here, you can choose a Bootstrap theme to load. They come from Bootswatch https://bootswatch.com/3/&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The library used for animations is animate.css: https://daneden.github.io/animate.css/&lt;br /&gt;
Of course, a template provider could add his own animation library or no animation library at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] The monochrome templates use the same bootstrap color theme as the admin user interface. They’re not using the css framework replacement system, but simply add a CSS file. So, it illustrates another way to deal with custom themes for template providers.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Inheritance system====&lt;br /&gt;
&lt;br /&gt;
In the previous part, we’ve seen that a template can extend another template. A template configuration can also inherit from another template configuration. It means that for a given template, you can have a configuration at &lt;br /&gt;
&lt;br /&gt;
* global level (the one we’ve just seen accessible from the template list)&lt;br /&gt;
* at survey group level&lt;br /&gt;
* a last one at survey level. &lt;br /&gt;
&lt;br /&gt;
Each parameter at a certain level can inherit from the upper level: survey group inheritance. First, let’s see the survey group level.&lt;br /&gt;
&lt;br /&gt;
======At survey group level======&lt;br /&gt;
&lt;br /&gt;
Indeed, one of the other great novelties of LS3 is the survey group system. You can now create different groups to organize your surveys. To access it, go to the survey list and then click on the survey group tab:&lt;br /&gt;
[[File:Surveygroup.png|thumb|800px|center|&#039;&#039;The survey groups tab&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
In this list, you have two action buttons. If the group is empty, you can delete it. Else, you can always edit it. By clicking on the edit button, you reach the Survey Group configuration page:&lt;br /&gt;
[[File:Surveygroupedit.png|thumb|800px|center|&#039;&#039;Editing Default Survey Group&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The third tab of this page is called “Template options for this survey group”. If you click on it, you’ll see the same list of templates than in the template list, except that here only the option button is visible (template editor can be reached only from the main list).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now, if you click on the option for Default Template, you’ll see this:&lt;br /&gt;
[[File:Option group inherit.png|thumb|800px|center|&#039;&#039;At Survey Group, Template Options are inherited by default&#039;&#039;]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Inherit everything&#039;&#039;&#039; means that all the configuration will be inherited from the Global configuration level. &lt;br /&gt;
* If you go to the &#039;&#039;&#039;advanced options page&#039;&#039;&#039;, you’ll see that all the fields are set to inherit.&lt;br /&gt;
* If you click on &amp;quot;no&amp;quot; for &amp;quot;Inherit everything&amp;quot;  in the simple options, you’ll again see a very similar page to the global option page. The only difference is that for each field, you can set it to yes, no, or inherit; and each dropdown selector has an &#039;&#039;inherit&#039;&#039;&#039; value.  &lt;br /&gt;
[[File:Inherit group.png|thumb|800px|center|&#039;&#039;Each setting can have a inherited value&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] A survey group can be a child of another group. In this case, it will inherit from its parent.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======At survey level======&lt;br /&gt;
When editing a survey, in the left bar menu, you’ll see a new entry “Template Options”. It will lead you to the option page of the Template selected for the current survey. You’ll find the same inheritance system as in the survey group, but this time, inherit means that the setting will be inherited from the Survey Group of the survey.  &lt;br /&gt;
[[File:Options survey.png|thumb|800px|center|&#039;&#039;Template Options at Survey Level&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Use case example==&lt;br /&gt;
Let’s say you’re using a single template for different companies (A and B). You set your favorites options at global level (e.g.: ajax on, animate body with a slide in, alerts with a pulse). Then you create a survey group for each company: a survey group for company A that will host all the surveys for this company, and a survey for company B that will host all the surveys for company B. At this level, you’ll set the logo and the background only, and you will let the other options to inherit. So, all the surveys in group A will use the logo from the company A, and all the survey from group B the logo from company B. For one of the surveys of company A, you could use a different background in relation with the topic of the survey: you just change the background in options at survey level. If someone in company B tells you that the pulsing alert is too aggressive and he would prefer something smoother like a fade in, you just change the alert animation at the Survey Group B level and all the surveys of this group will now use this animation. If the company A changes its logo, you can change it at the level of Survey Group A, and all the surveys of this group will use the new logo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;Those examples are based on the current options of the core template. But of course, if you are a template provider, or if you’re able to script a bit with twig, you can add your own options. For example, you could add an option “info footer” where you could add data like the company website or a phone number for help. Then, if company A has different departments, with different phone numbers, you can just create one sub-group for each department in Survey Group A. Each subgroup will have its own phone number in these options.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Customizing CSS: deal with the asset manager (&amp;quot;why my changes are not applied?&amp;quot;) =&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re trying to update the CSS of a theme by directly editing the code with your favorite editor, you could be surprised that your changes are not applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since 2.50, LS use the Yii asset manager:&lt;br /&gt;
[http://www.yiiframework.com/wiki/148/understanding-assets/  Yii Documentation about Assets]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It moves the CSS files of a theme to a tmp/ sub-directory with a random string (eg: &amp;quot;tmp/1ef64ml/&amp;quot;). So if you make any change to a css file, and tell it to the asset manager, the files are copied to a new sub-directory with a new name so the user browser&#039;s cache is updated and they see the new css. Else, they would have to clean their browser cache. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Assets on vanilla.jpg]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they all refer to the tmp/ subfolders. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the CSS links in header when asset manager is on:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Asset off.png]]&lt;br /&gt;
&amp;lt;br /&amp;gt;As you can see they point to the real files of the theme. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] Of course, if the Asset Manager doesn&#039;t know you changed the file, the old file from the old tmp/directory remain unchanged, and your changes will never be applied..&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when you&#039;re editing CSS of a theme you have various possibilities:&lt;br /&gt;
*&#039;&#039;&#039;You can use the the LS Theme Editor:&#039;&#039;&#039; it deals with the asset manager and you don&#039;t have to worry about anything&lt;br /&gt;
*&#039;&#039;&#039;You can turn debug mode on:&#039;&#039;&#039; it will turn asset manager off, so the real css/js files of your themes are called (but then, you have to refresh your browser cache at each load)&lt;br /&gt;
* &#039;&#039;&#039;You can change the asset version number&#039;&#039;&#039;: it will efresh all the tmp directories ( increase or decrease) [https://github.com/LimeSurvey/LimeSurvey/blob/70a1d99cd2ebe411597231a8bc746b4ca9e19584/application/config/version.php#L19 asset version number in 3.0.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;simplebox&amp;quot;&amp;gt;[[File:help.png]] &#039;&#039;&#039;Using the theme editor to edit the custom CSS is by far the best solution.&#039;&#039;&#039; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the theme editor will help you to understand the architecture of the new theme engine.&lt;br /&gt;
Also, if your customizing fruity, be careful with CSS specifity: most of the definitions use the selector &amp;quot;.fruity&amp;quot; (one of the class of the body element)&lt;br /&gt;
&lt;br /&gt;
=Creating a template from scratch=&lt;br /&gt;
Documentation coming soon...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>LouisGac</name></author>
	</entry>
</feed>