Zum Inhalt springen

Grafik/Designvorlage/Template - unterschiedliche Bilder nutz

Erstellt am 16. Februar 2005 · 12 Antworten · letzte Antwort am 16. Februar 2005

Tags: Bilder, Frage

Andrea_Herzog ·

Hallo zusammen,
ich möchte gerne auf einer Webseite auf verschiedenen Seiten 4 unterschiedliche Bilder in den Banner einbinden.
z. B. auf der 1. Seite ein Auto, der 2. Seite ein Boot, der 3....
Mein Problem ist, dass ich das nicht über Ebenen steuern kann, weil die Bilder nicht Ebenen zugeordnet sind sondern Inhalten: das Auto ist mal auf Ebene 1 und mal auf Ebene 3.

Hat jemand eine Idee, wie ich das einbinde? Rootlevel kann ich ja nicht nutzen, hilft nicht weiter.
Mir ist da auch schon so ein Gedanke wie ein "staatischer Content" gekommen. Aber lieber hätte ich das im Template.
Hat jemand eine Idee?

Viele Grüße,
Andrea

hardcoder ·

einmal posten reicht :-)

a) ext. macina_banners
b)

#this example generates a complete img-tag 
temp.logo = COA 
temp.logo { 
10 = IMAGE 
#Pagetilte as alt-tag 
10.alttext.cObject = TEXT 
10.alttext.cObject.value = {page:title} 
10.alttext.cObject.insertData = 1 
#max. width of image 
10.file.maxW = 186 
#Standardimage (take this if there is no other) 
10.file.import { 
cObject = TEXT 
cObject.value = fileadmin/path/my_standard_image.jpg 
cObject.override { 
required = 1 
#get the image of actual page 
#if there is none take image from previous tree. 
#do this until u find one 
data = levelmedia: -1, "slide" 
wrap = uploads/media/ | 
#take 1st image of Filelist (starts counting with 0) 
listNum = 0 
} 
} 
10 { 
#if u find an image wrap it with div-tag 
stdWrap.required = 1 
stdWrap.wrap = <div id="cimage">|</div> 
} 
}

marks.MY_LOGO < temp.logo
Andrea_Herzog ·

Hi,
vielen Dank für deine schnelle Antwort. Ich habe den Code eingebunden. Einen Marker LOGO gesetzt.
Der Seitentyp der Testseite ist ERWEITERT, das Bild habe ich bei Dateien (attach Media files) eingestellt.
Aber nichts passiert. In der Browservorschau habe ich nur ###LOGO### stehen.
Was habe ich falsch gemacht?
Gruß Andrea

 temp.logo = COA
      temp.logo {
      10 = IMAGE
       #Pagetilte as alt-tag
      10.alttext.cObject = TEXT
      10.alttext.cObject.value = {page:title}
      10.alttext.cObject.insertData = 1
       #max. width of image
      10.file.maxW = 100
       #get the image of actual page
       #if there is none take image from previous tree.
      data = levelmedia: -1, "slide"
      wrap = uploads/media/ |
       #take 1st image of Filelist (starts counting with 0)
      listNum = 0
      }
      
      10 {
       #if u find an image wrap it with div-tag
      stdWrap.required = 1
      stdWrap.wrap = <div id="cimage">|</div>
      }

   marks.LOGO < temp.logo
hardcoder ·

Hi,

also irgenfwie hast Du zuviel weggelassen (z. B. :10.file.import {):-). temp.logo hört bei dir nach listNum = 0 auf. Ich schlage vor den code wie unten zu nehmen und als standardimage ein "clear.gif" zu nehmen ... wenn du keines haben willst

#this example generates a complete img-tag 
temp.logo = COA 
temp.logo { 
  10 = IMAGE 
  #Pagetilte as alt-tag 
  10.alttext.cObject = TEXT 
  10.alttext.cObject.value = {page:title} 
  10.alttext.cObject.insertData = 1 
  #max. width of image 
  10.file.maxW = 186 
  #Standardimage (take this if there is no other) 
    10.file.import { 
    cObject = TEXT 
    cObject.value = fileadmin/path/my_standard_image.jpg 
    cObject.override { 
      required = 1 
      #get the image of actual page 
      #if there is none take image from previous tree. 
      #do this until u find one 
      data = levelmedia: -1, "slide" 
      wrap = uploads/media/ | 
      #take 1st image of Filelist (starts counting with 0) 
      listNum = 0 
    } 
  } 
  10 { 
    #if u find an image wrap it with div-tag 
    stdWrap.required = 1 
    stdWrap.wrap = <div id="cimage">|</div> 
  } 
} 

