- Posts: 19
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Concatenate twig functions
- AritzP
- Topic Author
- Offline
- New Member
Less
More
3 years 2 months ago #211825
by AritzP
Concatenate twig functions was created by AritzP
Hi everyone!
We are trying to put a different logo on the nav-bar depending of the user's logo attribute. So we have created an attribute which reads the name of the logo.
On the theme's editor, we can take that value with 'processString("{TOKEN:ATTRIBUTE_1}")'.
The problem is that I am trying to insert that code on {{ image('./files/processString("{TOKEN:ATTRIBUTE_1}").png', 'Logo', {"class": "logo img-responsive"}) }} but it doesn´t work. I have tried this way too: {{ image('./files/', processString("{TOKEN:ATTRIBUTE_1}"), '.png', 'Logo', {"class": "logo img-responsive"}) }}
Is there any way to use the attribute value on {{ image }} function?
I am using 3.17 version of Limesurvey
Thanks for your time!
We are trying to put a different logo on the nav-bar depending of the user's logo attribute. So we have created an attribute which reads the name of the logo.
On the theme's editor, we can take that value with 'processString("{TOKEN:ATTRIBUTE_1}")'.
The problem is that I am trying to insert that code on {{ image('./files/processString("{TOKEN:ATTRIBUTE_1}").png', 'Logo', {"class": "logo img-responsive"}) }} but it doesn´t work. I have tried this way too: {{ image('./files/', processString("{TOKEN:ATTRIBUTE_1}"), '.png', 'Logo', {"class": "logo img-responsive"}) }}
Is there any way to use the attribute value on {{ image }} function?
I am using 3.17 version of Limesurvey
Thanks for your time!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
3 years 2 months ago #211827
by DenisChenu
maybe
See
twig.symfony.com/doc/2.x/templates.html#twig-expressions
twig.symfony.com/doc/2.x/tags/set.html
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 Concatenate twig functions
Code:
{% set imageFile = './files/' ~ processString("{TOKEN:ATTRIBUTE_1}")~ '.png' %} {{ image(imageFile, 'Logo', {"class": "logo img-responsive"}) }}
See
twig.symfony.com/doc/2.x/templates.html#twig-expressions
twig.symfony.com/doc/2.x/tags/set.html
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: AritzP
The topic has been locked.
- AritzP
- Topic Author
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 0
3 years 2 months ago #211843
by AritzP
Replied by AritzP on topic Concatenate twig functions
It works like a charm, thanks Denis!!
The topic has been locked.