Simple snippets

This section contains snippets making EXT:news more awesome which might be useful for your projects as well.

Render category rootline

If you want to show not only the title of a single category which is related to the news item but the complete category rootline use this snippets.

<f:if condition="{category:newsItem.firstCategory}">
        <ul class="category-breadcrumb">
                <f:render section="categoryBreadcrumb" arguments="{category:newsItem.firstCategory}" />
        </ul>
</f:if>

and

<f:section name="categoryBreadcrumb">
        <f:if condition="{category}">
                <f:if condition="{category.parentCategory}">
                        <f:render section="categoryBreadcrumb" arguments="{category:category.parentCategory}" />
                </f:if>
                <li>{category.title}</li>
        </f:if>
</f:section>

Use current content element in the Template

If you ever need information from the content element itself, you can use {contentObjectData.header}.