[TYPO3] content items to be wrapped with a div if is a text item but not if it's an image
John Kavanagh
john.kavanagh at roomthree.com
Thu Feb 8 15:27:38 CET 2007
Hello,
I am editing a typo3 site that doesn't have templavoila installed and am
trying to get the following result:
In the right hand column (colPos=2) I want each content item to be
wrapped with a div if is a text item but not if it's an image.
I have looked at all the guides and the messages and I can't find a way
to get it to work (I am a typoscript beginner).
This is my code:
plugin.tx_automaketemplate_pi1 {
content = FILE
content.file = fileadmin/html/generic.html
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
}
relPathPrefix = fileadmin/html/
}
temp.columnRight = CONTENT
temp.columnRight {
table = tt_content
select.orderBy = sorting
slide = -1
select.where = colPos = 2
}
temp.columnRight.stdWrap.innerWrap.cObject >
temp.columnRight.stdWrap.innerWrap.cObject = CASE
temp.columnRight.innerWrap.cObject {
key.field = CType
default = HTML
default.value = <div id="c{field:uid}" class="item"> | </div>
image = IMAGE
image.value = <div style="border:1px solid red;">|</div>
#i'm just using this div to see if it has worked!
}
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
template =< plugin.tx_automaketemplate_pi1
# Select only the content between the <body>-tags
workOnSubpart = DOCUMENT_BODY
subparts.topLinks < temp.topLinks
subparts.nav < temp.nav
subparts.subHeader < temp.menu_subHeader
subparts.content = CONTENT
subparts.content {
table = tt_content
select.orderBy = sorting
select.where = colPos = 0
}
subparts.columnRight < temp.columnRight
styles.content.links.target = _self
}
temp.headTemplate = TEMPLATE
temp.headTemplate {
template =< plugin.tx_automaketemplate_pi1
# Select only the content between the <head>-tags
workOnSubpart = DOCUMENT_HEADER
}
page = PAGE
page.typeNum = 0
page.10 < temp.mainTemplate
page.headerData.10 < temp.headTemplate
If you can tell me where I am going wrong I would greatly appreciate it!
Thank you,
John.
More information about the TYPO3-english
mailing list