Welcome, Guest
Username: Password: Remember me
  • 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 3 years 7 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.

Re: css in a boilerplate question gets removed completely on next time invocation 3 years 7 months ago #56318

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4207
  • Thank you received: 791
  • Karma: 360
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.

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: css in a boilerplate question gets removed completely on next time invocation 3 years 7 months ago #56345

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6362
  • Thank you received: 827
  • Karma: 245
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.
The administrator has disabled public write access.

Re: css in a boilerplate question gets removed completely on next time invocation 3 years 7 months ago #56353

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2719
  • Thank you received: 331
  • Karma: 121
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 | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: css in a boilerplate question gets removed completely on next time invocation 3 years 7 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.

Re: css in a boilerplate question gets removed completely on next time invocation 3 years 7 months ago #56397

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4207
  • Thank you received: 791
  • Karma: 360
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.

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: css in a boilerplate question gets removed completely on next time invocation 3 years 7 months ago #56399

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2719
  • Thank you received: 331
  • Karma: 121
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 | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: css in a boilerplate question gets removed completely on next time invocation 3 years 7 months ago #56400

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4207
  • Thank you received: 791
  • Karma: 360
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.

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: css in a boilerplate question gets removed completely on next time invocation 3 years 7 months ago #56409

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2719
  • Thank you received: 331
  • Karma: 121
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 | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: css in a boilerplate question gets removed completely on next time invocation 3 years 7 months ago #56412

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4207
  • Thank you received: 791
  • Karma: 360
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: zenil79
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.137 seconds
Donation Image