Sonya* Posted February 14, 2022 Posted February 14, 2022 There is a possibility to add code to body output. Can you add the same for Head code, please? This is the only thing where users with default and easy-mode themes have to mess up with the templates code and probably get upgrade headache. Additionally, users without HTML knowledge cannot add any code at all. It starts by Ads Network (like AdSense) and ends with pop-up forms for Newsletter sign-ups (like Mailchimp). ZLTRGO, Meddysong, Randy Calvert and 1 other 2 2
Sonya* Posted March 29, 2022 Author Posted March 29, 2022 Just to show, that this is needed: https://invisioncommunity.com/forums/topic/466493-how-to-add-new-script-tags-to-page-head-area/ https://invisioncommunity.com/forums/topic/466083-google-adsense-auto-ads-where-to-paste-code/ https://invisioncommunity.com/forums/topic/454656-custom-js-head-code/ https://invisioncommunity.com/forums/topic/456702-add-js-to-of-a-page/ Usage examples Mailchimp JS header code to display the native Mailchimp "Subscribe" block. Add an ad network code. Add custom fonts and so on All these people would and do mess globalTemplate to just add their custom JS scripts. Later on they are probably going to run into issues while updating. They cannot just disable the scripts for a test without editing HTML and CSS again and again. Please consider this suggestion for the head code. It would be user-friendly for non-code customers and would allow debugging issues much easier. It is not a big deal at all. I still use this https://invisioncommunity.com/files/file/7631-custom-head-and-body/ and it works like a charm. Unfortunately, not updated and not usable for Cloud starter package. Meddysong, opentype, My Sharona and 3 others 4 2
Ghost Face Posted April 1, 2022 Posted April 1, 2022 I'm honestly against an implementation of this feature since it encourages bad pratice. You should avoid putting JS code in your head tags at all costs unless it's really necessary.
Sonya* Posted April 1, 2022 Author Posted April 1, 2022 24 minutes ago, Ghost Face said: since it encourages bad pratice. You should avoid putting JS code in your head tags at all costs unless it's really necessary. This is true for professionals. Professionals can edit HTML and can also resolve the upgrade issues. Non-code customers will not understand what you say. Google, Mailchimp and all other providers out there offer them ready-to-use snippets along with the instruction where to put it. And they will try to add them by messing templates. Even worse, they will forget their snippets later in the template bits. The scripts stay there forever, even if they are not needed. You do not remove something that you do not see, do not understand and not aware of 😉 Hostingunlock and Askancy 2
Xaviours Posted April 1, 2022 Posted April 1, 2022 Personally, add either the option for "Header" or "Footer" like other software does. There are definitely certain code that does not need to be loaded in the header. As @Sonya* suggested, it's definitely helpful for people who are not code-savy. Hostingunlock 1
Recommended Posts