Customizing twig template

More
6 days 12 hours ago #180334 by apires
Hi,

I'm migrating the LimeSurvey from our company (v2.0.0) to a lastest one (3.15.6),
I already have everything working in the new one, but, having some issues.

So, in the oldest version, we got a few customizing fields and flows, for example, at the begining of survey, we have an pop-up asking for the user wanna asnwer for the group of companies, or a individual one.

My issues is about passing variables to the html (welcome.twig) page. I'm newbie in php, more newbie with twig development. In the oldest version (startpage.pstpl), we pass variables from replacements_helper.php (templace_replace) to the screen using {variable}, and in the newest one, is something like {{name}}.

I've looking in the projects, and all the variables is passed by "i.e aSurveyInfo.class.something", it should be the same?

I've tried almost everything, and cant pass variable values from replacements_helper to the page.. any idea?

Best regards
Attachments:

Please Log in or Create an account to join the conversation.

More
6 days 11 hours ago #180336 by LouisGac

Please Log in or Create an account to join the conversation.

More
6 days 10 hours ago - 6 days 10 hours ago #180337 by apires
Replied by apires on topic Customizing twig template
Thanks for the information.

I've readed this topic before, and still stuked with this problem in my head.
Its not suposed to pass variables from replacements_helper.php file to the view? welcome.twig for example? when the page loads, i can echo all the variables to Chrome console, but cant display in welcome.twig page... i'm trying with {{ variable }} and its not working.
Attachments:
Last edit: 6 days 10 hours ago by apires.

Please Log in or Create an account to join the conversation.

More
6 days 10 hours ago #180338 by apires
Replied by apires on topic Customizing twig template
I've tryied with 1 and 2 bracelets {{ }} and nothing.. :(

Please Log in or Create an account to join the conversation.

More
6 days 7 hours ago #180339 by jelo
Replied by jelo on topic Customizing twig template

apires wrote: I've tryied with 1 and 2 bracelets {{ }} and nothing.. :(

It's still very messy. Not every twig template is correctly getting every variable.

To display variables like in LS2, you should try processString.
{{ processString("{VARNAME}") }}

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

More
5 days 18 hours ago #180350 by apires
Replied by apires on topic Customizing twig template
God bless you!! It works now :))

Many thanks

Cheers

Please Log in or Create an account to join the conversation.

More
5 days 18 hours ago #180353 by jelo
Replied by jelo on topic Customizing twig template

apires wrote: God bless you!! It works now :))

You can thank Denis for forcing to implement this. It's always good to have developers with first hand experience on actual running a survey. You cannot take that for grated here ;-)

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in or Create an account to join the conversation.

More
5 days 18 hours ago #180354 by LouisGac
Replied by LouisGac on topic Customizing twig template
Denis didn't force it at all, it's been very welcome.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!