CMS Development

Anonymous
Non applicable

RSS feed and HubL

Résolue

Does anybody know the corred script/format is to use an RSS blog listing in an email?

 

In the code I have " {% rss_listing "rss_listing" %} " but it renders strangely in the email (I can't change the width, font colour etc). Does anyone know how I can format this? I feel like it should be like html coding, but my trial and error isn't working.

1 Solution acceptée
Gonzalo
Solution
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

RSS feed and HubL

Résolue

Hi!

Thanks @roisinkirby :).

I haven't worked too much with emails but I can imagine that you can't edit the HTML output from the RSS module. You can add custom CSS to improve the design but this isn't the best way because a lot of email readers (gmail for example) don't use classes, just inline-style.

 

So my advice is to use HubL functions (instead of modules) to manage the HTML output and the CSS at the same time. For example:

{% set posts = blog_recent_posts('default', 5) %}
<table style="width:100%;border:1px solid;padding:2rem;background:#c1c1c1;color:#666;"> {% for post in posts %} <tr>
<h2><a href="{{post.absolute_url}}" style="font-size:1.5rem;color:#666">
{{ post.name }}</a><h2>
<div>{{post.summary}}</div>
</tr>
{% endfor %}
</table>
 

 More documentation here.

You can insert this directly in the content block, but usually I like to have everything ordered so you can add a HubL block to your template and customize your code there 😉

 


I hope this could help you! 🙂

Regards,
Gonzalo

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting

Voir la solution dans l'envoi d'origine

6 Réponses
roisinkirby
Équipe de développement de HubSpot
Équipe de développement de HubSpot

RSS feed and HubL

Résolue

Hey @Gonzalo is this something you've come across before? I've noticed you've had some great contributions r.e. HubL. I'll also follow up with designers on HubSpot's side @Anonymous 🙂

0 Votes
Gonzalo
Solution
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

RSS feed and HubL

Résolue

Hi!

Thanks @roisinkirby :).

I haven't worked too much with emails but I can imagine that you can't edit the HTML output from the RSS module. You can add custom CSS to improve the design but this isn't the best way because a lot of email readers (gmail for example) don't use classes, just inline-style.

 

So my advice is to use HubL functions (instead of modules) to manage the HTML output and the CSS at the same time. For example:

{% set posts = blog_recent_posts('default', 5) %}
<table style="width:100%;border:1px solid;padding:2rem;background:#c1c1c1;color:#666;"> {% for post in posts %} <tr>
<h2><a href="{{post.absolute_url}}" style="font-size:1.5rem;color:#666">
{{ post.name }}</a><h2>
<div>{{post.summary}}</div>
</tr>
{% endfor %}
</table>
 

 More documentation here.

You can insert this directly in the content block, but usually I like to have everything ordered so you can add a HubL block to your template and customize your code there 😉

 


I hope this could help you! 🙂

Regards,
Gonzalo

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting
KeithMon
Membre

RSS feed and HubL

Résolue

Hi @Gonzalo,

 

I'm also trying to do this but I'm not getting it to work. Like aoifemoon, I also tried {% rss_listing "rss_listing" %}. That worked but I was unable to rearrange content how I want it. I'm trying to add an external RSS feed to a custom module so I can place it into a Drag-and-Drop email template.

I've tried blog_recent_posts() using your example and it worked for Hubspot blogs but I have an external RSS feed. Do you know if this function works with external RSS feeds?

Thanks!

0 Votes
Gonzalo
Contributeur de premier rang | Partenaire solutions Diamond
Contributeur de premier rang | Partenaire solutions Diamond

RSS feed and HubL

Résolue

Hey @KeithMon,
I don't think blog_recent_posts works with external blogs (just hubspot hosted).


So the only solution I have find out and we use for our clients is use the default RSS function, and customize the external RSS with the right marktup that you want to us (because I don't think you can edit the RSS marktup content within HubL).

 

In my case, we have setup in our server a service where we have some posibilities to customize the RSS in may ways, then it output the right marktup for the HS RSS reader. But of course is a premium service to offer to the clients, and not all of them want it.

If this answer helps you to solve your questions please mark it as a solution.

Thank you,


Gonzalo Torreras

HubSpot freelance developer

hola@gonzalotorreras.com
www.gonzalotorreras.com
Schedule a meeting
KeithMon
Membre

RSS feed and HubL

Résolue

That's what I was afraid of. Thanks for the info. 

0 Votes
Anonymous
Non applicable

RSS feed and HubL

Résolue

Super helpful for my colleague - thank you @Gonzalo. You've had some great insights on this forum 🙂