[TYPO3-mvc] Modifying HTML headers with extbase plugin + config.disableAllHeaderCode = 1

Steffen Müller typo3 at t3node.com
Tue Oct 5 19:04:32 CEST 2010


Hi.

I try to add HTML meta headers using content from the domain model.
For example we have a product and the product.description needs to be
set as <meta name="description" content="product.description />

It turned out to be harder than expected, because I render all HTML by
hand, using config.disableAllHeaderCode = 1

The page is rendered using TypoScript and the extbase extension is :

page = PAGE
page.wrap = <html>|</html>
page.10 = COA
page.10 {
  wrap = <head>|</head>
  10 = TEXT
  10.value = <title>title here</title>
}
page.20 = COA
page.20 {
  wrap = <body>|</body>
  10 < styles.content.get
}

All attempts to set the headers failed. I tried add the headers to
page.10.99 in the controller, by loading the values to a register and
then use them in TS:

# ProductController
$this->cObj = t3lib_div::makeInstance('tslib_cObj');
$this->cObj->LOAD_REGISTER(
  array('productDescription' => $this->product->getDescription()),
  ''
);

# TS
page.10.20 = TEXT
page.10.20.data = register:productDescription
page.10.20.wrap = <meta name=description" content="|" />


Adding values to TSFE also failed, for example by using:

# ProductController
$GLOBALS['TSFE']->pSetup['10.']['10.']['5.']['60'] = 'TEXT';
$GLOBALS['TSFE']->pSetup['10.']['10.']['5.']['60.']['dataWrap'] = '<meta
name="description" content="' . $this->product->getDescription() . "/>';

It seems the rendering process has already finished this part when the
extbase extension is called. At least this is what the output of the
admPanel shows. The extension is configured as INT.

Do you have any idea how to solve this?

-- 
cheers,
Steffen

Twitter: @t3node - http://twitter.com/t3node
TYPO3 Blog: http://www.t3node.com/


More information about the TYPO3-project-typo3v4mvc mailing list