CMS Development

sonicfroots
Member

Multiple Blog Listing Template

SOLVE

Hi all,

 

I have a Hubspot blog listing template with a hero image, featured blog posts, content listing etc. When I click through to the second page of listings via the pagination, I would like the blog listing template to not display the hero image or featured posts, it just displays the listings. Is this possible to do within Hubspot? A second template perhaps? Or would be a case of targeting the 2nd pages somehow and 'hiding' the hero image etc?

 

Thanks,

0 Upvotes
2 Accepted solutions
Phil_Vallender
Solution
Most Valuable Member | Diamond Partner
Most Valuable Member | Diamond Partner

Multiple Blog Listing Template

SOLVE

Hi @sonicfroots 

 

I'm not a developer as such but my understanding of this is that any customisation you want to perform on the different versions of the blog listing template (of which you can only have one per blog) has to be achieved using if/then statements. Hopefully you can trigger this off the page component of the URL, similar to how its been done before based on tag/topic or author. 

 

Hope this helps.

Phil Vallender | HubSpot Website Agency

View solution in original post

0 Upvotes
FabianRichter
Solution
Contributor

Multiple Blog Listing Template

SOLVE

Hi,

as @Phil_Vallender already mentioned, you need to use an if-statement to achieve this. Therefore you need to customize the template. If you used a purchased template, I would recommend to clone it. Then search for the hero element you want to hide on the other pages. You'll get the page number by calling the variable {{ current_page_num }}.

Knowing this, the next step is clear... you need to wrap your hero element inside the following if-statement:

{% if current_page_num > 1 %}
  <your hero element>
{% endif %}

 

Hope I could help you. If this solves your problem, please mark it as solution!
Best,
Fabian

 

View solution in original post

2 Replies 2
FabianRichter
Solution
Contributor

Multiple Blog Listing Template

SOLVE

Hi,

as @Phil_Vallender already mentioned, you need to use an if-statement to achieve this. Therefore you need to customize the template. If you used a purchased template, I would recommend to clone it. Then search for the hero element you want to hide on the other pages. You'll get the page number by calling the variable {{ current_page_num }}.

Knowing this, the next step is clear... you need to wrap your hero element inside the following if-statement:

{% if current_page_num > 1 %}
  <your hero element>
{% endif %}

 

Hope I could help you. If this solves your problem, please mark it as solution!
Best,
Fabian

 

Phil_Vallender
Solution
Most Valuable Member | Diamond Partner
Most Valuable Member | Diamond Partner

Multiple Blog Listing Template

SOLVE

Hi @sonicfroots 

 

I'm not a developer as such but my understanding of this is that any customisation you want to perform on the different versions of the blog listing template (of which you can only have one per blog) has to be achieved using if/then statements. Hopefully you can trigger this off the page component of the URL, similar to how its been done before based on tag/topic or author. 

 

Hope this helps.

Phil Vallender | HubSpot Website Agency
0 Upvotes