Jump to content

Featured Replies

Posted

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

Solved by Daniel F

Go to solution
  • Community Expert

I don't remember any such existing modification that does this, but it would be a quick one to write.

  • 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.

There was one on here called "Custom Head and Body". It's now gone with the closed marketplace.

Could contain: Text

Could contain: Page, Text

Edited by beats23

  • 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.

Could contain: Page, Text, File

  • 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.

Could contain: Page, Text, File

This sounds like a great solution.  That would be maintained with theme updates, correct?

  • 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.

  • Author

Yay, this works.

Sadly, I needed to disable my Snow plugin as it seems to have conflicted.

  • 1 month later...
  • 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

  • Community Expert

I have tagged developers on this to confirm

  • Management

What was deleted? This was a standard upgrade that would not remove data from custom themes. 

  • 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.

  • Community Expert

This did not happen on any of my 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.

Reproduced as follows;

  1. Create a brand new theme
  2. Download the theme using the option in the console
  3. Edit the theme, populate the header and footer bits via the available tab.
  4. Review site on front-end, verify items are there.
  5. Use the "Upload a new version" option on the theme, and use the XML file that was downloaded in step 2
  6. Edit the theme - the previously added header/footer content is gone
  7. 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.
  • 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.

  • 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.

Recently Browsing 0

  • No registered users viewing this page.