[TYPO3] add id to body tag with TS

Cray Flatline cray at mass-media.net
Wed Aug 1 02:32:33 CEST 2007


I need to add to every page's body tag it's own id. I try to make such way:

page.bodyTagCObject = HTML
page.bodyTagCObject.value.field = alias//uid
page.bodyTagCObject.value.wrap = <body id="id|">

But it doesn't work

Below is my TS Setup. Please help me somebody

################################################################################
#
# Auto-parser and template main difinitions
#

plugin.tx_automaketemplate_pi1.content = FILE
[globalVar = TSFE:id=14,TSFE:id=41,TSFE:id=42,TSFE:id=43,TSFE:id=44]
	plugin.tx_automaketemplate_pi1.content.file = 
fileadmin/templates/global/index.html
[else]
	plugin.tx_automaketemplate_pi1.content.file = 
fileadmin/templates/global/internal.html
[end]

# Here we define which elements in the HTML that
# should be wrapped in subpart-comments:
plugin.tx_automaketemplate_pi1.elements {
     BODY.all = 1
     BODY.all.subpartMarker = DOCUMENT_BODY
     HEAD.all = 1
     HEAD.all.subpartMarker = DOCUMENT_HEADER
     HEAD.rmTagSections = title
     UL.all = 1
     DIV.all = 1
     LI.all = 1
     TD.all = 1
     TABLE.all=1
}

# Prefix all relative paths with this value:
plugin.tx_automaketemplate_pi1.relPathPrefix = fileadmin/templates/global/


################################################################################
#
# Mapping parts
#


temp.leftcolumn = CONTENT
temp.leftcolumn {
     table = tt_content
       select {
         pidInList = this
         orderBy = sorting
         where = colPos = 1
         languageField = sys_language_uid
       }
}

temp.rightcolumn = CONTENT
temp.rightcolumn {
     table = tt_content
       select {
         pidInList = this
         orderBy = sorting
         where = colPos = 3
         languageField = sys_language_uid
       }
}


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 dynamic menu:
   subparts.mainmenu < temp.mainmenu
   subparts.topmenu < temp.topmenu
   subparts.footermenu < temp.footermenu
   subparts.leftmenu < temp.leftmenu
   subparts.barleft < temp.bannerleft

  # Substitute the ###content### subpart with some example content:
   subparts.content < styles.content.get
   subparts.leftcontent < temp.leftcolumn
   subparts.rightcontent < temp.rightcolumn

subparts.PAGE_UID = TEXT
subparts.PRINT_PAGE < temp.PRINT
subparts.PAGE_UID.field = uid
}


# 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
}


# Default PAGE object:
page = PAGE
page.typeNum = 0

page.bodyTagCObject = HTML
page.bodyTagCObject.value.field = alias//uid
page.bodyTagCObject.value.wrap = <body id="id|">

# 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


-- 
W BR, Cray Flatline


More information about the TYPO3-english mailing list