PHP Class Yosymfony\Spress\Core\ContentManager\Generator\Taxonomy\TaxonomyGenerator
This generator uses PaginationGenerator for generating
multiples pages for each term. This means that
PaginationGenerator's attributes are available with
TaxonomyGenerator.
Example of URLs generated:
categories/news
categories/news/page2
...
This generator adds an attribute "terms_url" to each
items processed with the permalinks of the terms. The patter
follows is $attributes['terms_url'][$taxonomy_attribute][$term].
e.g: for "categories" as taxonomy_attribute and "news" as term
$attributes['terms_url']['categories']['news']
Notice that terms are normalized to lower case and then they are sluged. That means
certain words from cyrillic languages for example, could point
to the same normalized term. e.g: "bash", "баш" are pointing to "bash" term.
How to configure? (Front matter block of the template page):
---
layout: 'default'
generator: 'taxonomy'
max_page: 5
taxonomy_attribute: 'categories'
permalink: '/:name'
pagination_permalink: '/page:num'
---
Show file
Open project: spress/spress
Public Methods
Method |
Description |
|
generateItems ( Yosymfony\Spress\Core\DataSource\ItemInterface $templateItem, array $collections ) |
|
|
Protected Methods
Method Details
generateItems()
public method
public generateItems ( Yosymfony\Spress\Core\DataSource\ItemInterface $templateItem, array $collections ) |
$templateItem |
Yosymfony\Spress\Core\DataSource\ItemInterface |
|
$collections |
array |
|
getAttributesResolver()
protected method
protected getAttributesResolver ( Yosymfony\Spress\Core\DataSource\ItemInterface $templateItem ) |
$templateItem |
Yosymfony\Spress\Core\DataSource\ItemInterface |
|
getTermPermalink()
protected method
getTermRelativePath()
protected method
normalizeTerm()
protected method
setTermsPermalink()
protected method