Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted December 15, 20231 yr Hi, Is there an add-on that lets you insert code in a specific location? For instance, in this case, I use a chat option that wants the code inserted before the </body> tag. It's a pain to update 6 different themes, then each time I update the theme, I need to remember to re-inset that code. Thanks
December 15, 20231 yr Community Expert I don't remember any such existing modification that does this, but it would be a quick one to write.
December 16, 20231 yr Author I don't remember any such existing modification that does this, but it would be a quick one to write. Quick for whom? 🙂 It would take me many months to learn how. I can think of several options that would be helpful. At the beginning and end of head, and at the beginning and end of body. If you make it, please leave a link to your site so I can buy it.
December 16, 20231 yr There was one on here called "Custom Head and Body". It's now gone with the closed marketplace. Edited December 16, 20231 yr by beats23
December 16, 20231 yr Community Expert Solution There's no need for a 3rd party app! You can add custom HTML code to the end of the </body> tag by adding it to the footer HTML field.
December 16, 20231 yr Author There's no need for a 3rd party app! You can add custom HTML code to the end of the </body> tag by adding it to the footer HTML field. This sounds like a great solution. That would be maintained with theme updates, correct?
December 16, 20231 yr Community Expert This sounds like a great solution. That would be maintained with theme updates, correct? Yes, this is a part of the core solution so will be a part of unmodified theme updates from release to release.
December 16, 20231 yr Author Yay, this works. Sadly, I needed to disable my Snow plugin as it seems to have conflicted.
February 8, 20241 yr Author Yes, this is a part of the core solution so will be a part of unmodified theme updates from release to release. So I just updated my site to 4.7.15 and updated my themes, all from @Ehren. The default IPS theme was maintained, but the other themes had the code deleted. Is that expected? Thanks
February 9, 20241 yr Management What was deleted? This was a standard upgrade that would not remove data from custom themes.
February 9, 20241 yr Author What was deleted? This was a standard upgrade that would not remove data from custom themes. In December, I added JS to Theme --> Custom theme by Ehren --> Header and Footer --> Footer HTML. Yesterday I updated the site to 4.7.15. Then, I updated 5 themes I have by Ehren. All five themes had the JS removed from the Footer HTML field.
February 9, 20241 yr In December, I added JS to Theme --> Custom theme by Ehren --> Header and Footer --> Footer HTML. Yesterday I updated the site to 4.7.15. Then, I updated 5 themes I have by Ehren. All five themes had the JS removed from the Footer HTML field. Reproduced as follows; Create a brand new theme Download the theme using the option in the console Edit the theme, populate the header and footer bits via the available tab. Review site on front-end, verify items are there. Use the "Upload a new version" option on the theme, and use the XML file that was downloaded in step 2 Edit the theme - the previously added header/footer content is gone Review site on front-end, the previously added header/footer content may still be there in the theme. If so... Run support tool to clear caches Review site on front-end, the previously added header/footer content are now gone.
February 9, 20241 yr Management Hmm. I can see why the code does that. The XML does not have header/footer, so any changes to those areas look to be reset when you upload a "new" version which does not have any header/footer code so the theme represents what is in the XML. I guess what you're asking for is header/footer code to persist through upgrades? It may mean you get some conflicts you'll need to manually manage.
February 9, 20241 yr Author I guess what you're asking for is header/footer code to persist through upgrades? It may mean you get some conflicts you'll need to manually manage. Yes, that would be preferred. I purchase the branding-free option. I previously made a CSS edit. I get asked each time if I want to keep the new or the old template. This would be the same. For now, I'll remember to add the code back. I use it for a help bot.