[TYPO3-english] How to print the header field for content object SCRIPT
Bas van Beek (BVB Media)
bas at bvbmedia.nl
Tue Jun 2 08:53:16 CEST 2009
Dear Sander,
Thanks for giving me a reply. Perhaps my message was incomplete, but
lib.stdheader was the first thing I tried.
As form of double checking I tried it now again and changed the default
function to this:
tt_content.script = COA
tt_content.script {
5 = < lib.stdheader
10 = TEXT
10 {
value =
prefixComment = 2 | Script element (Deprecated)
}
}
But it looks like stdheader won't use the header field of the script object.
This will still not print the header.
PS
It's true that the script object is deprecated since a couple of years. But
still I use it fully in my custom applications and it works very well for
me. Normally I would print the header field within my PHP application, so I
never had this problem before, but now I wanna leave that up to TS so that
we can modify it more flexible within typo3 and leave the PHP application
alone.
Hope this will clearify it a bit more.
Thanks.
Kind regards,
Bas van Beek
2009/6/2 Sander van Gelderen <mail at sandervangelderen.nl>
> Hi Bas,
>
> You could use 'Template' -> 'Typoscript Objec Browser' to take a look at
> the 'tt_content' node in the TS tree.
>
> Fold out this node and inspect the content elements (text, image, etc)
> You will notice (nearly) all of them are a COA, and the first element
> (10) copies lib.stdheader. This is how the headers are normally rendered.
>
> Only the script element is different, it is of a TEXT type, without the
> COA surrounding it. NB. in my installation (4.2.6), this content element
> is deprecated and does nothing at all.
>
> I am not sure of when this was deprecated, if this is not the case with
> you yet then you may change tt_content.script to be a COA and simply
> copy lib.stdheader in as the first element.
>
> I hope this is of help to you.
>
> Sander
>
> Bas van Beek (BVB Media) schreef:
> > Hi there,
> >
> > Im wondering how I could print the header of a content object SCRIPT plus
> > the rendering of the script like this:
> >
> > <div class="box">
> > <h1>HEADER OF THE SCRIPT OBJECT</h1>
> > <div class="box_content">RENDERED CUSTOM PHP SCRIPT</div>
> > </div>
> >
> > I'm using the static template css_styled_content and it prints the header
> > field + bodytext field for content objects like TEXT.
> >
> > Unfortunatly this won't work for the content element SCRIPT. Does anyone
> > know how to adjust the TS setup so that it also prints the header of the
> > SCRIPT object?
> >
> > As example i'm using this function:
> >
> > temp.contentToSplit1 = COA
> > temp.contentToSplit1 {
> > 10 = CONTENT
> > 10 {
> > table = tt_content
> > select {
> > orderBy = sorting
> > where = colPos = 1
> > pidInList = 253
> > languageField = sys_language_uid
> > begin= 0
> > }
> > }
> > }
> >
> > I tryed all posibilities I could think of. For example this approach does
> > what I want (printing the header), but unfortunatly it will print the
> script
> > parameters as string on the site and it will not be rendered by typo3:
> >
> > <div class="box">
> > <h1>HEADER OF THE SCRIPT OBJECT</h1>
> > <div class="box_content">PARAMETERS PRINTED HERE OF THE CONTENT
> > OBJECT</div>
> > </div>
> >
> > temp.contentToSplit1 = COA
> > temp.contentToSplit1 {
> > 10 = CONTENT
> > 10 {
> > table = tt_content
> > select {
> > orderBy = sorting
> > where = colPos = 1
> > pidInList = 253
> > languageField = sys_language_uid
> > begin= 0
> > }
> > renderObj=COA
> > renderObj {
> > 20 = TEXT
> > 20.field = header
> > 20.wrap = <H1>|</H1>
> > 21 = TEXT
> > 21.field = bodytext
> > 21.wrap = <div class="box_content">|</div>
> > }
> > }
> > }
> >
> > I could fix it by using 2 CONTENT objects in 1, but that sounds silly to
> me,
> > cause it will use 2 queries:
> >
> > temp.contentToSplit1 = COA
> > temp.contentToSplit1 {
> > 5 = CONTENT
> > 5 {
> > table = tt_content
> > select.orderBy = sorting
> > select.where = colPos = 1
> > select.pidInList = 253
> > renderObj=COA
> > renderObj.10 = TEXT
> > renderObj.10.field = header
> > renderObj.10.wrap (
> > <DIV class=box_head>
> > <DIV class=inner1>
> > <DIV class=inner2>
> > <DIV class=inner3>|</DIV>
> > </DIV>
> > </DIV>
> > </DIV>
> > )
> > }
> > 10 = CONTENT
> > 10 {
> > table = tt_content
> > select.orderBy = sorting
> > select.where = colPos = 1
> > select.pidInList = 253
> > renderObj.stdWrap.wrap (
> > <DIV class=box>
> > <DIV class=box_inner1>
> > <DIV class=background-top-4>
> > <DIV class=background-top-left-4>
> > <DIV class=background-top-right-4>
> > <DIV class=background-bottom-left-4>
> > <DIV class=background-bottom-right-4>
> > <DIV class=box-indent>
> > <DIV class=box1_body>
> > <DIV id=categoriesContent class=sideBoxContent>
> > |
> > </DIV>
> > </DIV>
> > </DIV>
> > </DIV>
> > </DIV>
> > </DIV>
> > </DIV>
> > </DIV>
> > </DIV>
> > </DIV>
> > </DIV>
> >
> > )
> > }
> > }
> >
> > Anyone knows how to deal with this?
> >
> > Kind regards,
> >
> > Bas van Beek
> > Webdeveloper
> > BVB Media
> > Web: www.bvbmedia.nl
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>
--
Met vriendelijke groet,
Bas van Beek
Webdeveloper
BVB Media
E-mail: bvbmedia at gmail.com
Web: www.bvbmedia.nl
Tel: 0184-422330
More information about the TYPO3-english
mailing list