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

More
2 months 2 weeks ago #169436 by QuoTil
QuoTil created the topic: LS3.x change question style by theme-tylesheet not inline via question editing
Using LS3.x with fruity theme (extended).

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

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #169437 by tpartner
tpartner replied the topic: LS3.x change question style by theme-tylesheet not inline via question editing
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

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #169442 by QuoTil
QuoTil replied the topic: LS3.x change question style by theme-tylesheet not inline via question editing
Thanks! Done as suggested: bugs.limesurvey.org/view.php?id=13732
The following user(s) said Thank You: tpartner

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago - 2 months 2 weeks ago #169445 by DenisChenu
DenisChenu replied the topic: LS3.x change question style by theme-tylesheet not inline via question editing
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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 2 months 2 weeks ago by DenisChenu.
The following user(s) said Thank You: QuoTil

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #169448 by QuoTil
QuoTil replied the topic: LS3.x change question style by theme-tylesheet not inline via question editing
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!

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago - 2 months 2 weeks ago #169452 by DenisChenu
DenisChenu replied the topic: LS3.x change question style by theme-tylesheet not inline via question editing
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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 2 months 2 weeks ago by DenisChenu.
The following user(s) said Thank You: QuoTil

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!