Welcome, Guest
Username: Password: Remember me

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 6 days 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 5 days ago #56318

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5408
  • Thank you received: 1154
  • Karma: 479
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.

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

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 8214
  • Thank you received: 1120
  • Karma: 332
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.

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

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 4365
  • Thank you received: 615
  • Karma: 197
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.

css in a boilerplate question gets removed completely on next time invocation 5 years 5 days 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 4 days ago #56397

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5408
  • Thank you received: 1154
  • Karma: 479
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.

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

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 4365
  • Thank you received: 615
  • Karma: 197
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.

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

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5408
  • Thank you received: 1154
  • Karma: 479
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.

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

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 4365
  • Thank you received: 615
  • Karma: 197
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.

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

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5408
  • Thank you received: 1154
  • Karma: 479
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

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

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 8214
  • Thank you received: 1120
  • Karma: 332
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.
The administrator has disabled public write access.

css in a boilerplate question gets removed completely on next time invocation 5 years 7 hours 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 4 years 11 months ago #56720

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

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

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5840
  • Thank you received: 347
  • Karma: 261
Thanks!

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.
Moderators: ITEd
Time to create page: 0.176 seconds