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' ---
Author: Victor Puertas ([email protected])
Inheritance: implements Yosymfony\Spress\Core\ContentManager\Generator\GeneratorInterface
Mostra file Open project: spress/spress

Public Methods

Method Description
generateItems ( Yosymfony\Spress\Core\DataSource\ItemInterface $templateItem, array $collections )

Protected Methods

Method Description
getAttributesResolver ( Yosymfony\Spress\Core\DataSource\ItemInterface $templateItem )
getTermPermalink ( $TermRelativePath )
getTermRelativePath ( $basePath, $permalinkTemplate, $term )
normalizeTerm ( $term )
setTermsPermalink ( array $items, $taxonomyAttribute, array $terms, $termRelativePath )

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

getTermRelativePath() protected method

protected getTermRelativePath ( $basePath, $permalinkTemplate, $term )

normalizeTerm() protected method

protected normalizeTerm ( $term )