CMS Development

gabrielaguido
Member

How to hide the first post in a RSS list... is it possible?

SOLVE

Hi there!

 

I've created a home page using a page template, but need to include a blog post feed displaying the last post as a featured post (larger than the rest), will probably do this manually everytime a new post comes up (unless I find a better way to do this).  I figured I could do this with the RSS listing module but the last post will appear duplicated: featured post and then again at the top of the RSS list.  You've probably already figured this one out, but I can't find a specific answer to my question (or I am probably doing the wrong search).  My knowledge of HubL is very, very limited, but I have been learning a little on the go.

 

Should I include a specific code in the RSS listing module?  This is the module's standard code:

 

{% 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 }}",
title="{{ module.title }}",
limit_to_chars="{{ module.limit_to_chars }}",
attribution_text="{{ module.attribution_text }}",
topic_id="{{ module.topic_id }}"
feed_source="{{ feed_source }}"
%}

 

Thank you in advance for any help!

Gaby

0 Upvotes
1 Accepted solution
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

How to hide the first post in a RSS list... is it possible?

SOLVE

Hey @gabrielaguido 

 

So with the default RSS HubL markup I do not think this is possible. But If you were to use the "blog_recent_posts" function to create a dictionaery of post, you can easily skip the first item in the dictinery when printing it with your choice of contition logic.

 

Reference!

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

View solution in original post

0 Upvotes
1 Reply 1
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

How to hide the first post in a RSS list... is it possible?

SOLVE

Hey @gabrielaguido 

 

So with the default RSS HubL markup I do not think this is possible. But If you were to use the "blog_recent_posts" function to create a dictionaery of post, you can easily skip the first item in the dictinery when printing it with your choice of contition logic.

 

Reference!

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 Upvotes