Welcome to the LimeSurvey Community Forum

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

Is there a method to access the custom classes assigned to a question via a TWIG

More
4 years 1 week ago #219066 by cheeseburger
Hello everyone.

In something like the printanswers_question.twig, we can find calls to things like the following:

 {{question.type}}/{{question.questionclass}} {{question.question}}

Is there a location that shows a list of all of the available tags/attributes under "question." that we can access? 

Also, in the event I don't find the answers in the list for which I just requested, is there a method to access the sidebar's custom class field CSS CLASS values of any question? For example: {{question_answer.css_class}}

To clarify: When you create a question, you can use the sidebar of that question to apply your own custom class names. I would like to access those custom class names from within a twig. 

Thanks!
The topic has been locked.
More
4 years 1 week ago #219068 by tpartner

Is there a location that shows a list of all of the available tags/attributes under "question." that we can access?

To see all elements of the question array:

Code:
{{ dump(question) }}

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: cheeseburger
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose