[TYPO3-english] re : rlmp_tmplselector template selection
Tony Pauly
tony.pauly at gmail.com
Tue Jan 6 08:28:00 CET 2009
Indeed, I am using the rlmp_tmplselector. I divided my template in several
subtemplates which are included in the main.
Here follows the setup of all the templates:
**************************Main
template***************************************
# Default PAGE object:
page = PAGE
page.typeNum = 0
page.10 < plugin.tx_rlmptmplselector_pi1
# Main TEMPLATE cObject for the HEAD
temp.headTemplate = TEMPLATE
temp.headTemplate {
# Feeding the content from the Auto-parser to the TEMPLATE cObject:
template =< plugin.tx_automaketemplate_pi1
# Select only the content between the <head>-tags
workOnSubpart = DOCUMENT_HEADER
}
# Main TEMPLATE cObject for the HEAD / Content Area
temp.headTemplateCA = TEMPLATE
temp.headTemplateCA {
# Feeding the content from the Auto-parser to the TEMPLATE cObject:
template < temp.contentArea.template
# Select only the content between the <head>-tags
workOnSubpart = DOCUMENT_HEADER
}
plugin.tx_automaketemplate_pi1.content < plugin.tx_rlmptmplselector_pi1
plugin.tx_rlmptmplselector_pi1 {
// Define the paths leading to our HTML template files
templatePathMain = fileadmin/template/main/
templatePathSub = fileadmin/template/sub/
// Define the filenames used as the default HTML templates
defaultTemplateFileNameMain = template_1.html
defaultTemplateFileNameSub = ct_1.html
// If there is a page having no template selected, use a template
// selected earlier in the rootline. If there is none, use the default
inheritMainTemplates = 1
inheritSubTemplates = 1
}
plugin.tx_automaketemplate_pi1.content.defaultTemplateFileName =
template_1.html
# Copying the content from TEMPLATE for <body>-section:
page.10 < temp.mainTemplate
# Copying the content from TEMPLATE for <head>-section:
page.headerData.10 < temp.headTemplate
# Copying the content from Content Area TEMPLATE for <head>-section:
page.headerData.20 < temp.headTemplateCA
********************+ext:CA Template cObject******************************
# Content Area TEMPLATE cObject
temp.contentArea = TEMPLATE
temp.contentArea {
# Feeding the content from the Auto-parser to the TEMPLATE cObject:
# CREATES A COPY since we need to manipulate some properties!
template < plugin.tx_automaketemplate_pi1
# Reconfigurating the "tmplselect" plugin to select from the
# "conten area templates " in sub/ folder instead of main templates:
template.content.templateType = sub
template.content.defaultTemplateFileName = ct_1.html
# Since the template files are now located in another path
# the relative prefix must be changed as well:
template.relPathPrefix = fileadmin/template/sub/
# Clears the "elements" property:
template.elements >
# Sets the DIV and TD elements to be wrapped in subparts:
# Wrap the header section but remove <title> and <style> sections:
template.elements {
HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title, style
DIV.all = 1
TD.all = 1
}
# Select only the content of the <div id="contentsection"> element
workOnSubpart = contentsection
}
****************************+ext:Main TEMPLATE cObject*********************
# Main TEMPLATE cObject for the BODY
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
# Feeding the content from the Auto-parser to the TEMPLATE cObject:
template =< plugin.tx_automaketemplate_pi1
# Select only the content between the <body>-tags
workOnSubpart = DOCUMENT_BODY
# Substitute the ###menu_1### subpart with some example content:
subparts.menu_1 < temp.menu_1
# Substitute the ###menu_2### subpart with dynamic menu:
subparts.menu_2 < temp.menu_2
# Substitute the ###path### subpart with dynamic path menu:
subparts.path < temp.path
# Substitute the ###content### subpart with some example content:
subparts.content < styles.content.get
# Substitute the ###content### subpart with some example content:
#subparts.content < styles.content.get
# Substitute the ###content### subpart with the content area template:
#subparts.content < temp.contentArea
}
**************************+ext:Menu 1************************************
# Menu 1 cObject
temp.menu_1 = HMENU
# First level menu-object, textual
temp.menu_1.1 = TMENU
temp.menu_1.1 {
# Normal state properties
NO.allWrap = <div class="menu1-level1-no"> | </div>
# Enable active state and set properties:
ACT = 1
ACT.allWrap = <div class="menu1-level1-act"> | </div>
}
# Second level menu-object, textual
temp.menu_1.2 = TMENU
temp.menu_1.2 {
# Normal state properties
NO.allWrap = <div class="menu1-level2-no"> | </div>
# Enable active state and set properties:
ACT = 1
ACT.allWrap = <div class="menu1-level2-act"> | </div>
}
# ------------------------
# Menu 2 cObject - horizontal, one-level menu
# ------------------------
temp.menu_2 = HMENU
# Setting the entryLevel to be subpages to CURRENT page:
#temp.menu_2.entryLevel = -1
# First level menu-object, textual
temp.menu_2.1 = TMENU
temp.menu_2.1 {
# Normal state wrapping with alternating wrap-values (see
"optionSplit")
NO.allWrap = <td class="menu2-level1-no"> | </td>
# Enable active state and set properties:
ACT = 1
ACT.allWrap = <td class="menu2-level1-act"> | </td>
}
# ------------------------
# Path menu cObject
# ------------------------
temp.path = HMENU
# Setting the special property to "rootline" - this will produce a
"Path-menu"
temp.path.special = rootline
# First level menu-object, textual
temp.path.1 = TMENU
# Wrapping value for the whole menu:
temp.path.1.wrap = Path: |
temp.path.1 {
# Normal state properties appending " > " to all elements but the last
one.
# (See "optionSplit")
NO.allWrap = | > |*||*| |
}
*******************+ext:auto-parser plugin********************************
# Configuring the Auto-Parser for main template:
plugin.tx_automaketemplate_pi1 {
# Read the template file:
#content = FILE
content.file = fileadmin/template/main/template_1.html
# Here we define which elements in the HTML that
# should be wrapped in subpart-comments:
elements {
BODY.all = 1
BODY.all.subpartMarker = DOCUMENT_BODY
HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title
TD.all = 1
TR.all = 1
}
# Prefix all relative paths with this value:
relPathPrefix = fileadmin/template/main/
}
More information about the TYPO3-english
mailing list