There is a lot that happens in just a few lines. Let's refresh your TypoScript knowledge.
page=PAGE
creates a new top-level page object, and page.typeNum=0
assigns a page type of 0 that is the default. So, when you go to the page with no type
argument, this page object will be used.
Note
Other type numbers can be used to display content in a different form. For example, different type value can render a page for mobile device, for print, or even as XML for external applications, such as RSS feeds.
In the earlier code, page.10=TEMPLATE defines
a content object at position 10 in the content object array. When the page is rendered, the content objects are each rendered in numerical order. Page.10
is defined as a TEMPLATE
content object, so it will take an HTML template file, and process it. Lines template=FILE
and template.file=fileadmin/templates/mainTemplate.html
define the location of the template file that will be loaded. workOnSubpart=DOCUMENT_BODY
tells the page object to use the DOCUMENT_BODY
subpart section of the template.
At this time, the template file will be loaded and output as it is. However, the following lines replace the respective subparts with output from each column:
This is possible because we included the styles.content
static template.
What will happen now is TYPO3 will get a list of all content elements in each column, and render them, that is, it will convert content into HTML. It will then place the resulting HTML code in place of the subparts.
The design in mainTemplate.html
is very simple—just HTML. We want to apply some styling to that structure. Line page.includeCSS.mainStyle=fileadmin/templates/mainStyle.css
includes our CSS file, which does just that.
For more information about templates, you should read a detailed guide to templating in TYPO3: http://typo3.org/documentation/document-library/tutorials/doc_tut_templselect/current/ (Modern Template Building). We will briefly go through a few more features.
In the mainTemplate.html
file, we have used four subparts. This lets us preview the file, and see exactly where the content will go once it is rendered. Subparts are defined by a unique marker, enclosed in HTML comment tags, and surrounding some text, as in:
Sometimes, you just want content to be inserted into a specific point, in such a case, you can use a marker. A marker is similar to a subpart, but exists by itself and doesn't reside in an HTML comment:
Subparts are also used by extensions, where the subparts contain markers. This may not be clear at this point, but after working with a few templates you will grasp the difference.