- Posts: 19
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
theme options
- imoullet
- Topic Author
- Offline
- New Member
Less
More
2 years 10 months ago - 2 years 10 months ago #216357
by imoullet
twig theme options was created by imoullet
Hello
Is it possible to create a new option with some text with
<input type='text' name='test' class=' simple_edit_options_test ' data-id='test'/>
instead of using a radio or select button
Thanks for your help
Is it possible to create a new option with some text with
<input type='text' name='test' class=' simple_edit_options_test ' data-id='test'/>
instead of using a radio or select button
Thanks for your help
Last edit: 2 years 10 months ago by DenisChenu. Reason: twig theme options
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
2 years 10 months ago - 2 years 10 months ago #216359
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 theme options
On 3.X or 4.X ?
On 3.X : there are no real helper …
See gitlab.com/SondagesPro/SurveyThemes/skel...ns/options.twig#L970
On 4.X (with helper) : i don't know : maybe look at code. And if don't exist : create a feature request.
I move this topic to Development forum
On 3.X : there are no real helper …
See gitlab.com/SondagesPro/SurveyThemes/skel...ns/options.twig#L970
On 4.X (with helper) : i don't know : maybe look at code. And if don't exist : create a feature request.
I move this topic to Development forum
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: 2 years 10 months ago by DenisChenu.
The topic has been locked.
- imoullet
- Topic Author
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 0
2 years 10 months ago #216531
by imoullet
Replied by imoullet on topic theme options
Thanks for your reply.
I am working on LS 3.x
I could add my custom option Emetteur 2 in options.twig file as below
{# Emmetteur 2 #}
<div class='row'>
<div class='col-sm-12'>
<div class='panel panel-default'>
<div class='panel-heading'>{{ sprintf( gT("Emetteur 2"), templateConfiguration.template_name)|capitalize }} </div>
<div class='panel-body'>
<div class='form-group row'>
<label for='simple_edit_options_emetteur2' class='control-label'>{{ gT("Département ou institut:") }}</label>
<div class='col-sm-12'>
<input type="text" name="emetteur2" data-inheritvalue="{{oParentOptions.emetteur2}}" id="emetteur2" class="form-control selector_option_value_field text_option_string_field simple_edit_options_fontcolor" data-id="emetteur2" />
</div>
</div>
</div>
</div>
</div>
</div>
I can see the panel Emetteur2 in the The options panel ( global settings and survey theme options ) as expected ( see attached file)
Then I try to enter some text in the corresponding field , and save ( upper right save button) the text just disappears and is not saved..
Maybe the problem comes from the options.js file. Do I have to change something in this file ?
Any idea ?
Thanks
I am working on LS 3.x
I could add my custom option Emetteur 2 in options.twig file as below
{# Emmetteur 2 #}
<div class='row'>
<div class='col-sm-12'>
<div class='panel panel-default'>
<div class='panel-heading'>{{ sprintf( gT("Emetteur 2"), templateConfiguration.template_name)|capitalize }} </div>
<div class='panel-body'>
<div class='form-group row'>
<label for='simple_edit_options_emetteur2' class='control-label'>{{ gT("Département ou institut:") }}</label>
<div class='col-sm-12'>
<input type="text" name="emetteur2" data-inheritvalue="{{oParentOptions.emetteur2}}" id="emetteur2" class="form-control selector_option_value_field text_option_string_field simple_edit_options_fontcolor" data-id="emetteur2" />
</div>
</div>
</div>
</div>
</div>
</div>
I can see the panel Emetteur2 in the The options panel ( global settings and survey theme options ) as expected ( see attached file)
Then I try to enter some text in the corresponding field , and save ( upper right save button) the text just disappears and is not saved..
Maybe the problem comes from the options.js file. Do I have to change something in this file ?
Any idea ?
Thanks
Attachments:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
2 years 10 months ago #216547
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 theme options
Oh yes : i think i add some JS function ...
gitlab.com/SondagesPro/SurveyThemes/skel...e/options/options.js
I really dislike this JS only form … really awfull to fix and improve.
I really dislike this JS only form … really awfull to fix and improve.
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.
The topic has been locked.
- imoullet
- Topic Author
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 0
2 years 10 months ago #216768
by imoullet
Replied by imoullet on topic theme options
I could make some progress and finally get it work but ONLY with the inherit button off . I mean my new option can only be modified at the sruvey level if i broke the inheritance..
I would like it to be completely independent of the inheritance process, in the same way as the Fruity variations for example.
Idea?
Thanks
Best
I would like it to be completely independent of the inheritance process, in the same way as the Fruity variations for example.
Idea?
Thanks
Best
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
2 years 10 months ago #216769
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 theme options
Create a feature request ?
I think it's not possible currently : only variations are out of inherit by LimeSurvey fixed code.
(PS : i think it's a good idea to have some "inherit by group)
Or : you can save all value to inherit in place of global inheritance. Again : it's done only in JS …
I think it's not possible currently : only variations are out of inherit by LimeSurvey fixed code.
(PS : i think it's a good idea to have some "inherit by group)
Or : you can save all value to inherit in place of global inheritance. Again : it's done only in JS …
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.
The topic has been locked.
- imoullet
- Topic Author
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 0
2 years 9 months ago #216789
by imoullet
Replied by imoullet on topic theme options
Thanks for the info..
In fact I could have 2 solutions
1)keep the toggle inheritance button but remove, via options.twig, all the options fields except my "free" emetteur2 field . Survey administrator would just have to refuse the inheritance to be able to fill the emetteur2 field.
2) your solution which is the one I tried without success. How could I simply save all value to inherit ? I could not find the way .. I could then just remove the inheritance toggle button. It will be on by default since inheritance is defined to 1 in options.js and leave only my "free" field emetteur2 to display
Which one would you recommend.
I was so enthousiastic with the new options features in 3.x and thought it would be so simple to have a generic master theme and let each survey administrator chose the name of their department that I could then simply use in the navbar.twig file to be displayed in my header.. Maybe there is a simple solution for that ??
Anyway thanks for your response
In fact I could have 2 solutions
1)keep the toggle inheritance button but remove, via options.twig, all the options fields except my "free" emetteur2 field . Survey administrator would just have to refuse the inheritance to be able to fill the emetteur2 field.
2) your solution which is the one I tried without success. How could I simply save all value to inherit ? I could not find the way .. I could then just remove the inheritance toggle button. It will be on by default since inheritance is defined to 1 in options.js and leave only my "free" field emetteur2 to display
Which one would you recommend.
I was so enthousiastic with the new options features in 3.x and thought it would be so simple to have a generic master theme and let each survey administrator chose the name of their department that I could then simply use in the navbar.twig file to be displayed in my header.. Maybe there is a simple solution for that ??
Anyway thanks for your response
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
2 years 9 months ago #216811
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 theme options
Maybe it's best to check on 4.X master version and the new option system.
And ask for a feature request
I have a feature request to do for dropdown with category
And ask for a feature request
I have a feature request to do for dropdown with category
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.
The topic has been locked.