Commit d1f2f249 authored by Thomas Löffler's avatar Thomas Löffler

Fix documentation and extending the news page doktype

parent 020ee9eb
Pipeline #1413 failed with stage
in 52 seconds
......@@ -19,13 +19,6 @@ $newsDoktype = 12;
// Copy palette configuration from "title" to new "title_for_news"
$GLOBALS['TCA']['pages']['palettes']['title_news'] = $GLOBALS['TCA']['pages']['palettes']['title'];
// Copy palette configuration from "editorial" to new "editorial_for_news"
// Remove lastUpdate from palette
$GLOBALS['TCA']['pages']['palettes']['editorial_news'] = \TYPO3\CMS\Core\Utility\GeneralUtility::rmFromList(
'lastUpdated;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.lastUpdated_formlabel',
$GLOBALS['TCA']['pages']['palettes']['editorial']
);
// Add news_datetime to title_for_news palette
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
'pages',
......@@ -34,29 +27,29 @@ $GLOBALS['TCA']['pages']['palettes']['editorial_news'] = \TYPO3\CMS\Core\Utility
'after:title'
);
// Copy palette configuration from "editorial" to new "editorial_for_news"
// Remove lastUpdate from palette
$GLOBALS['TCA']['pages']['palettes']['editorial_news'] = $GLOBALS['TCA']['pages']['palettes']['editorial'];
$GLOBALS['TCA']['pages']['palettes']['editorial_news']['showitem'] = str_replace(
', lastUpdated;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.lastUpdated_formlabel',
'',
$GLOBALS['TCA']['pages']['palettes']['editorial_news']['showitem']
);
// Copy behaviour from standard page to news page
$GLOBALS['TCA']['pages']['types'][$newsDoktype]['showitem'] =
'--palette--;' . $frontendPrefix . 'pages.palettes.standard;standard,
--palette--;' . $frontendPrefix . 'pages.palettes.title;title_news,
categories,
--palette--;' . $frontendPrefix . 'pages.palettes.abstract;abstract,
--palette--;' . $frontendPrefix . 'pages.palettes.metatags;metatags,
--palette--;' . $frontendPrefix . 'pages.palettes.editorial;editorial_news,
--div--;' . $frontendPrefix . 'pages.tabs.resources,
--palette--;' . $frontendPrefix . 'pages.palettes.media;media,
--div--;' . $frontendPrefix . 'pages.tabs.appearance,
--palette--;' . $frontendPrefix . 'pages.palettes.layout;layout,
--palette--;' . $frontendPrefix . 'pages.palettes.replace;replace,
--div--;' . $frontendPrefix . 'pages.tabs.behaviour,
--palette--;' . $frontendPrefix . 'pages.palettes.links;links,
--palette--;' . $frontendPrefix . 'pages.palettes.caching;caching,
--palette--;' . $frontendPrefix . 'pages.palettes.language;language,
--palette--;' . $frontendPrefix . 'pages.palettes.miscellaneous;miscellaneous,
--palette--;' . $frontendPrefix . 'pages.palettes.module;module,
--div--;' . $frontendPrefix . 'pages.tabs.access,
--palette--;' . $frontendPrefix . 'pages.palettes.visibility;visibility,
--palette--;' . $frontendPrefix . 'pages.palettes.access;access'
;
$GLOBALS['TCA']['pages']['types'][$newsDoktype]['showitem'] = $GLOBALS['TCA']['pages']['types'][1]['showitem'];
// Replace title area and add categories
$GLOBALS['TCA']['pages']['types'][$newsDoktype]['showitem'] = str_replace(
';title,',
';title_news,',
$GLOBALS['TCA']['pages']['types'][$newsDoktype]['showitem']
);
// Replace editorial to remove lastUpdated
$GLOBALS['TCA']['pages']['types'][$newsDoktype]['showitem'] = str_replace(
';editorial,',
';editorial_news,',
$GLOBALS['TCA']['pages']['types'][$newsDoktype]['showitem']
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
'just_news',
......
......@@ -35,15 +35,15 @@ Integrate extension
Enhancing extension
-------------------
By adding template, partial and layout paths to ``lib.fluidContent`` with their
By adding template, partial and layout paths to ``lib.contentElement`` with their
subsections ``templateRootPaths``, ``partialRootPaths`` and ``layoutRootPaths`` you can
create own templates and override the original ones.
To change the markup of the news listing you can add this code into TypoScript:
To change the markup of the news listing you can add this code into TypoScript setup:
.. code-block:: typoscript
lib.fluidContent {
lib.contentElement {
templateRootPaths {
40 = EXT:my_ext/Resources/Private/Templates
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment