Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: css in a boilerplate question gets removed completely on next time invocation

css in a boilerplate question gets removed completely on next time invocation 5 years 10 months ago #56298

  • zenil79
  • zenil79's Avatar
  • Offline
  • Junior Lime
  • Posts: 30
  • Thank you received: 2
  • Karma: 0
Hi,

I put some css in a boiler plate question.
eg:
<style type="text/css">
.labelSty {font-weight:bold;..}
</style>
Next time when I invoke the fck editor to edit it, i see the css entry as
<style type="text/css">
.labelSty // All the style information missing
</style>

This looks like a bug. Any work-arounds ?
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 10 months ago #56318

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
You need to turn off the XSS filter in Global Settings -> Security.

I'm not sure why you would want to do this though. Placing a style there will result in invalid HTML.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 10 months ago #56345

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 9580
  • Thank you received: 1374
  • Karma: 390
tpartner wrote:
You need to turn off the XSS filter in Global Settings -> Security.

I'm not sure why you would want to do this though. Placing a style there will result in invalid HTML.
And i'm near sure it don't work.

style elsewhere of head don't working.

you can use :
<span style=""></span>
WHere you want, in sub question or answer too.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (use private message).
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 10 months ago #56353

  • holch
  • holch's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 5428
  • Thank you received: 809
  • Karma: 240
And the most obvious solution: why not put the style where it belongs - in the template.css?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | [url=https://manual.limesurvey.org/Workarounds[/url]

If you found this answer helpful and it saved you some time please consider a [url=https://donate.limesurvey.org[/url] to the...
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 10 months ago #56372

  • zenil79
  • zenil79's Avatar
  • Offline
  • Junior Lime
  • Posts: 30
  • Thank you received: 2
  • Karma: 0
I had like to use One template.css for every survey and it will contain styles that define the general layout of the survey.

But any per survey styling, I had like to do it within the survey. Or put it in a survey_sid.css and include that css in the survey <head> tag. But can't see a way to do that.
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 10 months ago #56397

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
You can create survey-specific style-sheets using the survey ID.

Create your stylesheet with a name like styles_12345.css (where 12345 is the survey ID) and place it in your template directory.

Then place the following in startpage.pstpl right before the </head> tag:
<link rel="stylesheet" type="text/css" href="{TEMPLATEURL}styles_{SID}.css" />
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 10 months ago #56399

  • holch
  • holch's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 5428
  • Thank you received: 809
  • Karma: 240
Really good idea, tpartner.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | [url=https://manual.limesurvey.org/Workarounds[/url]

If you found this answer helpful and it saved you some time please consider a [url=https://donate.limesurvey.org[/url] to the...
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 10 months ago #56400

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
I do the same thing with custom JavaScript files:
<script type="text/javascript" src="{TEMPLATEURL}scripts_{SID}.js" charset="utf-8"></script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 10 months ago #56409

  • holch
  • holch's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 5428
  • Thank you received: 809
  • Karma: 240
Sounds like a really fine idea. Just one question: does the file actually have to exist or could you just include that in the header of the template and leave it there in case you need it?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | [url=https://manual.limesurvey.org/Workarounds[/url]

If you found this answer helpful and it saved you some time please consider a [url=https://donate.limesurvey.org[/url] to the...
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 10 months ago #56412

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
Oh, I just leave it there. If no file exists nothing happens.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: zenil79

css in a boilerplate question gets removed completely on next time invocation 5 years 10 months ago #56426

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 9580
  • Thank you received: 1374
  • Karma: 390
Maybe there are a possibility to add this automaticly in LS core:

php test to verify if upload/surveys/$SID/survey.css exist, and include it if it exist.

Here , there are 404 eror in apache log.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (use private message).
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 9 months ago #56705

  • zenil79
  • zenil79's Avatar
  • Offline
  • Junior Lime
  • Posts: 30
  • Thank you received: 2
  • Karma: 0
Yes..It would be nice to have a hook to put in $sid/survey.css and $sid/survey.js in the LS core
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 9 months ago #56720

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
zenil79 wrote:
Yes..It would be nice to have a hook to put in $sid/survey.css and $sid/survey.js in the LS core
You can add this as a feature request at our feature tracker . Please describe your idea as detailed as possible and try to outline a suitable solution/implementation as well.

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'"
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 9 months ago #56781

  • zenil79
  • zenil79's Avatar
  • Offline
  • Junior Lime
  • Posts: 30
  • Thank you received: 2
  • Karma: 0
Done. Idea #256
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 9 months ago #56847

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
Thanks!

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'"
The administrator has disabled public write access.
Time to create page: 0.751 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form