Welcome to the LimeSurvey Community Forum

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

Load custom javascripts to bottom of body tag from config.xml?

More
2 years 2 months ago #210343 by jackrabbithanna
I'm wanting to add some additional javascript to the bottom of the body tag instead of the head.

Is there a standard way to do this from the config.xml with <add> tags .. ?

Maybe a "best" way to do this?

Thanks in advanced!
The topic has been locked.
More
2 years 2 months ago #210345 by Joffm
At the end of the "layout_global.twig" before </body>?

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
2 years 2 months ago #210347 by jackrabbithanna
correct .. I know I could hardcode something, just wondering if there's a way to specify from config.xml of theme or if there are existing best practices.
The topic has been locked.
More
2 years 2 months ago #210356 by holch
What is the difference between writing it into the twig file or into the config file of a theme? Both is "hard coded" in a way, isn't it.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
More
2 years 2 months ago #210357 by tpartner
As far as I know, it cannot be done via config.xml.

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: DenisChenu
The topic has been locked.
More
2 years 2 months ago #210362 by jackrabbithanna
IDK what all differences may be, that's why I ask. When I develop something, I aim for "best practices", and understanding the infrastructure best I can.

I know in 3.x we can add js via config.xml and not having to put in head manually .. Another difference maybe inheritance with the <replace> tag.
It is becoming more standard to load JS in bottom of body tag for quicker first paint times.

No big deal I'll pop it in there manually.

Thanks everybody!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose