Feature #52579
closedAdd an hook to modify the header of a page in the "web_layout" module
100%
Description
Hi all,
In the "PageLayoutController", there is a hook to alter the footer rendering of the "web_layout" module.
It will be great to add the same to alter the header of it.
I propose :
Before :
// Add the content for each table we have rendered (traversing $tableOutput variable) foreach ($tableOutput as $table => $output) { $content .= $this->doc->section('', $output, TRUE, TRUE, 0, TRUE); $content .= $this->doc->spacer(15); $content .= $this->doc->sectionEnd(); } // Making search form: if (!$this->modTSconfig['properties']['disableSearchBox'] && count($tableOutput)) { $sectionTitle = \TYPO3\CMS\Backend\Utility\BackendUtility::wrapInHelp('xMOD_csh_corebe', 'list_searchbox', $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.search', TRUE)); $content .= $this->doc->section($sectionTitle, $dblist->getSearchBox(0), FALSE, TRUE, FALSE, TRUE); } // Additional footer content $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawFooterHook']; if (is_array($footerContentHook)) { foreach ($footerContentHook as $hook) { $params = array(); $content .= \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($hook, $params, $this); } }
After :
// Init the content $content = ''; // Additional header content $headerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook']; if (is_array($headerContentHook)) { foreach ($headerContentHook as $hook) { $params = array(); $content .= \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($hook, $params, $this); } } // Add the content for each table we have rendered (traversing $tableOutput variable) foreach ($tableOutput as $table => $output) { $content .= $this->doc->section('', $output, TRUE, TRUE, 0, TRUE); $content .= $this->doc->spacer(15); $content .= $this->doc->sectionEnd(); } // Making search form: if (!$this->modTSconfig['properties']['disableSearchBox'] && count($tableOutput)) { $sectionTitle = \TYPO3\CMS\Backend\Utility\BackendUtility::wrapInHelp('xMOD_csh_corebe', 'list_searchbox', $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.search', TRUE)); $content .= $this->doc->section($sectionTitle, $dblist->getSearchBox(0), FALSE, TRUE, FALSE, TRUE); } // Additional footer content $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawFooterHook']; if (is_array($footerContentHook)) { foreach ($footerContentHook as $hook) { $params = array(); $content .= \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($hook, $params, $this); } }
I will make a patch this evening.
Thanks,
Eric
Files
Updated by Xavier Perseguers almost 11 years ago
- Tracker changed from Bug to Feature
This is definitely a feature request :)
Note: A use case for this hook would be to let Web > Page be extended so that media to be found in page properties (for use in TS as banner) are presented as thumbnails before the content blocks, so that UX-wise, the editor has a hint which images will be used for her banner and possibly sees a text hint explaining how to update them.
Updated by Eric Chavaillaz almost 11 years ago
- File example.zip example.zip added
Another use case can be to inform the editor that a page has no meta defined.
I have made an example extension to show an idea.
It's really a very little test.
But we can imagine a lot of information about the page directly in the page with this hook.
Thanks.
Updated by Gerrit Code Review almost 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24460
Updated by Eric Chavaillaz almost 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset ab11514a6823e0865334bac6661d806ed0ad2cd6.
Updated by Riccardo De Contardi almost 7 years ago
- Status changed from Resolved to Closed