Hi, as the title says, I have an issue on our website regarding the related blog posts macro. Until last week everything was going well, but now somehow it inserts a javascript-tag and I do not know, where it comes from.
Background information:
The module I created works this way. I have set up a macro to format the post, like:
This way is nessesary to reuse the layout for other type of content with custom variables (recent blogs, popular blogs, ...) since the post_formatter in the related_blog_posts macro is limited to blog_post, index and count.
Okay. Now I used JavaScript to display the resulting blog-posts not in list-style but in a carousel. Therefore I need to achieve this structure (simplified):
<section class="related-blogs">
<div>Blog Post 01</div>
<div>Blog Post 02</div>
<div>Blog Post 03</div>
</section>
That works well. In the design manager preview I get no error, no bug, it simply works.
But since last week I don't have this structure anymore, though I didn't touch the module. It inserts a script tag like this:
<section class="related-blogs">
<div>Blog Post 01</div>
<div>Blog Post 02</div>
<div>Blog Post 03</div>
<script>fetch(...) ...</script>
</section>
This script tag causes that the carousel does not work anymore. Does anybody know where this script tag could come from? I ran this additional script in the console and got the same related-blogs structure a second time. I would appreciate any help. You can reproduce this issue by having a look into this page: http://systema-4223435.hs-sites.com/en/pillar/test01. I currently made the carousel invisible but you can search in the developer tools for
This is how the content carousel looks like in the design managers module preview. Everything is fine and no additional script-tag is added.
It follows my expected rule:
<div>
<div>related post 1</div>
<div>related post 2</div>
<div>related post 3</div>
...
<div>related post 6</div>
</div>
But on the website I get a script tag inserted right after the last carousel-item, so that it destroys my carousel.
I'm 100% sure it is somehow added by HubSpot, but I don't know how to avoid it.
I built this module for content creators to choose between popular blogs, recent blogs, related blogs (with tags either from the blog post or from custom added tags) and gave them the ability to add in additional custom pages from our website. It's a huge module and worked pretty well, but now I can only use it for popular and recent content, because there I don't get this additional script tag. 90% of our page uses this module for related content... Hope someone can help!
This is how the content carousel looks like in the design managers module preview. Everything is fine and no additional script-tag is added.
It follows my expected rule:
<div>
<div>related post 1</div>
<div>related post 2</div>
<div>related post 3</div>
...
<div>related post 6</div>
</div>
But on the website I get a script tag inserted right after the last carousel-item, so that it destroys my carousel.
I'm 100% sure it is somehow added by HubSpot, but I don't know how to avoid it.
I built this module for content creators to choose between popular blogs, recent blogs, related blogs (with tags either from the blog post or from custom added tags) and gave them the ability to add in additional custom pages from our website. It's a huge module and worked pretty well, but now I can only use it for popular and recent content, because there I don't get this additional script tag. 90% of our page uses this module for related content... Hope someone can help!
I am also running into same issue like yours, just wondering if you find any solution to avoid the additional script tag from the last carousel item. I am using owl carousel plugin but the script tag is messing up my carousel effect in the related blog post list.
I guess this because it looks like the plugin adds classes to the script tag which seems odd.
Yes! The JavaScript-Plugin, that generates my carousel out of this described structure, takes the additional script-tag as item for the carousel. But I was wondering, where this script-tag comes from. Seems like an update of this related_blog_posts-macro, that is adding in this script-tag, since it wasn't there the last couple of month.