- This topic has 6 replies, 2 voices, and was last updated 4 years, 11 months ago by
Leo.
-
AuthorPosts
-
May 10, 2021 at 3:38 pm #1773331
paddyd
I’m stumped. MailChimp has a bit of javascript one can use to display an archive of email newsletters. I’ve tried putting it in as an HTML block. Nothing shows up (though you can see it in the page code if you look at in the browser).
https://urbanneighbourhoods.ca/email-archive
I’ve tried adding it as an element – specifically, a hook. (tried a block too, but that didn’t work) Depending on which type of hook I choose, sometimes it loads the expected content – but puts it at the bottom of the page, AFTER the footer. And that’s IF I can get it to load at all. I’ve tried all over the page – but if it deigns to show it, it’s ALWAYS after the footer. Needless to say, this isn’t where I want it.
https://urbanneighbourhoods.ca/email-newsletter-archive
(right now it’s set to “generate_before_main_content”) – generate_after_entry_title, which would be logical, doesn’t work at all.
This is the javascript, btw – with the CSS MailChimp provides – which I’ve tried removing as well, not that it makes a lick of difference:
<style type="text/css"> <!-- .display_archive {font-family: arial,verdana; font-size: 12px;} .campaign {line-height: 125%; margin: 5px;} //--> </style> <script language="javascript" src="//urbanneighbourhoods.us2.list-manage.com/generate-js/?u=53ad86069261bac353c05b3ab&fid=45896&show=15" type="text/javascript"></script>May 10, 2021 at 6:15 pm #1773398Leo
StaffCustomer SupportHi there,
Have you checked with their support team first?
Does MailChimp provide some sort of instruction on how to use this code?
May 10, 2021 at 6:27 pm #1773405paddyd
Hi Leo,
Here’s the page with the instructions – it looks so simple. Haha.
https://mailchimp.com/help/add-an-email-campaign-archive-to-your-website/
And the client has a free MC plan – so no support. Only the documentation, such as it is. I’ve been looking for further info, but not finding much.
Even tried the Code Embed plugin – nope. Nothing whatsoever shows up on the page.
May 10, 2021 at 7:09 pm #1773416Leo
StaffCustomer SupportI read through the instruction and there doesn’t seem to be anything theme-specific.
It does mention that it may take up to 48 hours for your latest campaign to appear in your campaign archive though so maybe that’s the issue?
The code should work in a hook or HTML block from what I can tell.
Unfortunately I don’t think I can provide more help on this.
May 10, 2021 at 7:24 pm #1773435paddyd
No – the issue is definitely not the last campaign not showing up (there has been nothing new for several days) – the campaigns listed BELOW the footer are indeed the ones that should be there.
I’ve copied it into an HTML block – it shows up exactly as expected if you click on “preview” – but when you save the page and go look at it in a web browser? Nada. And yes – caches have been purged, every time.
….and…the culprit is Litespeed cache. I suspect that something it was doing with the Javascript caching did this. DANG. Spent hours trying to make this work. But when I typed “caches have been purged…” the lightbulb went off. It’s NOT just the caches. Sigh. Ok…now to figure out which particular setting did it.
Will update when I’ve figured it out – might prove useful for anyone else using LS caching on a Litespeed server.
May 10, 2021 at 7:34 pm #1773445paddyd
Update: JS Minify and JS Combine can be on, but “JS Combine External and Inline” will clobber the JS.
Ironically, it says “Include external JS and inline JS in combined file when JS Combine is also enabled. This option helps maintain the priorities of JS execution, which should minimize potential errors caused by JS Combine.”
Um…no, it CAUSES errors. :p
So off it stays. The embedded HTML works just fine, btw. The elements hook is working too – but would take more styling etc. – the HTML one is easy-peasy. Like it’s supposed to be. 🙂
May 10, 2021 at 8:00 pm #1773457Leo
StaffCustomer SupportGlad to hear!
-
AuthorPosts
- You must be logged in to reply to this topic.