- Posts: 14
- Thank you received: 5
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
- Topic Author
- Offline
- New Member
Less
More
5 years 10 months ago #169436
by QuoTil
LS3.x change question style by theme-tylesheet not inline via question editing was created by QuoTil
Using LS3.x with fruity theme (extended).
The output of the question-text is handled by
in question_text_content.twig. Styles are inserted by inline-styles applied on
-tags. It is not possible to change the Twig-Filter from
to
("internal server error - Filter "striptags" is not allowed.") to get rid of the
-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 output of the question-text is handled by
Code:
{{ aQuestion.text | raw }}
Code:
<span>
Code:
raw
Code:
striptags
Code:
<span>
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 years 10 months ago #169437
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on 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
The topic has been locked.
- QuoTil
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 5
5 years 10 months ago #169442
by QuoTil
Replied by QuoTil on 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
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 years 10 months ago - 5 years 10 months ago #169445
by DenisChenu
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.
Replied by DenisChenu on 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.")}") }}
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 5
5 years 10 months ago #169448
by QuoTil
Replied by QuoTil on 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!
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 years 10 months ago - 5 years 10 months ago #169452
by DenisChenu
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.
Replied by DenisChenu on 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 .
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.