[TYPO3] Help with template TypoScript: how to modify and reposition FE output ?
Peter Klein
peter at umloud.dk
Thu Mar 15 22:38:18 CET 2007
Hi Tadej..
Try this:
-- cut --
lib.stdheader {
# 1st we delete the original date object, which is placed before the header
5 >
# next we delete the original header type 1 object,
10.1 >
# and then create a new one.
10.1 = COA
10.1 {
# 1st we output the title
10 = TEXT
10.current = 1
10.insertData = 1
10.fontTag = <h1{register:headerStyle}{register:headerClass}>|</h1>
# 2nd we output the author field of the page, and wrap it
20 = TEXT
20.data = page:author
20.wrap = <div>Written by: |</div>
20.required = 1
# 3rd we format and output the date of the content element
30 = TEXT
30.field = date
30.strftime = %A, %d %B %Y
# More info on "strftime" formatting can be found here:
#
http://typo3.org/documentation/document-library/references/doc_core_tsref/4.0.0/view/2/2/
30.wrap = <div>Date: |</div>
30.if.isTrue.field = date
}
}
-- cut --
--
Peter Klein / Umloud Untd
"Tadej Bregar" <Tadej.Bregar at guest.arnes.si> wrote in message
news:mailman.71721.1173815788.21067.typo3-english at lists.netfielders.de...
> 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