[TYPO3-english] How to print the header field for content object SCRIPT

Sander van Gelderen mail at sandervangelderen.nl
Tue Jun 2 00:15:03 CEST 2009


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


More information about the TYPO3-english mailing list