Skip to content

Commit

Permalink
[FERATURE] Add pagination on/off to extension configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
t3brightside committed Dec 15, 2021
1 parent a9ea9a8 commit 084dbc5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
16 changes: 15 additions & 1 deletion Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
'tt_content', 'EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf'
);

// Get extension configuration
$extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
);
$extensionConfiguration = $extensionConfiguration->get('youtubevideo');

// Add to content type dropdown
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
"tt_content",
Expand Down Expand Up @@ -99,7 +105,6 @@
--palette--;LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo.title;youtubevideoMain,
--div--;LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo.settings;,
--palette--;LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo.layout;youtubevideoLayout,
--palette--;LLL:EXT:paginatedprocessors/Resources/Private/Language/locallang_tca.xlf:palettes.pagination;paginatedprocessors,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,
--palette--;;frames,
--palette--;;appearanceLinks,
Expand All @@ -115,6 +120,15 @@
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
';

if ($extensionConfiguration['youtubevideoEnablePagination']) {
$GLOBALS['TCA']['tt_content']['types']['youtubevideo_pi1']['showitem'] = str_replace(
';youtubevideoLayout,',
';youtubevideoLayout,
--palette--;LLL:EXT:paginatedprocessors/Resources/Private/Language/locallang_tca.xlf:palettes.pagination;paginatedprocessors,',
$GLOBALS['TCA']['tt_content']['types']['youtubevideo_pi1']['showitem']
);
}

$GLOBALS['TCA']['tt_content']['palettes']['youtubevideoMain']['showitem'] = 'tx_youtubevideo_assets';
$GLOBALS['TCA']['tt_content']['palettes']['youtubevideoLayout']['showitem'] = '
tx_youtubevideo_colcount,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ Version 2.0.0 is not compatible with older versions of the extension. There is n
- Concent cookie: youtubevideo-consent=1

## Installation

- `composer req t3brightside/youtubevideo` or from TYPO3 extension repository [youtubevideo](https://extensions.typo3.org/extension/youtubevideo/)
- Include static template
- Alter the TypoScript constants if needed
- Install [paginatedprocessors](https://github.com/t3brightside/paginatedprocessors) for pagination
- See the extension configuration to disable some BE features
- Extension Configuration: Back end player (default: enabled)
- Extension Configuration: Pagination features (default: disabled)

## Usage

Expand Down
2 changes: 1 addition & 1 deletion ext_conf_template.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cat=basic/enable; type=options[Disabled=0,Enabled=1]; label=Enable Back End Previews
youtubevideoEnableBePlayer = 1
# cat=basic/enable; type=options[Disabled=0,Enabled=1]; label=Enable Pagination (t3brightside/paginatedprocessors needed)
youtubevideoEnablePagination = 1
youtubevideoEnablePagination = 0

0 comments on commit 084dbc5

Please sign in to comment.