Welcome to the LimeSurvey Community Forum

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

Does Question Theme is overridable?

  • tassoman
  • tassoman's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
1 month 1 week ago #269320 by tassoman
Does Question Theme is overridable? was created by tassoman
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.x
Own server or LimeSurvey hosting: own on premise
Survey theme/template: vanilla child theme
==================

While I was successful at writing my custom survey theme based on core Vanilla, I'm not able to understand how do I can override and extend core question themes.
I can understand I can slighty edit graphical appearance by altering their css into my custom.css file. But how about altering html code?
Do I really need to write a full theme with config.xml and file structure from scratch? How do it can fit only with my custom survey theme, without altering other themes?
Also a note on Wiki documentation about Question themes is lacking of data, images are missing and existing images are obsolete, v3.x related. Maybe I can update it.
Thanks in advance
 

«All your survey answers are belong to us »

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
1 month 3 days ago #269521 by DenisChenu
Replied by DenisChenu on topic Does Question Theme is overridable?
Question theme construction : you have to create a config.xml only. After you can replace (if you want) specific theme twig file.
By survey theme : just add needed twg file at tghe good place ./survey/ directory oin theme  github.com/LimeSurvey/LimeSurvey/tree/ma...ication/views/survey

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

  • tassoman
  • tassoman's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
4 weeks 6 hours ago #269548 by tassoman
Replied by tassoman on topic Does Question Theme is overridable?
Sorry Denis, I didn't completely got your comment.

let's assume i can do
./uploads/theme/question/mycustom-5pointschoice/config.xml

Do I need `<extends>5pointschoice</extends>` attribute?
Then, if I put identical `.twig` subview, will be overridden without disabling original theme?

«All your survey answers are belong to us »

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 weeks 4 hours ago #269550 by tpartner
Replied by tpartner on topic Does Question Theme is overridable?
That is not the correct location for the config file.

For inspiration, you can see several examples of question themes, including correct file structure here - github.com/tpartner?tab=repositories

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: DenisChenu, tassoman

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
4 weeks 2 hours ago #269552 by DenisChenu
Replied by DenisChenu on topic Does Question Theme is overridable?
 mycustom/uploads/theme/question/5pointchoice/config.xml

 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

  • tassoman
  • tassoman's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 weeks 5 days ago - 2 weeks 5 days ago #269672 by tassoman
Replied by tassoman on topic Does Question Theme is overridable?
Ok, sorry for delayed reply.
So, what I can understand, a custom question theme is not overriding anything inside core.
But, by creating an appropriate directory structure, just a question theme can be a set of alternatives views for existing questions.

See this example (only for logged in users)

Part of the message is hidden for the guests. Please log in or register to see it.


I mean, there is no relationship between first "root" directory name and field <name> inside config.xml. So that makes you free to deliver many answers type in one theme. Is it? Why there is no documentation about this? Is it Yii framework stuff?

«All your survey answers are belong to us »
Last edit: 2 weeks 5 days ago by tassoman.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
2 weeks 5 days ago #269673 by DenisChenu
Replied by DenisChenu on topic Does Question Theme is overridable?
Question theme : create an alternative view, don't replace core
Question plugin : can replacve core or anything else
Survey theme /survey/questions/answer/questiontype/answer.twig : replace core (and maybe question theme : not tested) : i use it to doiable upload question type in 3.X for example.

> So that makes you free to deliver many answers type in one theme.

Don't understand

> Why there is no documentation about this?

take time (without money) : compare number of plugin in my gitlab and documentation/presentation website

> Is it Yii framework stuff?

Limesurey code (PHP) and Twig system : you can register different directory, and when twig call a file : it take each directory in order.
See : www.limesurvey.org/manual/GetPluginTwigPath

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: tassoman

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose