Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

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: 6574
  • 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
  • Offline
  • Moderator Lime
  • Posts: 9600
  • Thank you received: 1376
  • 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: 5446
  • Thank you received: 814
  • 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: 6574
  • 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: 5446
  • Thank you received: 814
  • 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: 6574
  • 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: 5446
  • Thank you received: 814
  • 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: 6574
  • 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
  • Page:
  • 1
  • 2
Time to create page: 1.407 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form