Check out the LimeSurvey source code on GitHub!

Templates; Conditional questions; Template Addons

More
6 years 3 months ago #50773 by abita1
I added two templates successfully, OSSCSS and CSS, chosen because they were described as providing the CSS support, a baseline for further amendment to the design for my purposes.

I ran a small test survey with each one -- a survey that included a conditional question.

While the default and other existing templates all respected the condition [in my case, a Yes to a prior question], when I used these two templates, they displayed the question without regard to the condition.

Is there something I am missing in the install? Where are conditions enforced, and why do these templates act this way? Do I need to add some programming to register the enforcement?

I have 1.90-build 9229, if that helps.

Suggestions?

Please Log in to join the conversation.

More
6 years 3 months ago #50774 by tpartner
Newer versions of LimeSurvey insert the question IDs and classes differently and those older templates have not been updated.

In question.pstpl, replace the following line:
<div class="survey-question">

With:
<div {QUESTION_ESSENTIALS} class="{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}">

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
6 years 3 months ago #50784 by abita1
Thanks...

I will try that out.

I made note of the following, around the time I posted
    {QUESTION_TEXT} is used in the addons, where the default templates use {QUESTION}

Making this change did not not work, leading to my post.

However, it, and the context of your suggestion, make me more curious about the insertions and how they work, generally, and with respect to the system you described.

Where can I find the list of insertion definitions in the documentation? I recall seeing something somewhere, once a few days ago, but can't re-find it.

2nd: is there a place where I might read about the methodology of the inserts that is now the current method? And, even, how it will work in the Ver.2?

I would not have expected that code added to an HTML <div xxx> or a class added to a <div>, would have changed the presentation of a conditional question. I would have assumed that such organization would have been within the PHP constructing the HTML page being served....

Or, am I answering my own question: the insertions insert relevant PHP code? If so, where are THOSE code elements listed so I can learn how to adjust the CSS?

3rd -- the modification of some of those addons [along the lines you've suggested] might be a good item to list on the developers' assignment lists...Because of other changes, like the one I noticed, I am betting that there are several changes arising from version changes...

Thanks, again...

John

Please Log in to join the conversation.

More
6 years 3 months ago #50790 by mdekker
A quick answer on conditions: in question-by-question they are enforced in PHP, so you do not need css / javascript. When in all-in-one or in group-by-group mode the questions can be hidden or showed depending on a change in the current page. When that is the case it can only be done with css/javascript so it depends on the right selectors.

The add-on templates are not supported by the development team, so if they need adaptation it needs to be done by someone in the community. So feel free so send back the adapted templates when you are finished :)

---
Menno Dekker

Please Log in to join the conversation.

More
6 years 3 months ago #50796 by Mazi
abita1 wrote:

Where can I find the list of insertion definitions in the documentation? I recall seeing something somewhere, once a few days ago, but can't re-find it.

Here is a list of all placeholdrs that can be used within templates:
docs.limesurvey.org/tiki-index.php?page=...+LimeSurvey#KEYWORDS

2nd: is there a place where I might read about the methodology of the inserts that is now the current method? And, even, how it will work in the Ver.2?

When loading a template there is a simple search and replace done, based on the linked list of placeholders above.

At Limesurvey 2 a template engine (smarty or dwoo, I don't remeber) will be used so things will be different.
Limesurvey 2 is completely re-written from scratch so there will be lots of changes. A first stable version should be released on Christmas.

I would not have expected that code added to an HTML <div xxx> or a class added to a <div>, would have changed the presentation of a conditional question. I would have assumed that such organization would have been within the PHP constructing the HTML page being served....

Or, am I answering my own question: the insertions insert relevant PHP code? If so, where are THOSE code elements listed so I can learn how to adjust the CSS?

See Menno's answer above, it's a mixture of PHP and Javascript code.

3rd -- the modification of some of those addons [along the lines you've suggested] might be a good item to list on the developers' assignment lists...Because of other changes, like the one I noticed, I am betting that there are several changes arising from version changes...

Each release comes with a feature change log so changes are tracked that way.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
6 years 3 months ago #50805 by DenisChenu
Hello,

Just a remark, you have in remository citronade template who use too only css in html and it work with 1.90 LS version.

:)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form