Welcome, Guest
Username: Password: Remember me

TOPIC: Templates; Conditional questions; Template Addons

Templates; Conditional questions; Template Addons 3 years 6 months ago #50773

  • abita1
  • abita1's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 43
  • Thank you received: 1
  • Karma: 0
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?
The administrator has disabled public write access.

Re:Templates; Conditional questions; Template Addons 3 years 6 months ago #50774

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 328
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re:Templates; Conditional questions; Template Addons 3 years 6 months ago #50784

  • abita1
  • abita1's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 43
  • Thank you received: 1
  • Karma: 0
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
The administrator has disabled public write access.

Re:Templates; Conditional questions; Template Addons 3 years 6 months ago #50790

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 340
  • Thank you received: 68
  • Karma: 38
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
The administrator has disabled public write access.

Re:Templates; Conditional questions; Template Addons 3 years 6 months ago #50796

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
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)limesurvey.org'"
The administrator has disabled public write access.

Re:Templates; Conditional questions; Template Addons 3 years 6 months ago #50805

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5850
  • Thank you received: 716
  • Karma: 222
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.

:)
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.232 seconds
Donation Image