Project

General

Profile

Actions

Feature #19693

closed

Integrate possibility to define additional header data via TypoScript

Added by Oliver Hader almost 16 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Communication
Target version:
-
Start date:
2008-12-11
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

Description

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.

Thus, this feature request is about to integrate an accordant possibility.

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

This would do the following:
  • add the CSS file "stylesheet.css" to the HEAD part of the current document

(issue imported from #M9923)


Files

0009923.patch (1.02 KB) 0009923.patch Administrator Admin, 2008-12-11 20:55
0009923_v2.patch (1.4 KB) 0009923_v2.patch Administrator Admin, 2009-06-25 19:42

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #20661: [Feature] Add class for render HTML header/footer for BE and FEClosedSteffen Kamper2009-06-24

Actions
Actions #1

Updated by Oliver Hader almost 16 years ago

Documentation changes:

doc_core_tsref, functions, stdWrap:
Property: additionalHeaderData
Data Type: cObject
Description: Adds the cObject to the <HEAD> part of the current document

Actions #2

Updated by Steffen Kamper almost 16 years ago

Hi olly,

This is a nice idea, it allows adding header data depending on defined objects.
+1!

Actions #3

Updated by Johannes von Bargen over 15 years ago

Yeah! That would be cool! I just had a discussion with several people at typo3camp Hamburg about such a possibility.
+1!!!
I am currently working on a extension which integrates jQuery Galleriffic and Galleria into cType Image. That brought the ugly headerData array back to my mind... Additionally it would be cool if headerData was associative and extensions wouldautomatically have a private namespace in the array to add their stuff (the extension key). This way the case where one ext overwrites js /css/meta stuff added by another one would never happen again by accident but otherwise fields of the array could be addressed explicitly if ext B absolutely wants to change something ext A has added.

I think I will open up an own bug for that...

Actions #4

Updated by Vladimir Podkovanov over 15 years ago

+1 for stdWrap.additionalHeaderData

to Johannes von Bargen,
+ 1 for converting page.headerData to assoc array so extension does not bother which numeric keys are used yet. I was running into it too.

Actions #5

Updated by Oliver Hader over 15 years ago

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>
}

Actions #6

Updated by Oliver Hader almost 15 years ago

This is solved with the PageRenderer in issue #20661

Actions #7

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF