Adds a new page doktype for news.
This extension provides a new doktype to be used for news that need to have flexible content, e.g.
The new doktype that is registered is
This extension registers 3 Plugins:
- this plugin shows a list of all news, optionally filtered by a value selected in the plugin, and optionally a frontend filter can be displayed
This plugin comes with a couple of filters pre-shipped:
- Category: both as a backend filter and front end filter
- Categories: a front end filter that allows multiple categories to be selected
- this filter combines the selected categories using an or operation
- Date: a front end filter that filters by year and month
If you want to create your own filters, you can register them in your
ext_localconf.php with the following call
<?php B13\Newspage\Service\FilterService::registerFilter( 'Filter Name', // this name will be used to call the filter internally \Vendor\Ext\Filter\ExampleFilter::class, 'LLL:EXT:vendor/ext/Private/Language/newspage.xlf:filter.name', // label to use for the plugin and frontend filter 'EXT:site_tecselect/Configuration/FlexForms/Newspage/Filter/Partner.xml' // optional flexform definition for a backend filter );
Your class should implement the
B13\Newspage\Filter\FilterInterface and therefore implement the functions
getItems() is used to get all possible values for the filter (both for the plugin settings, as well as the frontend filter).
getQueryContraint() is used to add the filtering restriction to the query in the
list plugin. This function can also return
For an example take a look at the two filters provided by this extension.
If you want to enable the backend plugin filter, you should provide a FlexForm definition that selects the data to filter by. This file then needs to be passed as the fourth argument when registering the filter.
The created field is automatically passed as
settings.prefilters.name with the name you registered it with.
For an example take a look at
At b13 we often use additional page types (doktype) for categories, overview pages, and tags. This extension adds a number of assets ready to use for your own custom doktypes:
tx_newspage_domain_model_categoryshould be replaced by
sys_categoryas there is no real value from creating a new model for a problem that is already solved within TYPO3
- make recent plugin more filterable (use added filters from list ?)