Hi I would like to combine two blogs that we have into a single list which displays the most recent first. I would like to set how many are displayed and have pagination similar to what is currently there. The two blogs are currently being controlled via the Settings > website > blogs options in Hubspot as this allows me to control how many are shown etc…
The two blog pages that currently exist are 360insights Ecosystem Orchestration and 360insights Ecosystem Orchestration would like them both two appear under a single url https://www.webinfinity.com/blog.
I would then like the option to filter with a dropdown between the blogs and news.
I’m hoping that it will be easy enough to also change what is shown in the rightbar so that both blogs are included.
Thank you in advance for any help.
The code for the main listing is:
<div class="blog-section">
<div class="blog-listing-wrapper cell-wrapper">
{# simple_list_page indicates the "blog/all" page, which is a list of links to every blog post #}
<div class="post-listing{% if simple_list_page %}-simple{% endif %}">
{% if blog_author %}
<div class="hs-author-profile">
<h2 class="hs-author-name">{{ blog_author.display_name }}</h2>
{% if blog_author.avatar %} <div class="hs-author-avatar"> <img width="35 px" src="{{ blog_author.avatar }}" loading="lazy" alt="{{ blog_author.display_name }}"> </div> {% endif %}
<div class="hs-author-bio">{{ blog_author.bio }}</div>
{% if blog_author.has_social_profiles %}
<div class="hs-author-social-section">
<span class="hs-author-social-label">Find me on:</span>
<div class="hs-author-social-links">
{% if blog_author.facebook %}
<a href="{{ blog_author.facebook }}" target="_blank" class="hs-author-social-link hs-social-facebook fa fa-facebook"><span class="hs-screen-reader-text">Facebook</span></a>
{% endif %}
{% if blog_author.linkedin %}
<a href="{{ blog_author.linkedin }}" target="_blank" class="hs-author-social-link hs-social-linkedin fa fa-linkedin-square"><span class="hs-screen-reader-text">Linkedin</span></a>
{% endif %}
{% if blog_author.twitter %}
<a href="{{ blog_author.twitter }}" target="_blank" class="hs-author-social-link hs-social-twitter fa fa-twitter-square"><span class="hs-screen-reader-text">Twitter</span></a>
{% endif %}
{% if blog_author.google_plus %}
<a href="{{ blog_author.google_plus }}?rel=author" target="_blank" class="hs-author-social-link hs-social-google-plus fa fa-google-plus-square"><span class="hs-screen-reader-text">Google Plus</span></a>
{% endif %}
</div>
</div>
{% endif %}
</div>
<br />
<h2 class="hs-author-listing-header">Recent Posts</h2>
{% endif %}
{% for content in contents %}
<div class="post-item">
{% if not simple_list_page %}
{% if content.post_list_summary_featured_image %}
<div class="hs-featured-image-wrapper">
<a href="{{content.absolute_url}}" title="" class="hs-featured-image-link">
<img src="{{ content.post_list_summary_featured_image }}" loading="lazy" class="hs-featured-image" alt="{{ content.featured_image_alt_text }}">
</a>
</div>
{% endif %}
<div class="post-header clearfix">
<h2><a href="{{content.absolute_url}}">{{ content.name }}</a></h2>
<p id="hubspot-author_data" class="hubspot-editable" data-hubspot-form-id="author_data" data-hubspot-name="Blog Author"><span class="fa fa-calendar"></span>
{{ content.publish_date_localized }} / by
{%if content.blog_post_author %}
<a class="author-link" href="{{ group.absolute_url }}/author/{{ content.blog_post_author.slug }}">{{ content.blog_post_author.display_name }}</a>
{% endif %}
{% if content.topic_list %}
posted in
{% for topic in content.topic_list %}
<a class="topic-link" href="{{ group.absolute_url }}/topic/{{ topic.slug }}">{{ topic.name }}</a>{% if not loop.last %},{% endif %}
{% endfor %}
{% endif %}
<!--comments-->
<span class="custom_listing_comments"><span class="fa fa-comment"></span>
<a href="{{content.absolute_url}}#comments-listing">
{% set comments_number = content.comment_list|length %}
{% if comments_number == 1 %}
{% set comments_label = "Comment" %}
{% else %}
{% set comments_label = "Comments" %}
{% endif %}
{{ comments_number }} {{ comments_label }}</a>
</span>
</p>
</div>
<div class="post-body clearfix">
<!--post summary-->
{{ content.post_list_content|safe }}
</div>
<a class="more-link" href="{{ content.absolute_url }}">Read More </a><a class="fa fa-chevron-right" href="{{ content.absolute_url }}"></a>
<hr >
{% else %}
<h2 class="post-listing-simple"><a href="{{content.absolute_url}}">{{ content.name }}</a></h2>
{% endif %}
</div>
{% endfor %}
</div>
<!--Blog-Pagination-->
{% if not simple_list_page %}
<div class="blog-pagination">
{% set page_list = [-2, -1, 0, 1, 2] %}
{% if contents.total_page_count - current_page_num == 1 %}{% set offset = -1 %}
{% elif contents.total_page_count - current_page_num == 0 %}{% set offset = -2 %}
{% elif current_page_num == 2 %}{% set offset = 1 %}
{% elif current_page_num == 1 %}{% set offset = 2 %}
{% else %}{% set offset = 0 %}{% endif %}
<div class="blog-pagination-left">
{% if last_page_num %}<a class="prev-link" href="{{ group.absolute_url }}"><i class="fa fa-angle-double-left"></i></a>{% endif %}
{% if contents.total_page_count > 5 %}
{% if current_page_num >= 4 %}
<a href="{{ group.absolute_url }}" >1</a>
<a class="elipses" href="{% if current_page_num <= 5 %}{{ group.absolute_url }}{% else %}{{ blog_page_link(current_page_num - 5) }}{% endif %}">...</a>
{% endif %}
{% endif %}
</div>
<div class="blog-pagination-center">
{% for page in page_list %}
{% set this_page = current_page_num + page + offset %}
{% if this_page > 0 and this_page <= contents.total_page_count %}
{% if this_page == 1 %}
<a {% if this_page == current_page_num %}class="active"{% endif %} href="{{ group.absolute_url }}">{{ this_page }}</a>
{% else %}
<a {% if this_page == current_page_num %}class="active"{% endif %} href="{{ blog_page_link(this_page) }}">{{ this_page }}</a>
{% endif %}
{% endif %}
{% endfor %}
</div>
<div class="blog-pagination-right">
{% if contents.total_page_count > 5 %}
{% if contents.total_page_count - current_page_num > 2 %}
<a class="elipses" href="{% if contents.total_page_count - current_page_num <= 5 %}{{ contents.total_page_count }}{% else %}{{ blog_page_link(current_page_num + 5) }}{% endif %}">...</a>
<a href="{{ blog_page_link(contents.total_page_count) }}">{{ contents.total_page_count }}</a>
{% endif %}
{% endif %}
{% if next_page_num %}<a class="next-link" href="{{ blog_page_link(current_page_num + 1) }}"><i class="fa fa-angle-double-right"></i></a>{% endif %}
</div>
</div>
{% endif %}
</div>
</div>