Welcome to the LimeSurvey Community Forum

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

{{ aQuestion }} is empty

More
2 years 1 day ago - 2 years 1 day ago #213980 by Shaogul
hi there

im having real troubles creating my own theme in LS [url=http://localhost/limesurvey/index.php/admin/questions/sa/view/surveyid/139476/gid/1/qid/1#modalSystemInformation]3.25.19+210323[/url]. in my question view, i want to display the question code, therefore i tried using {{ aQuestion.code }}, just as it is used in the vanilla theme. the problem ist, the variable is empty and returns NULL. I have searched the forum, read the manual on creating themes and haven't found anything that would help. am i missing something?

(im running limesurvey on xampp on windows 10)

cheers
Last edit: 2 years 1 day ago by Shaogul.
The topic has been locked.
More
2 years 21 hours ago #213999 by tpartner
Replied by tpartner on topic {{ aQuestion }} is empty
{{ aQuestion }} will never work because aQuestion is an array. You need to use the dump function.

What file are you trying to place it in?

Both of these work in, for example, question_text_content.twig.

Code:
{{ dump(aQuestion) }}

Code:
{{ aQuestion.code }}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
2 years 7 hours ago #214017 by Shaogul
Replied by Shaogul on topic {{ aQuestion }} is empty
hey, thx for the quick reply

​​​​​​so i used the dump function to see whats in the array, it just returned NULL. i used it in question.twig which i included in my main.twig

The topic has been locked.
More
2 years 6 hours ago #214031 by jelo
Replied by jelo on topic {{ aQuestion }} is empty

Both of these work in, for example, question_text_content.twig.

Perhaps a LimeSurvey version issue?  LS 3.25.19+210323 may be the reason.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
2 years 6 hours ago #214035 by tpartner
Replied by tpartner on topic {{ aQuestion }} is empty

Both of these work in, for example, question_text_content.twig.

Perhaps a LimeSurvey version issue?  LS 3.25.19+210323 may be the reason.
Yes, perhaps. They both work for me in question.twig using version 3.25.8.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
2 years 6 hours ago #214037 by Shaogul
Replied by Shaogul on topic {{ aQuestion }} is empty
hmm, i just installed version 3.25.0 and got the same problem :( no idea why..
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose