Skip to content

BlogCategory

The BlogCategory object represents a single blog category in the storefront.

classDiagram
  direction LR
  BlogCategory --> BlogArticlesList
  BlogCategory --> BlogCategoryUrl
  BlogArticlesList "1" --o "*" BlogArticle
  class BlogArticle{
  }
  class BlogArticlesList{
  }
  class BlogCategoryUrl{
  }
  class BlogCategory{
    int id
    string name
    BlogCategoryUrl url
    BlogArticlesList articles
  }

Properties

Attribute name Type Description
id int The unique identifier of the blog category
name string The title of the blog category
url BlogCategoryUrl The BlogCategoryUrl object that represents the url to the blog category.
articles BlogArticlesList Reference to the BlogArticlesList object that represents the articles list of BlogArticle objects associated with this category.

Examples

id property

{{ blogCategory.id }}
1

name property

{{ blogCategory.name }}
example name

url property

{{ blogCategory.url }}
/en/n/category/upcoming-event/1

articles property

{% for article in blogCategory.articles %}
    <h3>{{ article.name }}</h3>
    <a href="{{ article.url }}" title="{{ article.title }}">Read more</a>
    <br>
{% endfor %}
<h3>Our laboratory test</h3>
<a href="/en/n/1" title="Laboratory">Read more</a>
<br>
<h3>New brand campaing</h3>
<a href="/en/n/2 title="Campaing">Read more</a>
<br>