I'm getting related (tagged) news articles like this:
<property name="related" type="smart_content">
<!-- @see https://docs.sulu.io/en/2.2/reference/content-types/smart_content.html -->
<meta>
<title lang="en">Related content</title>
<title lang="de">Verwandte Inhalte </title>
</meta>
<params>
<param name="provider" value="articles"/>
<param name="types" value="news"/>
<param name="max_per_page" value="3"/>
</params>
</property>
It's like 3 articles of type "news". And in filter options (back-end) I set that those articles must be tagged with some specific tag(s).
From page twig template I can print those tags like:
{% for related in content.related %}
{% for tag in related.content.excerpt.tags %}
{{ tag.name }} ({{ tag.id }})
{% endfor %}
<a href="{{ related.routePath }}">{{ related.title }}</a>
{% endfor %}
Best I could achieve is getting tag name and id. How to get tag url? If I try something like:
{{ sulu_tag_url(tag) }}
I get "Cannot use object of type Sulu\Bundle\ArticleBundle\Document\TagViewObject as array". Can I somehow use tag id to get it's url?