Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

LS3.x change question style by theme-tylesheet not inline via question editing

  • QuoTil
  • QuoTil's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #169436 by QuoTil
Using LS3.x with fruity theme (extended).

The output of the question-text is handled by
Code:
{{ aQuestion.text | raw }}
in question_text_content.twig. Styles are inserted by inline-styles applied on
Code:
<span>
-tags. It is not possible to change the Twig-Filter from
Code:
raw
to
Code:
striptags
("internal server error - Filter "striptags" is not allowed.") to get rid of the
Code:
<span>
-tags.

The problem: The survey creator shall not have the option the change the style especially not the font-family OR should be able to select theme-fonts such as Noto, Lato etc. from within the question-editor.

Any ideas?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169437 by tpartner
File a bug report and ask to have thestriptags() function added to the allowed list.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: QuoTil
The topic has been locked.
  • QuoTil
  • QuoTil's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #169442 by QuoTil
The following user(s) said Thank You: tpartner
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago - 5 years 10 months ago #169445 by DenisChenu
Since we add allowed function in internal : github.com/LimeSurvey/LimeSurvey/blob/ca...ig/internal.php#L213

strip_tags is a PHP function,

You can update [twigRenderer][functions] and [twigRenderer][sandboxConfig][filters] in you own config.php

See github.com/LimeSurvey/LimeSurvey/blob/ca...ig/internal.php#L369

Then : no need to wait for an update.

If it work : it can be great if you update our manual : manual.limesurvey.org/Optional_settings#Yii_settings

===

And maybe you can use ExpressionManager : {{ processString("{strip_tags(".aQuestion.text.")}") }}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 10 months ago by DenisChenu.
The following user(s) said Thank You: QuoTil
The topic has been locked.
  • QuoTil
  • QuoTil's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #169448 by QuoTil
Nice! Updating the config.php is working.

I really appreciate your responses but one thing is interesting: Your solutions are kind of "hacks" while I think that the bigger improvement for LS would be to be able to add custom fonts to the font selector in the question-editor ui.

Please don't get me wrong. Your suggestions do really help me. But I think that the product would grow by a different approach.

Have a nice one!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago - 5 years 10 months ago #169452 by DenisChenu
Oh, i think strip_tags is really a needed filter and function :).
Except it's not a hack : it's the way of Yii management : the way to do for Yii :).

But maybe some specific filter/function can be managed only in config :).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 10 months ago by DenisChenu.
The following user(s) said Thank You: QuoTil
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose