[TYPO3] Automatic ordening of header tags

Edwin Blokker a.stoutjesdijk at chello.nl
Fri May 4 18:01:58 CEST 2007


Thanks for all the input guys!


Tyler Kraft schreef:
> Hi,
> 
> Ok mine works essentially very much like this, where I wrap the headline 
> from the first content object (if it has a headline) in a h1 tag and all 
> other headlines are left to how the user intended.
> 
> What I'm doing here is copying the lib.stdHeader to a different newly 
> defined lib.stdHeaderNEW (for other reasons not relevant). Then I remap 
> the tt_content rendering so it becomes different for each column. Next I 
> give all content items in just the maincol where the content item is not 
> the first item the new lib.stdWrapNEW headline rendering. (the first 
> content item doesn't get any type of lib.stdHeader at all in the main 
> column)
> 
> Then I pull out the headline from the first content item in my 
> temp.maincol.5 and render it in a special way.
> 
> *warning* I know it probably looks convoluted, but I needed it this way 
> for various reasons. yours probably doesn't need to be like this at all.
> 
> 
> hope that helps,
> Ty
> 
> 
> 
> 
> 
> 
> lib.stdheader.stdWrap.dataWrap >
> lib.stdheader.10.1.fontTag = <h1>|</h1>
> lib.stdheader.10.2.fontTag = <h2>|</h2>
> lib.stdheader.10.3.fontTag = <h3>|</h3>
> lib.stdheader.10.4.fontTag = <h4>|</h4>
> lib.stdheader.10.5.fontTag = <h5>|</h5>
> 
> lib.stdHeaderNEW < lib.stdheader
> 
> temp.customRender = CASE
> temp.customRender {
>    key.field = colPos
>    default < tt_content
>    0 < tt_content
>    1 < tt_content
>    2 < tt_content
>    3 < tt_content
> 
>    0{
>     header.10=COA
>     header.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.field.data = cObj:parentRecordNumber
>         }
>     text.10=COA
>     text.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     image.10=COA
>     image.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     textpic.10.10=COA
>     textpic.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     textpic.20.text.10.10=COA
>     textpic.20.text.10.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     bullets.10=COA
>     bullets.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     table.10=COA
>     table.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     uploads.10=COA
>     uploads.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     multimedia.10=COA
>     multimedia.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     mailform.10=COA
>     mailform.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     search.10=COA
>     search.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     login.10=COA
>     login.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     menu.10=COA
>     menu.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     shortcut.10=COA
>     shortcut.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     list.10=COA
>     list.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>     page_php_content_pi1.10=COA
>     page_php_content.10{
>         10=< lib.stdHeaderNEW
>         if.value=1
>         if.isGreaterThan.data = cObj:parentRecordNumber
>         }
>    }
> }
> 
> tt_content >
> tt_content < temp.customRender
> 
> temp.maincol = COA
> temp.maincol.5 = CONTENT
> temp.maincol.5 {
>         table = tt_content
>         select.orderBy = sorting
>         select.where = colPos=0
>         select.max = 1
>         select.languageField = sys_language_uid
>         select.selectFields = header,header_position,header_layout
> }
> temp.maincol.5.renderObj = COA
> temp.maincol.5.renderObj.10 < lib.stdheader
> temp.maincol.5.renderObj.10{
>         10.1.fontTag = <h1 class="pgh">|</h1>
>         10.2.fontTag = <h1 class="pgh">|</h1>
>         10.3.fontTag = <h1 class="pgh">|</h1>
>         10.4.fontTag = <h1 class="pgh">|</h1>
>         10.5.fontTag = <h1 class="pgh">|</h1>
> }
> temp.maincol.10 < styles.content.get


More information about the TYPO3-english mailing list