Add basic pages content element
E.g. to show a list of all related blog posts of a series.
This commit is contained in:
parent
a4fe898a3b
commit
d5b068d9ff
4 changed files with 77 additions and 2 deletions
|
@ -12,7 +12,7 @@ mod.wizards.newContentElement.wizardItems {
|
|||
}
|
||||
}
|
||||
menu {
|
||||
show = menu_abstract, menu_subpages
|
||||
show = menu_abstract, menu_pages, menu_subpages
|
||||
}
|
||||
special {
|
||||
show =
|
||||
|
@ -26,6 +26,6 @@ mod.wizards.newContentElement.wizardItems {
|
|||
}
|
||||
TCEFORM.tt_content {
|
||||
CType {
|
||||
keepItems := addToList(text, image, video, menu_abstract, menu_subpages)
|
||||
keepItems := addToList(text, image, video, menu_abstract, menu_pages, menu_subpages)
|
||||
}
|
||||
}
|
||||
|
|
40
Configuration/TCA/Overrides/tt_content_menupages.php
Normal file
40
Configuration/TCA/Overrides/tt_content_menupages.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
(function (string $extensionKey, string $tableName, string $contentType) {
|
||||
$languagePath = 'LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_tca.xlf:' . $tableName . '.';
|
||||
|
||||
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA'][$tableName], [
|
||||
'types' => [
|
||||
$contentType => [
|
||||
'showitem' => implode(',', [
|
||||
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general',
|
||||
'--palette--;;general',
|
||||
'--palette--;;headers',
|
||||
'bodytext',
|
||||
'pages',
|
||||
'--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance',
|
||||
'--palette--;;frames',
|
||||
'--palette--;;appearanceLinks',
|
||||
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language',
|
||||
'--palette--;;language',
|
||||
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access',
|
||||
'--palette--;;hidden',
|
||||
'--palette--;;access',
|
||||
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories',
|
||||
'categories',
|
||||
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes',
|
||||
'rowDescription',
|
||||
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended',
|
||||
]),
|
||||
'columnsOverrides' => [
|
||||
'bodytext' => [
|
||||
'config' => [
|
||||
'enableRichtext' => true,
|
||||
'richtextConfiguration' => 'default',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
})('ds_site', 'tt_content', 'menu_pages');
|
|
@ -0,0 +1,16 @@
|
|||
tt_content.menu_pages =< lib.contentElement
|
||||
tt_content.menu_pages {
|
||||
templateName = MenuPages
|
||||
dataProcessing {
|
||||
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
|
||||
10 {
|
||||
special = list
|
||||
special.value.field = pages
|
||||
includeNotInMenu = 1
|
||||
}
|
||||
}
|
||||
|
||||
stdWrap {
|
||||
editIcons := appendString(header, header_layout, pages)
|
||||
}
|
||||
}
|
19
Resources/Private/Templates/ContentElements/MenuPages.html
Normal file
19
Resources/Private/Templates/ContentElements/MenuPages.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<html xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
|
||||
data-namespace-typo3-fluid="true">
|
||||
|
||||
{f:layout(name: 'Default')}
|
||||
|
||||
<f:section name="Header">
|
||||
{f:render(partial: 'Header', arguments: {
|
||||
uid: data.uid,
|
||||
layout: headerLayout,
|
||||
header: '{data.header} {topic.0.data.title}'
|
||||
})}
|
||||
</f:section>
|
||||
|
||||
<f:section name="Content">
|
||||
{data.bodytext -> f:format.html()}
|
||||
|
||||
{f:render(partial: 'Menu/Pages', arguments: {pages: menu})}
|
||||
</f:section>
|
||||
</html>
|
Loading…
Reference in a new issue