- Posts: 32
- Thank you received: 3
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?
- jackrabbithanna
- Topic Author
- Offline
- Junior Member
Less
More
3 years 2 months ago #210343
by jackrabbithanna
Load custom javascripts to bottom of body tag from config.xml? was created 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!
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.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12790
- Thank you received: 3940
3 years 2 months ago #210345
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Load custom javascripts to bottom of body tag from config.xml?
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.
- jackrabbithanna
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 32
- Thank you received: 3
3 years 2 months ago #210347
by jackrabbithanna
Replied by jackrabbithanna on topic Load custom javascripts to bottom of body tag from config.xml?
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.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11758
- Thank you received: 2753
3 years 2 months ago #210356
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Load custom javascripts to bottom of body tag from config.xml?
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.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
3 years 2 months ago #210357
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 Load custom javascripts to bottom of body tag from config.xml?
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.
- jackrabbithanna
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 32
- Thank you received: 3
3 years 2 months ago #210362
by jackrabbithanna
Replied by jackrabbithanna on topic Load custom javascripts to bottom of body tag from config.xml?
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!
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.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
3 years 2 months ago #210377
by DenisChenu
Else : can be a great feature to allow $position in XML attaribute, default to POS_HEAD
Need a feature request
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 Load custom javascripts to bottom of body tag from config.xml?
js file, not javascript, no ?jackrabbithanna wrote: I know in 3.x we can add js via config.xml and not having to put in head manually ..
Else : can be a great feature to allow $position in XML attaribute, default to POS_HEAD
Need a feature request
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 topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11758
- Thank you received: 2753
3 years 2 months ago #210407
by holch
Definitely a good idea to load JS in bottom of the page, if possible (especially when from an external source).
Many years ago we "stopped" the website of a maior car brand once because our server where the javascript was hosted went down. Unfortunately they had implemented our script in the header and not like we recommended at the end of the html code.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Load custom javascripts to bottom of body tag from config.xml?
It is becoming more standard to load JS in bottom of body tag for quicker first paint times.
Definitely a good idea to load JS in bottom of the page, if possible (especially when from an external source).
Many years ago we "stopped" the website of a maior car brand once because our server where the javascript was hosted went down. Unfortunately they had implemented our script in the header and not like we recommended at the end of the html code.
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.
- jackrabbithanna
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 32
- Thank you received: 3
3 years 2 months ago #210415
by jackrabbithanna
Replied by jackrabbithanna on topic Load custom javascripts to bottom of body tag from config.xml?
@DenisChenu
Right, I'm talking about a javascript file.
What is your preferred way to receive feature requests? Github repo issue?
Right, I'm talking about a javascript file.
What is your preferred way to receive feature requests? Github repo issue?
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
3 years 2 months ago #210418
by DenisChenu
But:
Start by a mantis issue
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 Load custom javascripts to bottom of body tag from config.xml?
Remind : i'm not from LimeSurvey GMBH team … only an external dev like youWhat is your preferred way to receive feature requests? Github repo issue?
But:
- read github.com/LimeSurvey/LimeSurvey/blob/ma...G.md#getting-started
- read community.limesurvey.org/feature-request/
- read manual.limesurvey.org/Standard_for_Git_commit_messages
Start by a mantis issue
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 topic has been locked.