[TYPO3] Help with template TypoScript: how to modify and reposition FE output ?

Tadej Bregar Tadej.Bregar at guest.arnes.si
Tue Mar 13 20:56:24 CET 2007


Hello,
I need some help with template TypoScript.

I want to modify appearance of frontend output of "advanced" Pages 
(type: advanced) and text Content elements (type: text) in them.
In the Page creation form ("Abstract" section) I fill in the author name 
and surname and, and in Content element creation form I fill-in the date 
field ("Header" section).
Now in frontend I want to be able to:
- first:    output the Title of the Content element
- second:    (one line below the h1 Title) output Author name and 
surname (before that should be some wrapping text, like "Written by: ", 
but the wrap should only be there if the "Author" field in BE Page 
creation form has any actual name filled in)
- third:    output the Date of Content element (again with some wrapping 
text, eg. "Datum: ", again only present if "Date" field is not empty)
- fourth:    output the main text of the Content element

In my current setup all I get in FE output is:
- Date (without any wrapping text, just plain numbers like 12.03.2007)
- Title
- main text of the Content element


I have played with TypoScript a few evenings, but without much luck. I 
only know how to modify the look of Date output:

lib.stdheader = COA
lib.stdheader {
    5 = TEXT
    5.field = date
    5.if.isTrue.field = date
    5.date = d.m.Y
    5.wrap = <div id="article_metadata_date">|</div>
}

I don't know how to:
- output Author
- reposition elements so these would be Title, Author, Date, main text 
of Content element
- output Author and Date wrapping code and text (eg.  "Written by: ") 
only if the field in BE is not empty

Some info regarding my environment:
- Typo3 4.0.4 with css_styled_content, Template Auto-parser and some 
other less important extensions.
- a part of TypoScript code of the Main Template:

temp.mainTemplate = TEMPLATE
temp.mainTemplate {
    template =< plugin.tx_automaketemplate_pi1
    template.content.templateType = main
    workOnSubpart = DOCUMENT_BODY
    subparts.header < temp.header
    subparts.column_b_content < styles.content.getRight
    subparts. ......... a few other subparts, not worth mentioning ......
    subparts.column_c_content.10 < styles.content.get
    subparts.footer < temp.footer
}

Thanks for any info,
Tadej Bregar





More information about the TYPO3-english mailing list