[TYPO3] Template troubles
Tyler Kraft
headhunterxiii at yahoo.ca
Fri Jul 7 10:27:30 CEST 2006
>> 2) I would just like a little clear information. I have my template set
>> up in fileadmin/template/main as per the tutorial. In my template setup,
>> what line(s) of code do I have to use for the system to use all of my
>> template, including headers and everything. I use:...
>
>> What do I have to do to make it use my template? I cannot find any precise
>> information anywhere. All I want is the basic set of code. And the basic
> set of tags I >can use like:
>
>> <!-- ###DOCUMENT_BODY### -->
>> <!-- ###INSIDE_HEADER### -->
>
> Unfortunately this information isn't laid out in a straight forward manner
> anywhere that I have found.
>
> My understanding is (and I may be wrong, in which case I will appreciate any
> help that anyone else offers too :) ) that these "tags" as you have called
> them, are really not tags (in that, I don't think they have any inherent
> value of their own - unless they are included in what are called "hooks"??
> Someone clarify please?) ... they are just signposts to where you want
> dynamic content to appear.
>
Its all really simple and yes it is clearly documneted. Assuming your
coming from some basis of a programming language, all we need to do is
create a string replace (or pregex) for typo3. So all you have are
really three things - content, template setup, and an html template.
That's it - so the first thing we want to be able to do is get content
out of the cms. In modern template building one we get shown this (and
typoscript by example), and just about any search of the mailing list
will give it as well. Build a temporary content item (temp.maincolumn)
and get the content out!
temp.maincolumn < styles.content.get
temp.leftcolumn < styles.content.getLeft
temp.rightcolumn < styles.content.getRight
temp.bordercolumn < styles.content.getBorder
And maybe we wanta little left hand menu also...
lib.lhmenu = HMENU
lib.lhmenu{
....
Then create a typoscript template to tell typo3 where to put the content
(again from modern templating 1, or typoscript by example)
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
template = FILE
template.file = fileadmin/template/index.html
workOnSubpart = DOCUMENT_BODY
marks.lhmenu < lib.lhmenu
subparts.leftcol < temp.leftcolumn
marks.maincol < temp.maincolumn
subparts.rightcol < temp.rightcolumn
marks.border < temp.bordercolumn
}
# Default PAGE object:
page = PAGE
page.typeNum = 0
page.bodyTag >
page.bodyTag = <body>
page.10 < temp.mainTemplate
Then in you html have some marks and/or sub-sections where the content
will get replaced into, with the needed marks so that typo3 three can
find where you've told it to put the content. (same thing - modern
template building 1, and typoscript by example)
<body>
<!-- ###DOCUMENT_BODY### begin-->
...
<tr>
<td>###lhmenu###</td>
<td><!-- ###leftcol### begin--> Lorem ipsum...<!-- ###leftcol### end--></td>
<td>###maicol###</td>
<td><!-- ###rightcol### begin--> Lorem ipsum...<!-- ###rightcol###
end--></td>
<td>###border###</td>
</tr>
...
<!-- ###DOCUMENT_BODY### end-->
</body>
That's it, its actually that simple, and yes its all in the documentation.
As previously stated you need to really read a lot and then just keep
trying things. I would suggest going back and looking at modern
templating 1 and what I've done, and then when you understand it a
little better it would be very very very beneficial to go and examine
everything you have done in TSref and try to understand what and how you
would find this information by just using tsref. I know that sounds
insane and like a lot of work, and it will be, but it will make a huge
difference to fast quickly you learn typo3.
hth
More information about the TYPO3-english
mailing list