Jump to content

<head> Add On


Go to solution Solved by Daniel F,

Recommended Posts

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

Posted
23 minutes ago, teraßyte said:

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.

Posted
4 hours ago, Daniel F said:

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?

Posted
1 hour ago, Square Wheels said:

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.

  • 1 month later...
Posted
On 12/16/2023 at 8:56 AM, Jim M said:

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

Posted
3 hours ago, Matt said:

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.

Posted
40 minutes ago, Square Wheels said:

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
Posted

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.

Posted
6 minutes ago, Matt said:

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 members

    • No registered users viewing this page.
×
×
  • Create New...