Skip to content

getBlogCategory(int category_id)

The getBlogCategory method is used to get a BlogCategory object that represents blog category available in the storefront.

Input parameters

category_id

int Numeric identifier of the blog category.

Returned value

The BlogCategory object.

Example

source
{% set blogCategory = ObjectApi.getBlogCategory(category_id) %}

<a href="{{ blogCategory.url }}" title="{{ blogCategory.name}}">
    {{ blogCategory.name }}
</a>
output
<a href="/en/n/category/upcoming-event/1" title="Upcoming event">
    Upcoming event
</a>