Zum Inhalt springen

Sprachabhängiger Bildwechsel mit Autoparser-Template

Erstellt am 26. April 2006 · Noch keine Antworten

Tags: Bilder, Frage

ph.​bundschuh ·

Hallo zusammen,
jetzt hab ich schon 2 Stunden das Forum durchsucht und tausend Code-Schnipsel ausprobiert, aber nichts hat gefruchtet.

Wie kann ich ein Bild im Template (oder allgemein einen Marker/Subpart) sprachabhängig steuern.
Deutsche Sprache = deutsches Logo, englische Sprache = englisches Logo.

Mein Template-Setup sieht so aus:

 #Pfad zum eigenen Template
plugin.tt_news.templateFile = fileadmin/templates/news_template.tmpl
# Variable pid_list wird leer gemacht
plugin.tt_news.pid_list >
# PID  wird über eine Konstante festgelegt
plugin.tt_news.pid_list = {$pid_list}
#Rekursiv, wenn euere News in Unterordner sind
plugin.tt_news.recursive >
plugin.tt_news.recursive = 1
#UID der Seite Singleview
plugin.tt_news.singlePid = {$singlePid}
#Archive Aktivieren
#UID der Archiveseite
plugin.tt_news {
  archive = 1
  archiveTypoLink.parameter = {$archiveTypoLink}
}

plugin.tx_jwcalendar_pi1._CSS_DEFAULT_STYLE >

# Set default language
config.locale_all = de_DE@euro

config.linkVars = L
config.sys_language_uid = 0
config.language = de
config.locale_all = de_DE

# English language, sys_language.uid = 1
[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.language = en
config.locale_all = english
[global]

# Frensh language, sys_language.uid = 2
[globalVar = GP:L = 2]
config.sys_language_uid = 2
config.language = fr
config.locale_all = frensh
[global]


# Auto-Parser für Haupttemplate konfigurieren
plugin.tx_automaketemplate_pi1 {
# Template-File einlesen:
  content = FILE
  content.file = fileadmin/templates/standard.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
  }
 
# Prefix all relative paths with this value:
  relPathPrefix = fileadmin/templates/
}

# Hauptmenu (linke Seite) cObject
temp.menu_1 = HMENU

# Hauptmenu Ebene 1
temp.menu_1.1 = TMENU
temp.menu_1.1 {
  # Status Normal
  NO.allWrap = <div class="menu1-level1-no"> | </div>
  NO.beforeImg =  fileadmin/templates/images/moreobjects.gif
   # Status Aktiv Eigenschaften
  ACT = 1
  ACT.allWrap = <div class="menu1-level1-act"> | </div>
  ACT.beforeImg =  fileadmin/templates/images/lessobjects.gif 
  # SPC 
  SPC = 1 
  SPC.beforeImg =  fileadmin/templates/images/spacer_15.gif
  SPC.doNotShowLink = 1
}
# Hauptmenu Ebene 2
temp.menu_1.2 = TMENU
temp.menu_1.2 {
    # Status Normal
  NO.allWrap = <div class="menu1-level2-no"> | </div>
  NO.beforeImg =  fileadmin/templates/images/icondoc.gif
    # Status Aktiv Eigenschaften
  ACT = 1
  ACT.allWrap = <div class="menu1-level2-act"> | </div>
  ACT.beforeImg =  fileadmin/templates/images/icondoc.gif
}
# Hauptmenu Ebene 3
temp.menu_1.3 = TMENU
temp.menu_1.3 {
    # Status Normal
  NO.allWrap = <div class="menu1-level3-no"> | </div>
  #NO.beforeImg =  fileadmin/templates/images/icondoc.gif
    # Status Aktiv Eigenschaften
  ACT = 1
  ACT.allWrap = <div class="menu1-level3-act"> | </div>
  #ACT.beforeImg =  fileadmin/templates/images/icondoc.gif
}



# 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
 
# Dynamisches Menu (Hauptnavigation) bei subpart ###menu_1### einfügen:
  subparts.menu_1 < temp.menu_1

# Sitepath einfügen:
  subparts.sitepath < temp.sitepath

# Inhalte bei subpart ###content### einfügen:
  subparts.maincontent < styles.content.get

subparts.leftTeaser < styles.content.getLeft

subparts.rightTeaser < styles.content.getRight

marks.LANGUAGE = PHP_SCRIPT
marks.LANGUAGE.file = fileadmin/custom-scripts/my_languageMenu.php

##Autoparser end:
}


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


# eMail-Adressen mit JavaScript vor Spam schützen
config.spamProtectEmailAddresses = 2
config.spamProtectEmailAddresses_atSubst = @

# Indexierung der Seiteninhalte
page.config.index_enable = 1
page.config.index_externals = 1
config.language = de

# Externe und eMail - Links gesondert kennzeichnen
includeLibs.user_typolink = fileadmin/custom-scripts/user_typolink.php
tt_content.text.20.parseFunc {
  tags.link.typolink.userFunc = user_typolink_class->main
}

# Default PAGE object:
page = PAGE
page.typeNum = 0
page.bodyTag = <body bgcolor="#C0C0C0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

# Copying the content from TEMPLATE for <body>-section:
page.10 < temp.mainTemplate

tt_content.mailform.20.target = _self

# tt_content.image.20.1.file.params = -border 2 -bordercolor '#808080'
# tt_content.textpic.20.1 < tt_content.image.20.1

tt_content.image.20.1.imageLinkWrap {
   bodyTag = <body bgcolor="#cccccc" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
   width = 960m
   title = Bild von www.ultramarin.com
   JSwindow.expand = 0,20
   wrap = <a href="javascript:close();"> | </a><br /><table align="right"><tr><td><font face="verdana,arial,helvetica,sans-serif" size="2" color="#666666">Copyright by Colostranova GmbH</font></td></tr></table>
}
 
# Copying the content from TEMPLATE for <head>-section:
page.headerData.10  < temp.headTemplate

page.headerData.20 = TEXT
page.headerData.20.value =   <link href="fileadmin/templates/calendar/jw_calendar.css" rel="stylesheet" media="screen" />

Hat jemand eine Idee, wo ich was reinbauen muss?

Grüße,

Philipp