# Regarding the blog function.

**URL:** <https://community.hubspot.com/t/regarding-the-blog-function/77800>\
**Category:** CMS Development\
**Tags:** free\
**Created:** [March 23, 2023, 7:38am UTC](https://community.hubspot.com/t/regarding-the-blog-function/77800 "2023-03-23T07:38:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![goku](https://avatars.discourse-cdn.com/v4/letter/g/f08c70/32.png) [@goku](https://community.hubspot.com/u/goku)\
**Post date:** [March 23, 2023, 7:38am UTC](https://community.hubspot.com/t/regarding-the-blog-function/77800/1 "2023-03-23T07:38:20Z")

</div>

Regarding the blog function, is it possible to retrieve only articles that have been multilingualized?

---

<div class="post-metadata">

**Author:** ![goku](https://avatars.discourse-cdn.com/v4/letter/g/f08c70/32.png) [@goku](https://community.hubspot.com/u/goku)\
**Post date:** [March 23, 2023, 7:41am UTC](https://community.hubspot.com/t/regarding-the-blog-function/77800/2 "2023-03-23T07:41:38Z")

</div>

```lia-code-sample
for example.

{% if languages_count > 1 %}
 {% ... %}
{% endif %}

```

---

<div class="post-metadata">

**Author:** ![piersg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/piersg/32/99782_2.png) [@piersg](https://community.hubspot.com/u/piersg)\
**Post date:** [March 23, 2023, 9:55am UTC](https://community.hubspot.com/t/regarding-the-blog-function/77800/3 "2023-03-23T09:55:48Z")

</div>

This will work. It depends if you want to return the primary language version of the blogs that have mutli-language variations, or return the multi-language variations themselves.

```lia-code-sample
{# return primary language version of blogs which have translations #}
{% for content in contents %}
 {% if content.translated_content|length %}
 {{content.name}}
 {% endif %}
{% endfor %}

{# return translations of blogs that have them #}
{% for content in contents %}
 {% if content.translated_content|length %}
 {% for item in content.translated_content %}
 {{item.name}}
 {% endfor %}
 {% endif %}
{% endfor %}

```

I would also recommend adding a check for published, which would be

```lia-code-sample
{% if content_by_id(item.id).current_state == 'PUBLISHED' %}

{% endif %}

```

---

<div class="post-metadata">

**Author:** ![goku](https://avatars.discourse-cdn.com/v4/letter/g/f08c70/32.png) [@goku](https://community.hubspot.com/u/goku)\
**Post date:** [March 23, 2023, 1:10pm UTC](https://community.hubspot.com/t/regarding-the-blog-function/77800/4 "2023-03-23T13:10:19Z")

</div>

Thank you very much! It was helpful.
