diff --git a/api/extensions/hooks/README.md b/api/extensions/hooks/README.md index 495ada62e..13eece5f3 100644 --- a/api/extensions/hooks/README.md +++ b/api/extensions/hooks/README.md @@ -61,8 +61,8 @@ custom functionality to the core. - [loadFormField](loadFormField.md) - [loadLanguageFile](loadLanguageFile.md) - [modifyFrontendPage](modifyFrontendPage.md) -- newsListCountItems -- newsListFetchItems +- [newsListCountItems](newsListCountItems.md) +- [newsListFetchItems](newsListFetchItems.md) - [outputBackendTemplate](outputBackendTemplate.md) - [outputFrontendTemplate](outputFrontendTemplate.md) - [parseArticles](parseArticles.md) diff --git a/api/extensions/hooks/newsListCountItems.md b/api/extensions/hooks/newsListCountItems.md new file mode 100644 index 000000000..832adc2e9 --- /dev/null +++ b/api/extensions/hooks/newsListCountItems.md @@ -0,0 +1,52 @@ +# newsListCountItems + +The `newsListCountItems` hook is triggered when the number of news items is +needed (before fetching a news list). + +> #### primary:: Available +> from Contao 3.5.0. + + +## Parameters + +1. *array* `$newsArchives` + + An array containing news archives IDs. + +2. *boolean* `$blnFeatured` + + A boolean that indicates if the news list must display featured news. + Possible values are: + - `null` (display all news) + - `true` (display only featured news) + - `false` (display all news that are not featured) + + +## Example + +```php + #### primary:: Available +> from Contao 3.5.0. + + +## Parameters + +1. *array* `$newsArchives` + + An array containing news archives IDs. + +2. *boolean* `$blnFeatured` + + A boolean that indicates if the news list must display featured news. + Possible values are: + - `null` (display all news) + - `true` (display only featured news) + - `false` (display all news that are not featured) + +3. *int* `$limit` + + Number of items that should be displayed. + +4. *int* `$offset` + + Offset of items to skip. + +5. *ModuleNewsList* `$newsListModule` + + The news list module that was used to fetch items. + + +## Example + +```php +