Project

General

Profile

Actions

Feature #52579

closed

Add an hook to modify the header of a page in the "web_layout" module

Added by Eric Chavaillaz over 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
Start date:
2013-10-07
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.3
Tags:
Complexity:
no-brainer
Sprint Focus:

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

example.zip (2.78 KB) example.zip Eric Chavaillaz, 2013-10-07 17:42
Actions #1

Updated by Xavier Perseguers over 10 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.

Actions #2

Updated by Eric Chavaillaz over 10 years ago

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.

Actions #3

Updated by Gerrit Code Review over 10 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

Actions #4

Updated by Eric Chavaillaz over 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF