PHPackages                             zeroseven/pagebased - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. zeroseven/pagebased

ActiveTypo3-cms-extension

zeroseven/pagebased
===================

The ultimate tool to create page based extensions

v1.3.2(5mo ago)52362[2 PRs](https://github.com/zeroseven/pagebased/pulls)2GPL-2.0-onlyPHPPHP ^8.0 | ^8.1CI passing

Since Apr 3Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/zeroseven/pagebased)[ Packagist](https://packagist.org/packages/zeroseven/pagebased)[ RSS](/packages/zeroseven-pagebased/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (44)Used By (2)

Pagebased
=========

[](#pagebased)

Manage objects like news, events, blog posts, jobs, etc. in the TYPO3 backend as a "normal" TYPO3 page easily. This extension provides you with the necessary plugins and filters, categories, tags, and other useful functions.

Pages vs. records
-----------------

[](#pages-vs-records)

Instead of displaying records in a complicated way like a page, this extension uses the full TYPO3 bandwidth to display content using existing content elements. Besides the additional functions of the pagebased extension, all known TYPO3 features like metadata, translation handling, caching, sitemaps, and URLs are available without any configuration.

[![Example of a page object](./Resources/Public/Images/Documentation/Screenshot1.png)](./Resources/Public/Images/Documentation/Screenshot1.png)

Get there fast with little code
-------------------------------

[](#get-there-fast-with-little-code)

From [news](https://github.com/zeroseven/pagebased_news) to [blog posts](https://github.com/zeroseven/pagebased_blog), a job offer, or an event, page objects usually have a lot in common. [Using a configuration](#object-registration), you can activate or deactivate individual functions for each page object as needed:

- list plugin
- filter plugin
- tags
- categories
- contacts
- relations
- rss feed

Furthermore, the entire logic and functionality for the individual page objects lie within the pagebased extension itself. This way, the controller, repository, pagination, etc. are centrally controlled and can be updated easily. Additionally, new objects can be created in just a few seconds - [give it a try!](#create-your-own-extension)

Create your own extension
-------------------------

[](#create-your-own-extension)

The fast and easy way to create a new Pagebased-Extension is to build it from the extension dummy template.

1. Install [cookiecutter](https://cookiecutter.readthedocs.io/en/stable/installation.html#alternate-installations)
2. Run `cookiecutter pagebased/Resources/Private/ExtensionDummy`

You will be asked for a view variables like extension key, object name, etc. After that a new configured extension will be generated for you.

[![Create new object](./Resources/Public/Images/Documentation/Terminal.gif)](./Resources/Public/Images/Documentation/Terminal.gif)

Configuration
-------------

[](#configuration)

### Object registration

[](#object-registration)

Create a new registration in your `ext_localconf.php`:

```
call_user_func(static function () {
    $object = \Zeroseven\Pagebased\Registration\ObjectRegistration::create('Job')
        ->setClassName(\Vendor\NewExtension\Domain\Model\Job::class)
        ->setControllerClass(\Vendor\NewExtension\Controller\JobController::class)
        ->setRepositoryClass(\Vendor\NewExtension\Domain\Repository\JobRepository::class)
        ->setSorting('title') // Sort jobs by their title (backend and frontend)
        ->enableDate()        // Enable date field for job objects
        ->enableTop()         // Enable top feature for job objects
        ->enableTags()        // Enable tag feature for job objects, so tagging and filtering tags is possible
        ->enableTopics(24)    // Enable topics for jobs and give it a pid where to store these
        ->enableContact(24);  // Enable responsible contact person for job objects

    $category = \Zeroseven\Pagebased\Registration\CategoryRegistration::create('Job-Category')
        ->setClassName(\Vendor\NewExtension\Domain\Model\Category::class)
        ->setRepositoryClass(\Vendor\NewExtension\Domain\Repository\CategoryRepository::class)
        ->setDocumentType(44)  // Set document type for category pages (required!)
        ->setSorting('title'); // Set default sorting for category pages

    $listPlugin = \Zeroseven\Pagebased\Registration\ListPluginRegistration::create('Job list')
        ->setDescription('Display jobs in a super nice list')
        ->addLayout('two-columns', 'Two columns'); // Additional layout option for the fluid template (available via "{settings.layout}")

    $filterPlugin = \Zeroseven\Pagebased\Registration\FilterPluginRegistration::create('Job filter')
        ->setDescription('Filter jobs');

    \Zeroseven\Pagebased\Registration\Registration::create('extension_name')
        ->setObject($object)
        ->setCategory($category)
        ->enableListPlugin($listPlugin)
        ->enableFilterPlugin($filterPlugin)
        ->store();
});
```

### Override existing registration

[](#override-existing-registration)

In case you want to override an existing registration, the event [`BeforeRegistrationEvent`](Classes/Registration/Event/BeforeStoreRegistrationEvent.php) gives you access to all properties to update them before the pagebased extension does the rest.

Alternatively an extension configuration template will be created automatically. Use the settings module of the TYPO3 InstallTool to override the default values.

### Extend plugin flexForm

[](#extend-plugin-flexform)

Use the [`AddFlexFormEvent`](Classes/Registration/Event/AddFlexFormEvent.php) to extend the flexForm of a plugin. Example:

```
