Yep I'm in the LS Team, and I'm the one who exported all the HTML into views and added the view override system.
At the beginning, I wanted to add the button layout as an alternative for the radio/checkbox for each concerned question type. But finally, I did it for gender only: I had other priorities.
So, yes, if you do it fine, we could integrate your code into core, and we could add a "button layout" option in the radio list's advanced options.
As soon as we rewrite the question views with a templating language (probably twig), the view override system will be official, documented, and we'll offer you a place to share your experiments. That could happen before the end of the year.
In a further future, when we'll have question object, it will be easy to transform your custom views in new question types (that could be share/sold and uploaded in any LimeSurvey installation).
Great.. A boss once told me, "Kevin, I take care of you because you take care of me." So, I'll help you because you've helped me. So, for production, should I do it as an override or copy the function "do_list_radio" in qandra_helper.php.
And copy survey/questions/radiolist to / survey/questions/list_custom/ and edit the code?
I'm placing // Kevin on every line I change so it will be easy to find the changes.
The topic has been locked.
LouisGac
New Member
LessMore
Thank you received: 0
8 years 6 months ago - 8 years 6 months ago#142440by LouisGac
Quick explanation:
if overwrite_question_views is true in template the lime survey config allow_templates_to_overwrite_views, then it will look if the template have its own view file to render it (if not, it render the core view file).
To be sure the custom views are loaded, I'd advise you to add something very visible in the view, like a: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" :laugh:
Also, be sure that you're using the right template in your survey... file permissions, etc
Be sure that what is going wrong is a very little thing.
It must not be using the correct template because I edited the startpage.pspl and my change did not appear. I'll be back <saying with Arnold Arnold Schwarzenegger's accent>
<!--
The label text is provided inside a div,
so final user can add paragraph, div, or whatever he wants in the subquestion text
This field is related to the input thanks to attribute aria-labelledby
-->
<div class="label-text label-clickable" id="label-answer<?php echo $name.$code; ?>">
<?php echo $answer; ?>
</div>
</div>