[TYPO3-german] RandomImage in TS-Template einbauen
Adrian Nussbaum
a.n at xpure.ch
Tue Sep 12 10:17:40 CEST 2006
halli hallo
Das Header-Bild in meinem Seiten-Template soll zufällig ausgewechselt
bzw. ausgewählt und angezeigt werden (bei jedem Seitenaufruf/reload).
Und dafür hab ich die RandomImage-Ext ausgewählt.
Nun, soweit ist alles gut gelaufen und das Manual der Ext [1] ist an
sich ganz nett, mir ist aber nicht ganz klar, wie (und vor allem wo)
ich das Ding in _meinem_ TS-Template einzubauen habe.
- Ich verwende die Ext automaketemplate
- Mein Marker für das zufällige Bild heiss "header"
Ist auf Grund dieser Angaben eine Hilfestellung denkbar? Ich wäre
sehr froh drum...
Ich hab mal den TS (Setup) etwas zusammengefasst. Das ist die Ist-
Situation:
----
### diverse configs... ###
plugin.tx_automaketemplate_pi1 {
# Read the template file:
content = FILE
#content.file = fileadmin/template/template.html
content.file = fileadmin/template/{$content_datei}
# 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
DIV.all = 1
}
relPathPrefix = fileadmin/template/
}
### Menu-Definitionen... ###
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.menu_1 < temp.menu_1
# Substitute the ###menu_1### subpart with dynamic menu:
# subparts.menu_2 < temp.menu_2
# Substitute the ###content### subpart with some example content:
subparts.content < styles.content.get
subparts.col_right < styles.content.getRight
subparts.title = TEXT
subparts.title.field = title
}
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
# 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
----
adrian
Links:
[1] http://typo3.org/documentation/document-library/extension-manuals/
cc_random_image/current/view/1/5/
--
More information about the TYPO3-german
mailing list