Featured Blogs
Three featured blog posts, to provide useful info related to your product range. Each blog contains a summary of the actual content, allowing the user to decide whether they want to click to read the full article.
Wireframe
Preparation Checklist
Before you start this tweak, it's a good idea to run through our preparation checklist below:
- Read through the Getting Started to get a better sense of how the Control Panel, Database and Front End store interact.
- Learn our recommended Simple Workflow. This makes the implementation process as easy as possible.
- Create a new Staging Theme for this tweak. This allows you to preview any changes before they are visible to live customers.
- The code snippet in this tweak doc uses Bootstrap 4, you may need to alter this code depending on what version of Bootstrap your theme is using. You can find out what version your theme is using here.
Coding Instructions
Step 1: Open the home page template
The homepage template can be found here /httpdocs/assets/themes/[THEME-NAME]/templates/cms/home.template.html
.
Step 2: Add the code into template
Paste the following code into the template where you would like the element to appear.
<!-- Featured Blog Posts -->
[%thumb_list type:'content' content_type:'blog' limit:'3' sortby:'date_posted-desc'%]
[%param *header%]
<section class="row my-3 text-center" aria-label="Our Blog">
<div class="col-12">
<h2 class="text-center">Our Blog</h2>
<div class="row">
[%/param%]
[%param *body%]
<article class="col-12 col-lg-4">
<a href="[@URL@]"><img src="[%ASSET_URL type:'content' id:'[@content_id@]'%][%param default%][%cdn_asset html:'0' library:'images'%]default_product.gif[%/cdn_asset%][%/param%][%/ASSET_URL%]" alt="[@content_name@]" class="img-fluid"/></a>
<h4><a href="[@URL@]" itemprop="url">[@content_name@]</a></h4>
[%if [@content_short_description1@]%]
<p>[%format type:'text' rmhtml:'1' truemaxlength:'210'%][@content_short_description1@][%/format%]</p>
[%else%]
<p>[%format type:'text' rmhtml:'1' truemaxlength:'210'%][@content_description1@][%/format%]</p>
[%/if%]
<a href="[@URL@]" class="btn btn-default btn-block">Read Full Post</a>
</article>
[%/param%]
[%param *footer%]
</div>
</div>
</section>
[%/param%]
[%/thumb_list%]
If your blog posts have a parent (eg. the blog posts are children of the "Our Blog" parent page). Add the parameter filter_category:'72'
to the thumb_list
function to skip over the parent "our blog" page and only show child posts based on the date posted.
Eg. [%thumb_list type:'content' content_type:'blog' limit:'3' sortby:'date_posted-desc' filter_category:'72'%]
.
Final Result
Customising this Section
More information on how to customise this section can be found within the Thumb List Documentation.