- Posts: 33
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Problem Fetching Attribute to Dynamically Apply to Template
7 years 10 months ago #123114
by kripp88
Hey all, I am on Version 2.00+ Build 130802.
I am trying to apply an attribute value to a template to dynamically display an image based on the value for that particular person. I have the attribute setup as "customer_name" and for a specific person i have given them the value of "test". I have uploaded test.png through the template editor. When I try any of the following in my template it is coming back as an undefined variable. Am I missing something?
I was trying to copy, this www.limesurvey.org/en/community-services...vey-general-settings
I am trying to apply an attribute value to a template to dynamically display an image based on the value for that particular person. I have the attribute setup as "customer_name" and for a specific person i have given them the value of "test". I have uploaded test.png through the template editor. When I try any of the following in my template it is coming back as an undefined variable. Am I missing something?
- <img src="{TEMPLATEURL}{TOKEN:customer_name}.png" />
- <img src="{TEMPLATEURL}{customer_name}.png" />
- <p>{TOKEN:customer_name} </p>
I was trying to copy, this www.limesurvey.org/en/community-services...vey-general-settings
The topic has been locked.
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 13146
- Thank you received: 2423
7 years 10 months ago #123126
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 Problem Fetching Attribute to Dynamically Apply to Template
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.
7 years 10 months ago #123145
by kripp88
Replied by kripp88 on topic Problem Fetching Attribute to Dynamically Apply to Template
Hey Denis thanks for the reply, that was helpful. I understand the correct syntax now, but for some reason it is outputting all of my values at empty. The below still result in "" even though they are all populated on the token.
<img src="{TEMPLATEURL}{TOKEN:ATTRIBUTE_16}.png" />
<p>{TOKEN:ATTRIBUTE_16}</p>
<img src="{TEMPLATEURL}{TOKEN:ATTRIBUTE_16}.png" />
<p>{TOKEN:ATTRIBUTE_16}</p>
Attachments:
The topic has been locked.
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 13146
- Thank you received: 2423
7 years 10 months ago #123153
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 Problem Fetching Attribute to Dynamically Apply to Template
TOKEN: can be used only if
- There are a existing token (preview don't work)
- Survey is NOT anonymous
Denis
- There are a existing token (preview don't work)
- Survey is NOT anonymous
Denis
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.
7 years 10 months ago #123156
by kripp88
Replied by kripp88 on topic Problem Fetching Attribute to Dynamically Apply to Template
Hmm, I do have tokens and the survey isn't anonymous and I'm actually clicking a link to take the survey. Do you have any other ideas why this wouldn't be working? It seems to be recognizing the attribute, but just not pulling the value. I can provide screenshots if necessary.
Thank you,
Kyle
Thank you,
Kyle
The topic has been locked.
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 13146
- Thank you received: 2423
7 years 10 months ago #123217
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 Problem Fetching Attribute to Dynamically Apply to Template
Maybe a bug in 2.00+ Build 130802. ?
Don't know.
Don't know.
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.
7 years 10 months ago #123253
by kripp88
Replied by kripp88 on topic Problem Fetching Attribute to Dynamically Apply to Template
Any help would greatly be appreciate, I seem to be stuck. When clicking the link to take the survey the source is shown as
"<img src="/limesurvey/upload/templates/.png" />" Meaning that {TOKEN:ATTRIBUTE_16} is coming in as empty.
Thanks,
Kyle
"<img src="/limesurvey/upload/templates/.png" />" Meaning that {TOKEN:ATTRIBUTE_16} is coming in as empty.
Thanks,
Kyle
The topic has been locked.
7 years 10 months ago #123255
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Problem Fetching Attribute to Dynamically Apply to Template
As Dennis says, it is hard for us to help with a problem that we can't reproduce. The version you are using is quite old already and in those 2 years Limesurvey has changed quite a bit. It is possible that this is a bug or problem in this specific version.
You could try and upload an example to the demo version here on limesurvey.org and see if your code works here, to rule out a problem with your installation / version.
You could try and upload an example to the demo version here on limesurvey.org and see if your code works here, to rule out a problem with your installation / version.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
7 years 9 months ago #123605
by kripp88
Replied by kripp88 on topic Problem Fetching Attribute to Dynamically Apply to Template
Thanks for the idea Holch. I just tried with the demo version and it still doesn't appear to be working. Can you take a look at Survey:578422 which I used to test out adding an attribute and then making it appear in the 'copy_of_default' template under welcome.pstpl via {TOKEN:attribute_1}.
demo.limesurvey.org//index.php?r=survey/...QfbAJAohEpeQ/lang/en
Thanks,
Kyle
demo.limesurvey.org//index.php?r=survey/...QfbAJAohEpeQ/lang/en
Thanks,
Kyle
The topic has been locked.
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 13146
- Thank you received: 2423
7 years 9 months ago #123606
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 Problem Fetching Attribute to Dynamically Apply to Template
attribute != ATTRIBUTEDenisChenu wrote: Hi,
manual.limesurvey.org/Expression_Manager#Access_to_Variables
{TOKEN:ATTRIBUTE_2}
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.
7 years 9 months ago #123608
by kripp88
Replied by kripp88 on topic Problem Fetching Attribute to Dynamically Apply to Template
Oh ok thank you I was able to fix it and it is now working in the demo version. It is still not working on my version so there must have been a bug in, Version 2.00+ Build 130802.
Thanks,
Kyle
Thanks,
Kyle
The topic has been locked.