We're happy to announce that blogging functionality is now available for Instantcart. With a few simple changes to your template, you can add Wordpress style blogging entries to your store, with dedicated articles.
To find out what changes you need to make, read further..
To use blogging functionality within your webstore, you need to make sure you have the correct support within your chosen template.
To add support, follow the instructions below.
If you want to display a list of article tiles, with links to each article, you can do so as follows.
To add functionality as shown below in the visual, simply amend the html and twig markup you have in your content/news.template.html file to that shown in the coding example below. Once you have amended your code, you can then add some sample blogging articles, and an associated image for each article.
{% set holdingImage = '/images/blog_images/blog_P2L8mF3jo2_iphone-624709_1920.jpg' %}
{% for article in news %}
{% if loop.index == 1 %}
<div class="col-sm-12">
<a href="{{ article.url }}" title="{{ article.title }}">
<img src="{% if article.image %}{{ article.image }}{% else %}{{ holdingImage }}{% endif %}" alt="{{ article.title }}" class="img-responsive" />
</a>
<span class="text-lg">
<a href="{{ article.url }}" title="{{ article.title }}">
{{ article.title }}
</a>
</span>
<span class="text-sm" style="color:#999"><br>by {{ article.author.name }} >> {{ article.date.created|date("l jS M Y") }}</span>
<div class="divider-clear-20px"></div>
</div>
{% else %}
<div class="col-sm-6">
<div style="text-align:center" >
<a href="{{ article.url }}" title="{{ article.title }}">
<img style="max-height:300px; width:100%;" src="{% if article.image %}{{ article.image }}{% else %}{{ holdingImage }}{% endif %}" alt="{{ article.title }}" class="img-responsive" />
</a>
</div>
<span class="text-lg">
<a href="{{ article.url }}" title="{{ article.title }}">
{{ article.title }}
</a>
</span>
<span class="text-sm" style="color:#999"><br>by {{ article.author.name }} >> {{ article.date.created|date("l jS M Y") }}</span>
<div class="divider-clear-15px"></div>
</div>
{% endif %}
{% endfor %}