Skip to content

getBlogTag(int tag_id)

The getBlogTag method is used to get a BlogTag object that represents blog tag available in the storefront.

Input parameters

tag_id

int Numeric identifier of the blog tag.

Returned value

The BlogTag object. If the tag_id is incorrect, the returned value is null.

Example

source
{% set blogTag = ObjectApi.getBlogTag(tag_id) %}

<a href="{{ blogTag.url }}" title="{{ blogTag.name}}">
    {{ blogTag.name }}
</a>
output
<a href="/en/n/tag/shoes" title="Shoes">
    Shoes
</a>