Script execution "Top of pages" vs "HTML Head" - Regression?

I used to have some script in the “Top of pages” section…

However recently I noticed it’s no longer getting executed.

I rewrote the JavaScript so it could work in “HTML Head” where it does get executed.

The 4 is where I was putting the JavaScript script tags previously.

You need to go to CSS/HTML TAB

From there, go to HEADER section and paste your Script there

Not a regression, we had like 3 different areas in Admin where you could put “stuff at top of page” and we normalized to only one.

So to be clear you just stopped the JavaScript in the Top of pages section from executing?

I ask because I can still put normal HTML content in Top of pages which is what I need - it’s in the wrong place anywhere else.

@zogstrip any ideas?

All three Top of the pages, Bottom of the pages and HTML Head contents were created before we had a solid site customization story. Now that we do, I migrated them under the proper CSS/HTML tab and used SiteCustomization instead of the SiteText.

This should have been pushed last week, but for some reason wasn’t :blush: I renamed the migrations and properly (this time) pushed it :rat:

https://github.com/discourse/discourse/commit/6ee2849df64e048bce387a4a289d16c7276e770f

NOTES

  • HTML head was migrated into </head>
  • Bottom of the pages was migrated into </body>
  • Top of the pages was removed as it’s redundant (should either use header or the Global Notice).

@zogstrip
After updating to the current version my ads disappeared.

Previously I used Top of the pages to insert simple HTML ad content.
Global Notice is inappropriate for this - forces the single line of text in s notice styled box.
This is also the type of content that is independent of theme or style where Text Content made sense.

Currently I don’t have any obvious way to add my ads back in where I had them.

I’m assuming there is some complex template I can modify - but this seems a bit much for a simple image ad banner.

A small (but as it turns out important) change in this commit broke some things and unfortunately had to be reverted. The migration was not destructive so if you get master now you should see your ad again. Tomorrow @zogstrip will fix it and un-revert :smile:

1 Like

Thanks @eviltrout - thought I was going to have to re-write the HTML to insert via JavaScript at almost 2am then :smile:

Here’s the commit that move all 3 SiteText fields to SiteCustomization :beetle:

https://github.com/discourse/discourse/commit/6734a51b6add70d576f25b29afbebc85f79bdc2f

1 Like

This topic was automatically closed after 24 hours. New replies are no longer allowed.