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

Bas van Beek (BVB Media) bas at bvbmedia.nl
Mon Jun 1 12:51:42 CEST 2009


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