Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Render tags before pages. #28

Open
madc opened this issue Oct 29, 2014 · 0 comments
Open

Render tags before pages. #28

madc opened this issue Oct 29, 2014 · 0 comments

Comments

@madc
Copy link

madc commented Oct 29, 2014

I tried to replace the main navigation with a list of tags, but it looks like, the tag-list pages are rendered after the pages. Therefor it is not possible to render a tag list using carew.tags and path ind the default template. This results in the following error:

An exception has been thrown during the rendering of a template ("The document with path "tags/Interactive" does not exist.") in "default.html.twig" at line 40.

As a workaround i ended up using this:

{% for tag, items in carew.tags %}
<li><a {% if carew.currentPath == "tags/" ~ tag|lower ~ ".html" %}class="active" {% endif %}href="{{ carew.site.url_absolute }}tags/{{ tag }}.html">{{ tag }}</a></li>
{% endfor %}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant