CMS Development

Anton
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Custom (external) RSS Feed Module

SOLVE

Hi, 

a customer wants to have a custom rss module, which pulls the data from a external RSS Feed(XML) with following options

- show postings with tag "X"

- display "X" amount of postings

and some other options

 

The most simple way would be to clone the HubSpot RSS Feed module and to customize it, right?

I'm struggling with the layout change of the RSS Feed. When I clone the Module and edit it, the only thing I'm seeing is the Hubl code of the module.

{% if module.rss_feed_type == "external" %}
    {% set feed_source = "{is_external=True, rss_url='"~module.rss_url~"', content_group_id=''}" %}
    {% set is_external = true %}
{% elif module.rss_feed_type == "blog" %}
    {% set feed_source = "{is_external=False, content_group_id='" ~ module.content_group_id ~ "', rss_url=''}" %}
    {% set is_external = false %}
{% endif %}

{% rss_listing
    publish_date_text="{{ module.publish_date_text }}",
    rss_url="{{ module.rss_url }}",
    is_external="{{ is_external }}",
    click_through_text="{{ module.click_through_text }}",
    show_date="{{ module.show_date }}",
    content_group_id="{{ module.content_group_id }}",
    include_featured_image="{{ module.include_featured_image }}",
    publish_date_format="{{ module.publish_date_format }}",
    show_detail="{{ module.show_detail }}",
    show_author="{{ module.show_author }}",
    number_of_items="{{ module.number_of_items }}",
    limit_to_chars="{{ module.limit_to_chars }}",
    attribution_text="{{ module.attribution_text }}",
    topic_id="{{ module.topic_id }}"
%}

where is the HTML layout?

 

Is there a way to give the feed a complete custom (HTML) layout?

 

Like three columns. Left *name*, middle *info*, right *read more button*

 

 

regards,

Anton

Anton Bujanowski Signature
0 Upvotes
1 Accepted solution
tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Custom (external) RSS Feed Module

SOLVE

@Anton - This is a hubl tag that pulls the feed from ajax (not server side). So, you will need to use javascript to design the feed and pull the necessary data. Look above the documentation.

"This module is loaded asynchronously on the client-side. As a result, if you want to manipulate the feed after its loaded, you'll need to define a global JS function to handle that manipulation. Use the function hsRssFeedComplete(feeds), where feeds is the jQuery selector on all feeds that have been completed. You will want to directly manipulate the DOM object in that function."

 

I personally, find it easier to just find a decent jquery plugin that is built for RSS feeds since there's more built in functionality around the feed.


If this answer helped, please, mark as solved 😄


tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.

 

Drop by and say Hi to me on slack.

 

View solution in original post

0 Upvotes
3 Replies 3
AAlsalkhadi
Contributor | Platinum Partner
Contributor | Platinum Partner

Custom (external) RSS Feed Module

SOLVE

@suryast, @tjoyce@Anton,  I wonder about that, too. Do you have a solution for this case?

We have a customer, who want the same a the customer of @Anton, but it should me for ab E-Mail-Template, so we are not allowed to use Javascript :-(

I was thinking about storing the RSS feed in HubDB and then using HubL to retrieve the data. What do you think about that?

0 Upvotes
tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Custom (external) RSS Feed Module

SOLVE

@Anton - This is a hubl tag that pulls the feed from ajax (not server side). So, you will need to use javascript to design the feed and pull the necessary data. Look above the documentation.

"This module is loaded asynchronously on the client-side. As a result, if you want to manipulate the feed after its loaded, you'll need to define a global JS function to handle that manipulation. Use the function hsRssFeedComplete(feeds), where feeds is the jQuery selector on all feeds that have been completed. You will want to directly manipulate the DOM object in that function."

 

I personally, find it easier to just find a decent jquery plugin that is built for RSS feeds since there's more built in functionality around the feed.


If this answer helped, please, mark as solved 😄


tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.

 

Drop by and say Hi to me on slack.

 

0 Upvotes
suryast
Participant

Custom (external) RSS Feed Module

SOLVE

I am not sure if this is the right thread to ask. I wonder what solution you would recommend for the styling of RSS feed in an email since emails cannot have javascript in them.