[TYPO3-core] RFC Feature #9923: Integrate possibility to define additional header data via TypoScript

Oliver Hader oliver at typo3.org
Thu Jun 25 19:41:50 CEST 2009


This is an SVN patch request.

Type: Feature

Bugtracker references:
http://bugs.typo3.org/view.php?id=9923

Branches: Trunk

Problem:
Imagine you've got an extension that shall add a JavaScript and a CSS
file to the HEAD part of the HTML document of the current page. This is
possible in modifying $TSFE->additionalHeaderData. However, when your
extension does not come with a PHP part and consists only of TypoScript,
it's not possible.

Solution:
Add a new cObject "HEADERDATA" which is similar to TEXT but adds the
result to the header data.

Example:
10 = HEADERDATA
10 {
  data = path:EXT:myextension/res/stylesheet.css
  wrap = <link rel="stylesheet" type="text/css" href="|" />
  prepend = TEXT
  prepend.char = 9
}

Documentation changes:
Add a new entry to "Content Objects (cObject)" (tsref.cObject):
HEADERDATA

HEADER is very similar to the cObject "TEXT". However the result will
not be added to the content but to the HTML HEAD section of the page.
This can be used to define JavaScript or Stylesheets on an extension
level for example.

Property              Data type    Description
value                 string       text, wrap with stdWrap properties
(stdWrap properties)

Example:
10 = HEADERDATA
10 {
  value = script.js
  wrap = <script src="|" type="text/javascript"></script>
}


olly
-- 
Oliver Hader
TYPO3 Release Manager 4.3


More information about the TYPO3-team-core mailing list