- Posts: 409
- Thank you received: 34
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Variables that can be used in twig files
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
2 years 9 months ago #217315
by blocka
Variables that can be used in twig files was created by blocka
Is there a reference for variables we can use in twig files?
In my case, I want to replace {{ aSurveyInfo.name }} in the nav_bar.twig with the site name. But I cannot find a reference to how to do this... Hoping for some guidance!
In my case, I want to replace {{ aSurveyInfo.name }} in the nav_bar.twig with the site name. But I cannot find a reference to how to do this... Hoping for some guidance!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
2 years 9 months ago #217325
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 Variables that can be used in twig files
As far as I know, there is no reference for the variables in the manual and I see no variable for the site name. I think you will need to hard code it.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
2 years 9 months ago #217519
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 Variables that can be used in twig files
You can use {{ getConfig("sitename") }}
github.com/LimeSurvey/LimeSurvey/blob/d0...g_Extension.php#L645
github.com/LimeSurvey/LimeSurvey/blob/d0...g_Extension.php#L645
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 following user(s) said Thank You: tpartner
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
2 years 9 months ago - 2 years 9 months ago #217521
by tpartner
I assume that all values from the lime_settings_global table are available via that function. Correct?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Variables that can be used in twig files
Nice!You can use {{ getConfig("sitename") }}
github.com/LimeSurvey/LimeSurvey/blob/d0...g_Extension.php#L645
I assume that all values from the lime_settings_global table are available via that function. Correct?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 2 years 9 months ago by tpartner.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
2 years 9 months ago #217523
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 Variables that can be used in twig files
Yes, and more.I assume that all values from the lime_settings_global table are available via that function. Correct?
- config.php config array (debug etc …)
- config.php own var in config array (Logo url for example, i use this for one SurveyTheme with different server)
- Plugin config : gitlab.com/SondagesPro/TokenManagement/T...stAndManage.php#L114
- etc ....
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 following user(s) said Thank You: tpartner
The topic has been locked.