Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom fields to settings tab #2

Closed
timdreier opened this issue Dec 22, 2023 · 1 comment
Closed

Add custom fields to settings tab #2

timdreier opened this issue Dec 22, 2023 · 1 comment

Comments

@timdreier
Copy link

Hi,
thanks for this great extension!

I'm currently trying to migrate from z7_blog to page based. How can I add additional / custom fields to an object?

@raphaelthanner
Copy link
Collaborator

raphaelthanner commented Dec 23, 2023

Hi @timdreier,

you can extend the extbase model and page properties in the "normal TYPO3 way".

To display the field only on a specific pagebased type you can create a display condition using the TCAUtility.

Here is an example:

my_extension/Configuration/TCA/Overrides/pages.php

// Add field to all page types
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', 'my_new_field', '', 'after:pagebased_contact');

// Add custom display condition
$registration = \Zeroseven\Pagebased\Registration\RegistrationService::getRegistrationByIdentifier('my_extension');
\Zeroseven\Pagebased\Utility\TCAUtility::addObjectDisplayCondition($registration, 'my_new_field');

We hope you continue to have fun with this extension!
But first and foremost, Merry Christmas 🎅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants