Zum Inhalt springen

2 verschieden Templates verwenden

Erstellt am 10. November 2005 · 7 Antworten · letzte Antwort am 10. April 2008

Tags: Frage

rizzla ·

Hi,

ich bin noch nicht lange dabei mich mit typo zu beschäftigen.
Ist es denn möglich 2 verschiedene Templates zu verwenden.
Ich benötige z.B. auf der Startseite ein 3-spaltiges Template und auf den folgeseiten eine 2spaltiges.

Ist das Möglich und wie würde ich das anwenden.
Ich hab über die Suche nichts geholfen was mir geholfen hat.

Danke und Gruß

Artworker84 ·

moin,

du musst ja alle drei spanlten im TS ansprechen, wenn du dann aber nur zwei nutzt wird das dritte ignoriert, verstehst du?

wenn du nur 2 inhalte dann einfügst, dann wird die dritte spalte einfach weggelassen...

#==========================
#Content einlesen und ausgeben
#==========================

                  RECHTS = CONTENT
                  RECHTS {
                         table = tt_content
                         select.orderBy = Sorting
                         select.where = colPos = 2
                         select.languageField = sys_language_uid
     }


                 NORMAL = CONTENT
                 NORMAL {
                         table = tt_content
                         select.where = colPos = 0
                         select.orderBy = sorting
     }


                 LINKS = CONTENT
                 LINKS {
                        table = tt_content
                        select.where = colPos = 1
                        select.orderBy = sorting
     }
hypermania ·

Wie kann ich dann aber ds ganze z.B. mit einem <td> umgeben, damit es Spalten werden oder kann man das auch erst später formatieren? Wenn ja wie :o

Also aktuell bei mir:

<td>###marker1###</td>
<td>###marker2###</td>
<td>###marker3###</td>

Ansonsten rizzla gibt es die Erweiterung tmplselector.

FalkWalter ·

Servus,

wie wäre es, wenn Du Divs benutzt? So könntest Du bspw. die linke Spalte mittels CSS fest auf x Pixel setzen, die mittlere variabel lassen und die dritte auf y Pixel setzen.

Grüßle
Falk

Bebbi ·

Hi

um die Verwirrung komplett zu machen kannst du es auch mit Bedingungen lösen.

page.10.template = FILE 
# hier gibst du deine Startseite ein
[globalVar = TSFE:id=7]
page.10.template.file = fileadmin/template/3spalten.html
[else]
page.10.template.file = fileadmin/template/2spalten.html
[end]

Alles klar?

Viel Spass

Gruss

Bebbi

Sebastian Schmal ·

Hallo,

ich bin auf der suche nach so einem Typoscript nur habe ich noch ein paar fragen.

ich wollte nun für zb. die hauptseiten template_01.html verwenden und für die unterseiten template_02.html verwenden.

geht das denn auch mit der if und else abfrage?

--------------

Mein Baum:
Bild: user.ingeniumdesign.de/…/zwei_templates_01.jpg

Mein Typo3Script = root

------

# ---------------------
# Configuring the Auto-Parser for main template:
# ---------------------

plugin.tx_automaketemplate_pi1 {
content = FILE
content.file = fileadmin/templates/index.html
elements {
BODY.all = 1
BODY.all.subpartMarker = DOCUMENT_BODY
HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title
DIV.all = 1
#SPAN.all = 1
#TD.all = 1
}
relPathPrefix = fileadmin/templates/
}

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

subparts.head_navi < temp.headnavi
subparts.navi < temp.menu
subparts.rootline < temp.mypath
#subparts.flash_wrap < temp.flash
subparts.submenu_wrap < temp.submenu
subparts.content < styles.content.get
#subparts.short_news < temp.shortnews
subparts.fusstext < temp.fusstext
}

# ---------------------
# 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.includeCSS {
file1 = fileadmin/templates/inc/main.css
file2 = fileadmin/templates/inc/tt_news_v1.css
file3 = fileadmin/templates/inc/lz_gallery_temp_01.css
}
#page.stylesheet < inc/main.css
# 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

----

Mein TypoScript in zb: "WeinFrankreich"

----

# ---------------------
# PRODUKT-MENU
# ---------------------

temp.produkt_menu = HMENU
temp.produkt_menu {

# Eingangslevel
special = directory
special.value = 40

# First level menu-object, textual
1 = TMENU
1.wrap = |

# Normal state properties
1.NO = 1
1.NO{
linkWrap = <div>|</div>
}

# Enable active state and set properties:
1.ACT = 1
1.ACT{
linkWrap = <div class="produkt_menu_act">|</div>
}

1.CUR = 1
1.CUR{
linkWrap = <div class="produkt_menu_act">|</div>
}
}

# ---------------------
# Configuring the Auto-Parser for main template:
# ---------------------

plugin.tx_automaketemplate_pi1 {
content = FILE
content.file = fileadmin/templates/index_produkte.html
elements {
BODY.all = 1
BODY.all.subpartMarker = DOCUMENT_BODY
HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title
DIV.all = 1
#SPAN.all = 1
#TD.all = 1
}
relPathPrefix = fileadmin/templates/
}

# ---------------------
# Main TEMPLATE cObject for the BODY
# ---------------------

temp.mainTemplate2 = TEMPLATE
temp.mainTemplate2 {
# 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

subparts.head_navi < temp.headnavi
subparts.navi < temp.menu
subparts.rootline < temp.mypath
#subparts.flash_wrap < temp.flash
subparts.submenu_wrap < temp.submenu
subparts.produkt_menu < temp.produkt_menu
subparts.content_produkte < styles.content.get
subparts.fusstext < temp.fusstext
}

# ---------------------
# Default PAGE object:
# ---------------------

page = PAGE
page.typeNum = 0
# Copying the content from TEMPLATE for <body>-section:
page.10 < temp.mainTemplate2

----

wie könnte ich das nun ein wenig umbauen, ohne jedesmal ein neues ext.templates auf die neue seite einbinden zu müssen?