- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
{TEMPLATEURL} placeholder not working in the head.twig
2 years 10 months ago #198666
by StephenO
{TEMPLATEURL} placeholder not working in the head.twig was created by StephenO
I am trying to use the {TEMPLATEURL} placeholder in the head.twig to ass inputmasking.js from the files folder.
But when I look at the final rendered survey source code the {TEMPLATEURL} placeholder is still in there, the engine didn't replace it with the actual url.
I can't find any documentation at all on 4.x.
I am using Version 4.1.18+200416
But when I look at the final rendered survey source code the {TEMPLATEURL} placeholder is still in there, the engine didn't replace it with the actual url.
I can't find any documentation at all on 4.x.
I am using Version 4.1.18+200416
The topic has been locked.
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 12895
- Thank you received: 2371
2 years 10 months ago #198685
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic {TEMPLATEURL} placeholder not working in the head.twig
Since twig is here : you can noit use Expression Manager in twig file directly
Did you use processString ?
Else : seems you have registerTemplateScript function to register a JS file
Did you use processString ?
Else : seems you have registerTemplateScript function to register a JS file
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
1 year 11 months ago #214763
by dsidd
Replied by dsidd on topic {TEMPLATEURL} placeholder not working in the head.twig
Hi Denis,
I work on limesurvey 3.25.
I try to add js file (jquery.csv.js) with the registerTemplateScript function.
It seems that I need to turn on the 'use_custom_twig_extensions' in config file('use_custom_twig_extensions'=>true). When i try this option nothing appened. Where exactly do i have to add this line in config.file? Is the config file inside the 'limesurvey/application/config' folder?
Thank you for your help!
Arnaud
I work on limesurvey 3.25.
I try to add js file (jquery.csv.js) with the registerTemplateScript function.
It seems that I need to turn on the 'use_custom_twig_extensions' in config file('use_custom_twig_extensions'=>true). When i try this option nothing appened. Where exactly do i have to add this line in config.file? Is the config file inside the 'limesurvey/application/config' folder?
Thank you for your help!
Arnaud
The topic has been locked.
1 year 11 months ago #214776
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic {TEMPLATEURL} placeholder not working in the head.twig
In the "config" array of /application/config/config.php:
Code:
'config'=>array( 'debug'=>0, 'debugsql'=>0, // Update default LimeSurvey config here 'use_custom_twig_extensions'=>true, // Enable the use of custom TWIG functions in question themes ),
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 12895
- Thank you received: 2371
1 year 11 months ago #214785
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic {TEMPLATEURL} placeholder not working in the head.twig
I thinki it's more easy to add it in you theme. No need use_custom_twig_extensions
1. Export template (and delete it)
2. unzip template
3. Add jquery.csv.js in scripts directory
4. Add <add>scripts/jquery.csv.js</add> in config.xml of your template at script part (sample for vanilla extended).
5. Zip your directory
6. Inport
With export/import and FTP access :
1. Add jquery.csv.js in scripts directory
2. Add <add>scripts/jquery.csv.js</add> in config.xml of your template at script part (sample for vanilla extended).
3. Reset options of theme
1. Export template (and delete it)
2. unzip template
3. Add jquery.csv.js in scripts directory
4. Add <add>scripts/jquery.csv.js</add> in config.xml of your template at script part (sample for vanilla extended).
5. Zip your directory
6. Inport
With export/import and FTP access :
1. Add jquery.csv.js in scripts directory
2. Add <add>scripts/jquery.csv.js</add> in config.xml of your template at script part (sample for vanilla extended).
3. Reset options of theme
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
1 year 11 months ago #214787
by dsidd
Replied by dsidd on topic {TEMPLATEURL} placeholder not working in the head.twig
Thank you for your help Denis! This works for me.
The following user(s) said Thank You: DenisChenu
The topic has been locked.