CMS Development

jmarcello
Participant

Check Blog Listing Page Index

How do I check which blog listing page I am on...

For instance:

 

 

if blog listing page > 1 then do something

else do something different

 

Any help is greatly appreciated.


 

0 Upvotes
5 Replies 5
tjoyce
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Check Blog Listing Page Index

@jmarcello - I think it's something like:

if current_page_num > 1

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
jmarcello
Participant

Check Blog Listing Page Index

Tim:

 

Thank you very much, it's a great start...

To extend that further, how might I write this...

{% if current_page_num > 1 AND < 5 %}
do something
{% endif %}


I am trying to learn how to use AND and OR commands to check multiple values.

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

Check Blog Listing Page Index

{% if current_page_num > 1 and current_page_num < 5 %}
do something
{% endif %}

try that

0 Upvotes
jmarcello
Participant

Check Blog Listing Page Index

How about this one...with an OR statement:

{% if current_page_num > 1 or current_page_num > 2 %}
do something
{% endif %}
0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Check Blog Listing Page Index

hi @jmarcello, looks like you have the hang of it. 

this link may be a good resource

0 Upvotes