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

  • cheeseburger
  • cheeseburger's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 8 months 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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 8 months 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.

Lime-years ahead

Online-surveys for every purse and purpose