I have pagination twig component that needs to inject seo links into of page (rel canonical).
I tried to use {% block %}
twig tag for this, but problem is that pagination component is already included in another {% block %}
tag containing main content of page.
In short, im trying to do this:
layout.twig:
<html>
<head>
{% block seo %}{% endblock %}
</head>
<body>
{% block main %}{% endblock %}
</body>
</html>
page.twig:
{% extends 'layout.twig' %}
{% block main %}
some content..
{% include 'pagination.twig' %}
{% endblock %}
pagination.twig:
... pagination links
{% block seo %}
<link href="url" rel="canonical">
{% endblock %}
When im using this code, block seo is empty. Can this be achived some other way?