marks.MY_LOGO < temp.logo
Andrea_Herzog ·

Hallo Hardcoder,
ich scheine einfach zu dumm zu sein. Esfunktioniert einfach nicht. Hier nochmal dein Code, wie ich ihn eingebunden habe.

Ist mir schon echt peinlich....
Gruß Andrea

temp.logo = COA
temp.logo {
10 = IMAGE
#Pagetilte as alt-tag
10.alttext.cObject = TEXT
10.alttext.cObject.value = {page:title}
10.alttext.cObject.insertData = 1
#max. width of image
10.file.maxW = 100
#standardimage (take it, if there is no other)
10.file.import {
cObject = TEXT
cObject. value = fileadmin/biv/images/image.gif
cObject.override {
required = 1
#get the image of actual page
#if there is none take image from previous tree.
# do this until you find one
data = levelmedia: -1, "slide"
wrap = uploads/media/ |
#take 1st image of Filelist (starts counting with 0)
listNum = 0
}
}
10 {
#if u find an image wrap it with div-tag
stdWrap.required = 1
stdWrap.wrap = <div id="cimage">|</div>
}
}
marks.LOGO < temp.logo

hardcoder ·

ok ... wahrscheinlich bin ICH zu blöd :-)

marks.LOGO muss narütlich irgendwo bei Dir stehen wo Du Deine anderen MArker substituierst und NICHT direkt unter der Definition der Variable temp.LOGO - sorry :o :

page.10=TEMPLATE
page.10{
  template=FILE
  template.file=fileadmin/templates/main_template.tmpl

  workOnSubpart=DOCUMENT_BODY

  marks.IRGENDWAS = irgendwas

  marks.LOGO < temp.LOGO

  }

bei alle dem - ein Clear all cache hilf manchmal auch über "merkwürdiges" Verhalten hinweg ... :-)

Andrea_Herzog ·

Hi Hardcoder,
nee, ich bin zu doof.
Hier nochmal der quellcode. Der Marker/Die Marker sind unten gesetzt. Muss ich dem Marker marks.LOGO noch etwas zufügen?
Gruß Andrea

# Default PAGE object:
page = PAGE
page.typeNum = 0
page.stylesheet = fileadmin/biv/style/style.css
page.10 = TEMPLATE
page.10 {
   template = FILE
   template.file = fileadmin/biv/vorlage.html
   workOnSubpart = DOKUMENT


    temp.logo = COA
      temp.logo {
      10 = IMAGE
       #Pagetilte as alt-tag
      10.alttext.cObject = TEXT
      10.alttext.cObject.value = {page:title}
      10.alttext.cObject.insertData = 1
       #max. width of image
       10.file.maxW = 100 
           #standardimage (take it, if there is no other)
           10.file.import {
           cObject = TEXT
           cObject. value = fileadmin/biv/images/image.gif
           cObject.override {
               required = 1
              #get the image of actual page
              #if there is none take image from previous tree.
              # do this until you find one
              data = levelmedia: -1, "slide"
              wrap = uploads/media/ |
              #take 1st image of Filelist (starts counting with 0)
              listNum = 0
              }
       }  
      10 {
       #if u find an image wrap it with div-tag
      stdWrap.required = 1
      stdWrap.wrap = <div id="cimage">|</div>
      }
    }
   marks.LOGO < temp.logo 
     
   marks.INHALT = CONTENT
   marks.INHALT {
      table = tt_content
      select.orderBy = sorting
      select.where = colPos=0
      }
     marks.LINKS = IMAGE
     marks.LINKS.file =GIFBUILDER
     marks.LINKS.file {
        XY = 150, 20
        5 = IMAGE
        5.file = fileadmin/biv/images/image.gif
        10 = TEXT
        10.text.field = title
        10.offset = 20, 20
        10.niceText = 1
        10.fontFile = fileadmin/biv/images/verdana.ttf
        10.fontSize = 15
        10.fontColor = red
       }
.......
hardcoder ·

ok ... nimm die ganze temp.logo definition und stell die ganz an den anfang des Typoscripts ... und NICHT innerhalb von { } :-)

