Skip to content

getBlogArticles(int items_per_page, int page)

The getBlogArticles method is used to get the BlogArticlesList object that represents a list of all blog articles in the storefront. Method results depends on the context of current page. Pages where this context method can be used are:

  • Blog home page
  • List of entries from a category
  • List of entries with a tag

Input parameters

items_per_page

int Number of items on a page of internal paginator. Parameter is optional. Default value is 20.

page

int Page number of internal paginator. Parameter is optional. Default value is null. If page is null it is based on the page parameter in the URL.

Returned value

The BlogArticlesList object.

Example

source
{% set articles = ObjectApi.getBlogArticles() %}
{% for article in articles %}
    <p>{{ blogArticle.shortContent }} - {{ blogArticle.author }}</p> (Posted on: {{ blogArticle.createdAt }})
    <br>
{% endfor %}
output
    Weekend Shot Sales, read more about it! - Katerine (Posted on: 10-01-2023) 
    Checkout our new Coffe series - Mandy (Posted on: 25-03-2023)