Download the PHP package itplusx/flexible-pages without Composer
On this page you can find all versions of the php package itplusx/flexible-pages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download itplusx/flexible-pages
More information about itplusx/flexible-pages
Files in itplusx/flexible-pages
Package flexible-pages
Short Description Supports the setup and management of custom page types.
License MIT
Homepage https://itplusx.de
Informations about the package flexible-pages
TYPO3 Extension flexible_pages
Setup custom page types in TYPO3 with ease.
This extensions reduces the registration of custom page types in TYPO3 to a simple setup using YAML files.
- Features
- Roadmap
- Installation
- Registering custom pages types
- Generic frontend list plugin (tx_flexiblepages_pagelist)
Features
✓ Register custom pages types within seconds
✓ Use custom or already registered icons
✓ Plugin to render menus / lists of pages by page types
Roadmap
- Create an generic icon with the staring letter of the label, if no icons have been registered
- Backend module to configure custom pages types. It's basically a configuration front end for the YAML file
- Enable setting custom position in pages select box
- Enable sorting by date
- Cli command to create page types
- BE Module
- List
- List pages with page type filter
- Bulk edit
- Configuration
- Configure page type in BE
- Provide a nice way to extend custom page types with additional fields
1. Installation
1.1 Installation with composer
composer require itplusx/flexible-pages
1.2 Installation with the TYPO3 Extension Manager
Use the Extension Key flexible_pages
in the TYPO3 Extension Manager.
2. Registering custom pages types
There are two ways to register custom pages types.
- Using YAML configuration files (recommended)
- Using ext_localconf.php
2.1 Using YAML configuration files (recommended)
The easiest way to add new page types is via YAML. Three different possibilities exist to add new pageTypes with YAML files:
- Using the global config directory path (like with the site configuration of the TYPO3 core)
- Using the extension Configuration directory path of your custom extension
- Adding a custom path
2.1.1 Using the global config directory
As with the site configuration of the TYPO3 core it is also possible to add YAML files inside the global config directory.
Example:
2.1.2 Using the extension Configuration directory
It is also possible for every third-party extension to use flexible_pages
as base for adding custom pageTypes. To enable this just add a YAML configuration file to your own extension inside Configuration/Yaml/flexible_pages
.
Example:
2.1.3 Adding a custom path
Beside the first two pre-defined directory paths it is also possible to define a third custom path where your custom YAML files are stored. For this you could simply add the custom path to the extension configuration in Admin Tools -> Settings -> Extension Configuration -> flexible_pages
or set $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['flexible_pages']['additionalYamlConfigPath']
in your ext_localconf.php
.
2.1.4 YAML File Example
2.2 Using ext_localconf.php
2.3 Configuration
2.3.1 Registration parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
dokType | int | ✓ | The dokType to register the new pageType with |
label | string | ✓ | The label of the new pageType |
iconSet | array | ✓ | The iconSet array of the newPageType. (see: iconSet configuration parameters) |
isDraggableInNewPageDragArea | bool | Defines if the new pageType is draggable from above the page tree. (Default: false) |
2.3.2 Icons parameters
Parameter | Type | Mandatory | Description | Possible values |
---|---|---|---|---|
defaultIcon | array | ✓ | The default icon of the page. | - 'source' => '/path/to/file.png' (EXT: is allowed)- 'identifier' => 'already-registered-identifier' |
hideInMenuIcon | array | The icon of the page when "hideInMenu" is checked. | - 'source' => '/path/to/file.png' (EXT: is allowed)- 'identifier' => 'already-registered-identifier' |
|
rootPageIcon | array | The icon of the page when the page is selected as root page. | - 'source' => '/path/to/file.png' (EXT: is allowed)- 'identifier' => 'already-registered-identifier' |
3. Generic frontend list plugin (tx_flexiblepages_pagelist)
flexible_pages provides a generic list plugin to list pages by specific pageTypes. Some settings of this plugin can be configured by the user to make it as flexible as possible:
3.1 Extending templates
Extending the template select field makes it possible to add your own custom Templates. Custom templates can be added either by PageTS or the EXTCONF array.
3.1.1 Extending via PageTS
as associative array:
as numeric array:
3.1.2 Extending via EXTCONF
as associative array:
as numeric array:
3.1.3 Adding custom template file
After extending the template configuration you want to add your custom template file. To do that you have to extend the fluid_styled_content rootPaths. You can either do this in your own extension by extending the lib.contentElement
TypoScript (as described HERE) or you could use the constants provided by flexible_pages:
plugin.tx_flexiblepages.templateRootPath
plugin.tx_flexiblepages.partialRootPath
plugin.tx_flexiblepages.layoutRootPath
Finally you can add your custom template file in the previously specified templateRootPath
.
File naming:
- When you chose to extend the templates with a associative array, your template file has to be named like the key (as upper camelcase; e.g
MyTemplate.html
). - When you chose to extend the templates with a numeric array, your template file has to be named like the value (as upper camelcase; e.g
MyNewTemplate.html
).
3.2 Extending orderBy
The orderBy
selection can be extended as well to add custom order fields. For example if you added a new field type
to your custom pageType you could also order by this field if necessary.
For every added custom orderBy
item an ascending and descending variant is created. Custom order fields can be added either by PageTS or the EXTCONF array.
NOTE: The key of the orderBy
item must be the name of the field in the database! Numeric arrays are not allowed here.
3.2.1 Extending via PageTS
3.2.2 Extending via EXTCONF
4. Working Example
For a working example please have a look at EXT:flexible_news. There you can see how simple it is to:
- Setup a new pageType with special icons and name
- Extend the template select of the tx_flexiblepages_pagelist CE
All versions of flexible-pages with dependencies
typo3/cms-core Version ^12.0
typo3/cms-fluid-styled-content Version ^12.0
symfony/finder Version ^6.2
ext-json Version *