CMS Development

ingramleedy
Contributeur

Custom Blog Post Template - Optimize Word Count Incorrect

Résolue

Hi.  I am working on a customzied blog template that inserts CTAs automatically in blog content.  It's based loosely on another post here, 

 

https://community.hubspot.com/t5/CMS-Development/HubL-coding-in-a-blog-template-to-insert-a-line-of-...

 

It works great!  However, when I edit the post and go to the optimize page it shows that the Word count of whats in the Title vs what is in the content.post_body.   When I render the new content out, render out what in in content.post_body, but when I encounter a paragraph break I insert CTA code after so many paragraphs.  

On a side note, it seems that this would be a good feature for Hubspot to have some kind of management system for blog posts, as I dont want to go thru all my blog posts and change out custom inserted CTAs.  This was an easy way to add them across all assets if I am running an offer or something.    

I dont know if I am missing some kinda of tag or ID that the optimize is using.  The variabe content.post_body contains all the content it should be counting.  


Any feedback is welcomed.   Am I missing something?

-Ingram

0 Votes
1 Solution acceptée
ingramleedy
Solution
Contributeur

Custom Blog Post Template - Optimize Word Count Incorrect

Résolue

Solved.

 

Looks like the blog posts have to be wrapped in this class to be counted correctly.

 

<div class="blog-post-wrapper cell-wrapper">

Voir la solution dans l'envoi d'origine

0 Votes
2 Réponses
ingramleedy
Solution
Contributeur

Custom Blog Post Template - Optimize Word Count Incorrect

Résolue

Solved.

 

Looks like the blog posts have to be wrapped in this class to be counted correctly.

 

<div class="blog-post-wrapper cell-wrapper">

0 Votes
jennysowyrda
Gestionnaire de communauté
Gestionnaire de communauté

Custom Blog Post Template - Optimize Word Count Incorrect

Résolue

Thank you for sharing your solution @ingramleedy!

0 Votes