Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Select template from token field?

  • ChacoKevy
  • ChacoKevy's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 11 months ago #136099 by ChacoKevy
Select template from token field? was created by ChacoKevy
I found the section of the manual that discusses changing the logo in a template, but I was wondering if more is possible. Is there a way to just select a different template altogether based on a value passed from a token field? I wasn't able to find any such thing in the manual or a previous discussion in the forums - hope I'm not wrong about that!
Thanks,
CK
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago #136116 by DenisChenu
Replied by DenisChenu on topic Select template from token field?
Not actually

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.
More
7 years 11 months ago #136118 by Maverick87Shaka
Replied by Maverick87Shaka on topic Select template from token field?
It is a feature that would be very interested also to me, there is any chance to see this feature sometimes in a next release?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago #136120 by DenisChenu
Replied by DenisChenu on topic Select template from token field?
I think it's an uneeded feature : you already have a lot of solution to show different page depend on an attribute
Use body class="{TOKEN:ATTRIBUTE_1}" for example.

But you can make a feature request if you really need it

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.
More
7 years 11 months ago #136123 by Maverick87Shaka
Replied by Maverick87Shaka on topic Select template from token field?

DenisChenu wrote: I think it's an uneeded feature : you already have a lot of solution to show different page depend on an attribute
Use body class="{TOKEN:ATTRIBUTE_1}" for example.

But you can make a feature request if you really need it

Nice, so we can use something like:
Code:
<body id="body" class="{TOKEN:ATTRIBUTE_1}">
Nice, with this we can do a "dynamic" template, it's not "specific" feature for the logo, but we can use for it!
Thanks for suggestion!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago #136128 by DenisChenu
Replied by DenisChenu on topic Select template from token field?
For information : for CATI+CAWI survey (phone or web survey)

I use
{if(TOKEN:ATTRIBUTE_1=="phone","<dl>","")}
{if(TOKEN:ATTRIBUTE_1=="phone","<dt>Name of person</dt>","")}
{if(TOKEN:ATTRIBUTE_1=="phone","<dt>Name of person</dt>","")}

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.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago #136130 by DenisChenu
Replied by DenisChenu on topic Select template from token field?
Can not edit post ... and submiut by error
For information : for CATI+CAWI survey (phone or web survey)

I use
Code:
{if(TOKEN:ATTRIBUTE_1=="phone","<dl>","")}
{if(TOKEN:ATTRIBUTE_1=="phone","<dt>Name of person</dt>","")}
{if(TOKEN:ATTRIBUTE_1=="phone","<dd>TOKEN:LASTNAME</dd>","")}
{if(TOKEN:ATTRIBUTE_1=="phone","</dl>","")}

But you can use too
Code:
<div {if(TOKEN:ATTRIBUTE_1!="phone","style='display:none'","")}>
<p>Any content you can hide/show</p>
</div>

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.
  • ChacoKevy
  • ChacoKevy's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 11 months ago #136179 by ChacoKevy
Replied by ChacoKevy on topic Select template from token field?
Sorry, my web development skills are non-existent. Apologies if I'm misunderstanding terribly. Is your suggestion that every element on a template that we would want to change, we would simply change in the attribute fields?
Here's a sample context. I have a survey that would be used by 7 different customer groups. They all want the survey to feel as if they are on their own company's HR intranet page. I had presumed that the number of changes from group to group would require individual templates as opposed to a few attribute field replacements.
What happens when one customer's template is supposed to have flames running down the sides of the screen?
Again, sorry for any misunderstanding on my part. I just was hoping to be clear in my head before I were to make a feature request, if that's what I'm after.
The topic has been locked.
More
7 years 11 months ago #136183 by jelo
Replied by jelo on topic Select template from token field?

DenisChenu wrote: Not actually

Wasn't there a way to dynamically change template during interview? Wasn't there something with templates from Mazi, where there is a normal and mobile optimized template. And at the beginning of the interview the template is chosen. I have no working example. So I might be wrong.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago #136188 by holch
Replied by holch on topic Select template from token field?
without any web development skills it will be difficult to achieve what you want to do.

However, with different customers I actually would setup different surveys with different templates (just to keep things clean).

What Denis is suggesting is adding a class to the body tag, based on a attribute in the token table. With this class you can define in the CSS file how this survey should look like. You can change colors, background images, fonts, etc.

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.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago #136194 by DenisChenu
Replied by DenisChenu on topic Select template from token field?
Hi,

@jelo : oh right, remind of something like this, but never used . I really prefer separation because if we need different template , we surely need different survey :).

And yes : with such solution : make a complete different template for each customer seems really difficult. Just some HTML part and CSS part.

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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago #136212 by holch
Replied by holch on topic Select template from token field?
In most cases adapting colors to the company colors and adding a logo might do the trick already. And this should be possible with your solution, Denis. Of course, a complete rebuild of the layout of the company's intranet will be difficult. But usually no client is willing to pay for that anyway, just my opinion.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose