.. include:: /Includes.rst.txt .. _cobj-template: ======== TEMPLATE ======== .. tip:: It is recommended to use :ref:`cobj-fluidtemplate` instead of TEMPLATE. FLUIDTEMPLATE combines Fluid templates with TypoScript. This works very similar to TEMPLATE. With this cObject you can define a template (e.g. an HTML file) which should be used as a basis for your whole website. Inside the template file you can define markers, which later will be replaced with dynamic content by TYPO3. .. ### BEGIN~OF~TABLE ### .. container:: table-row Property template Data type :ref:`cObject ` Description This must be loaded with the template-code. Usually this is done with a :ref:`FILE cObject `. If it is not loaded with code, the object returns nothing. **Example:** :: page.10 = TEMPLATE page.10 { template = FILE template.file = fileadmin/template.html } This will use the file fileadmin/template.html as template for your website. .. container:: table-row Property subparts Data type *(array of cObjects)* Description This is an array of subpart-markers (case-sensitive). A subpart is defined by **two** markers in the template. The markers must be wrapped by "###" on both sides. You may insert the subpart- markers inside HTML-comment-tags! **Example:** In the template there is the subpart "HELLO":: This is the HTML code, that will be loaded in the register and will be replaced with the result... The following TypoScript code now replaces the subpart "HELLO" with the text given in "value":: page.10.subparts { HELLO = TEXT HELLO.value = En subpart er blevet erstattet! } **Note:** Before the content objects of each subpart are generated, all subparts in the array are extracted and loaded into the register so that you can load them from there later on. The register-key for each subparts code is "SUBPART\_[theSubpartkey]". In addition the current-value is loaded with the content of each subpart just before the cObject for the subpart is parsed. That makes it quite easy to load the subpart of the cObject (e.g.: ".current = 1") E.g. this subpart above has the register-key "SUBPART\_HELLO". *This is valid ONLY if the property .nonCachedSubst is not set (see below)!* .. container:: table-row Property relPathPrefix Data type *string / properties* Description Finds all relative references (e.g. to images or stylesheets) and prefixes this value. If you specify properties (uppercase) these will match HTML tags and specify alternative paths for them. See example below. If the property is named "style", it will set an alternative path for the "url()" wrapper that may be in