dann sieht das so aus:

# Default PAGE object: 

    temp.logo = COA 
      temp.logo { 
      10 = IMAGE 
       #Pagetilte as alt-tag 
      10.alttext.cObject = TEXT 
      10.alttext.cObject.value = {page:title} 
      10.alttext.cObject.insertData = 1 
       #max. width of image 
       10.file.maxW = 100 
           #standardimage (take it, if there is no other) 
           10.file.import { 
           cObject = TEXT 
           cObject. value = fileadmin/biv/images/image.gif 
           cObject.override { 
               required = 1 
              #get the image of actual page 
              #if there is none take image from previous tree. 
              # do this until you find one 
              data = levelmedia: -1, "slide" 
              wrap = uploads/media/ | 
              #take 1st image of Filelist (starts counting with 0) 
              listNum = 0 
              } 
       }  
      10 { 
       #if u find an image wrap it with div-tag 
      stdWrap.required = 1 
      stdWrap.wrap = <div id="cimage">|</div> 
      } 
    } 

page = PAGE 
page.typeNum = 0 
page.stylesheet = fileadmin/biv/style/style.css 
page.10 = TEMPLATE 
page.10 { 
   template = FILE 
   template.file = fileadmin/biv/vorlage.html 
   workOnSubpart = DOKUMENT 



   marks.LOGO < temp.logo 
      
   marks.INHALT = CONTENT 
   marks.INHALT { 
      table = tt_content 
      select.orderBy = sorting 
      select.where = colPos=0 
      } 
     marks.LINKS = IMAGE 
     marks.LINKS.file =GIFBUILDER 
     marks.LINKS.file { 
        XY = 150, 20 
        5 = IMAGE 
        5.file = fileadmin/biv/images/image.gif 
        10 = TEXT 
        10.text.field = title 
        10.offset = 20, 20 
        10.niceText = 1 
        10.fontFile = fileadmin/biv/images/verdana.ttf 
        10.fontSize = 15 
        10.fontColor = red 
       } 
.......
Andrea_Herzog ·

#giggle# :p

Hi Hardcoder,

jetzt klappt es. Ich weiss gar nicht, wie ich dir danken soll.

Big Kisses
Andrea

Jetzt werde ich das ganze mal mit zwei logos ausprobieren.
Ich gebe den Code durch, wenn es klappt.

Eine unendlich dankbare
Andrea

hardcoder ·

es geht so mit bis zu 5 logos (weil das media-feld so erstmal nur 5 aufnimmt) ...

für jedes logo nimmt man den gleichen code mit einer einzigen Änderung: listNum 0 bis 4

für 5 würde das so aussehen:

temp.logo1 < temp.logo
temp.logo1.10.cObject.override.listnum = 1

temp.logo2 < temp.logo
temp.logo1.10.cObject.override.listnum = 2

temp.logo3 < temp.logo
temp.logo1.10.cObject.override.listnum = 3

temp.logo4 < temp.logo
temp.logo1.10.cObject.override.listnum = 4

.
.
.
marks.LOGO < temp.logo
marks.LOGO1 < temp.logo1
marks.LOGO2 < temp.logo2
marks.LOGO3 < temp.logo3
marks.LOGO4 < temp.logo4

:-)

ach

und Danke für den Kuss .....

Andrea_Herzog ·

Hi Hardcoder,
auch das klappt.
Allerdings muss ich sehen, ob ich mit den 5 Bildern auskomme.
Auf der Home sollen 2 verschiedene Bilder sein.
Auf der Seitengruppe ABC auch 2.
Ich hoffe, dass er damit kann.

Ich bin gespannt.
Ich werde die fertige Seite dann zum "zerpflücken" einstellen.

Nochmals vielen Dank,
Andrea
😃

hardcoder ·

5 meint: 5 gleichzeitig ....

du kannst unterschidliche bilder 1 und 2 haben auf der page id = x

und 2 andere auf page id = y

jeweils beide würden gleichzeitig dargestellt werden ...