Pagelist
class Pagelist (View source)
A Pagelist object represents a set of Page objects (matching certain criterias).
Properties
private | $collection | The collection of all existing pages. | |
private | $Context | The context. | |
private | $context | In case $type is set to "children", the $context URL can be used as well to change the context from the current page to any page. | |
private | $defaults | The default set of options. | |
private | $excludeCurrent | Defines whether the pagelist excludes the current page or not. | |
private | $excludeHidden | Defines whether the pagelist excludes hidden pages or not. | |
private | $filter | The current filter. | |
private | $limit | Defines the maximum number of pages in the array returned by getPages(). | |
private | $match | Defines a JSON string to be used as paramter for the $Selection->match() method. | |
private | $offset | Defines the offset within the array of pages returned by getPages(). | |
private | $page | The current page of the pagination. | |
private | $search | The search string to filter pages. | |
private | $sort | The sort options string. | |
private | $template | The template to filter by the pagelist. | |
private | $type | The pagelist's type (all pages, children pages or related pages) |
Methods
Set or change the configuration of the pagelist and return the current configuration as array.
Return the default options array.
The final set of Page objects - filtered.
Calculate the number of pages of the pagination.
Return all tags from all pages in $relevant as array.
Collect all pages matching $type (& optional $context), $template & $search (optional).
Details
at line 171
array
config(array $options = array())
Set or change the configuration of the pagelist and return the current configuration as array.
To just get the config, call the method without passing $options.
Options:
- context: an optionally fixed URL for the context of a pagelist of type breadcrumbs or children. In case this parameter is false, within a loop the context always changes dynamically to the current page.
- excludeCurrent: default false
- excludeHidden: default true
- filter: filter pages by tags
- limit: limit the object's array of relevant pages
- match: filter pages by matching one or more key/regex combinations passed as JSON string
- offset: offset the within the array of all relevant pages
- page: false (the current page in the pagination - to be used with the limit parameter)
- search: filter pages by search string
- sort: sorting options string, like "date desc, title asc"
- template: include only pages matching that template
- type: sets the type of pagelist (default is false) - valid types are false (all), "children", "related", "siblings" and "breadcrumbs"
at line 193
array
getDefaults()
Return the default options array.
at line 207
array
getPages(bool $ignoreLimit = false)
The final set of Page objects - filtered.
Note that $offset & $limit only reduce the output and not the array of relevant pages! Using the getTags() method will still output all tags, even if pages with such tags are not returned due to the limit. Sorting a pagelist will also sort all pages and therefore the set of returned pages might always be different.
at line 244
number
getPaginationCount()
Calculate the number of pages of the pagination.
at line 257
array
getTags()
Return all tags from all pages in $relevant as array.
at line 278
private array
getRelevant()
Collect all pages matching $type (& optional $context), $template & $search (optional).
The returned pages have to be used to get all relevant tags. It is important, that the pages are not filtered by tag here, because that would also eliminate the non-selected tags itself when filtering.