- Posts: 5
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
{{ aQuestion }} is empty
2 years 2 months ago - 2 years 2 months ago #213980
by Shaogul
{{ aQuestion }} is empty was created 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
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 2 months ago by Shaogul.
The topic has been locked.
2 years 2 months ago #213999
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
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.
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.
2 years 2 months 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
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.
2 years 2 months ago #214031
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic {{ aQuestion }} is empty
Perhaps a LimeSurvey version issue? LS 3.25.19+210323 may be the reason.Both of these work in, for example, question_text_content.twig.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
2 years 2 months ago #214035
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic {{ aQuestion }} is empty
Yes, perhaps. They both work for me in question.twig using version 3.25.8.
Perhaps a LimeSurvey version issue? LS 3.25.19+210323 may be the reason.Both of these work in, for example, question_text_content.twig.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
2 years 2 months 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.
2 years 2 months ago #214041
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic {{ aQuestion }} is empty
Can you attach your 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.
2 years 2 months ago - 2 years 2 months ago #214047
by Shaogul
Replied by Shaogul on topic {{ aQuestion }} is empty
attached main and question twigs. i noticed, that i had to include main.twig in layout_global.twig, otherwise it wouldn't load it. in vanilla the main.twig seems to be included without using {{ include(main.twig) }}.
Attachments:
Last edit: 2 years 2 months ago by Shaogul.
The topic has been locked.
- DenisChenu
-
- Away
- LimeSurvey Community Team
-
Less
More
- Posts: 13145
- Thank you received: 2422
2 years 2 months ago #214055
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 {{ aQuestion }} is empty
{{ dump(aQuestion) }} work only with debug mode.
aQuestion is in aGroup in aSurveyInfo at this time
github.com/LimeSurvey/LimeSurvey/blob/08...ntimeHelper.php#L511
Then : it sedn as aQuestion ONLY in quetsion.twig not before.
aQuestion is in aGroup in aSurveyInfo at this time
github.com/LimeSurvey/LimeSurvey/blob/08...ntimeHelper.php#L511
Then : it sedn as aQuestion ONLY in quetsion.twig not before.
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 following user(s) said Thank You: Shaogul
The topic has been locked.
2 years 2 months ago - 2 years 2 months ago #214116
by Shaogul
Replied by Shaogul on topic {{ aQuestion }} is empty
yeah i had debug mode on. oh i see, i directly included the question twigs in the main twig. i extended another vanilla and kept the filestructure with the group twigs included, now it works
thanks alot

Last edit: 2 years 2 months ago by Shaogul.
The following user(s) said Thank You: DenisChenu
The topic has been locked.