Hallo,
ich habe in Templa-Voila ein Image Field mit Fixed W+H erstellt. Es nennt sich "Main Image".
Ich kann im "Edit Page-Header" auch ein Bild auswählen.
Allerdings zeigt Typo3 das Bild auf der Seite nicht an. Das Bild soll immer 400x200 groß sein.
Der HTML-Code im Template ist:
<td class="bild">
<img src="maschinen.jpg" height="200px" width="400px" alt="" /></img>
</td>
Ich habe das img-Tag mit "Outer" gemappt.
Im Source-Code der gerenderten Seite steht dann:
<td class="bild">
<img src="typo3temp/GB/d4ff8162b3.gif" width="1" height="1" border="0" alt="" title="" /></img>
</td>
Hier der TemplaVoila-XML Auszug:
<field_mainimg type="array">
<tx_templavoila type="array">
<title>Main Image</title>
<description>Pick the HTML container element where you want the automatically made submenu items to be placed.</description>
<sample_data type="array">
<numindex index="0"></numindex>
</sample_data>
<etype>imagefixed</etype>
<typoscript>
10 = IMAGE
10.file = GIFBUILDER
10.file {
XY = 400px,200px
10 = IMAGE
10.file.import = uploads/tx_templavoila/
10.file.import.current = 1
10.file.import.listNum = 0
10.file.maxW = 400px
10.file.minW = 400px
10.file.maxH = 200px
10.file.minH = 200px
}
</typoscript>
</tx_templavoila>
<tceforms type="array">
<config type="array">
<type>group</type>
<internal_type>file</internal_type>
<allowed>gif,png,jpg,jpeg</allowed>
<max_size>1000</max_size>
<uploadfolder>uploads/tx_templavoila</uploadfolder>
<show_thumbs>1</show_thumbs>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
</config>
<label>Main Image</label>
</tceforms>
</field_mainimg>
Bitte helft mir, ich habe keine Idee mehr.
Was mache ich nur falsch?
Hi sommersohn
probier mal folgendes
<field_mainimg type="array">
<tx_templavoila type="array">
<title>Main Image</title>
<description>Pick the HTML container element where you want the automatically made submenu items to be placed.</description>
<sample_data type="array">
<numindex index="0"></numindex>
</sample_data>
<etype>imagefixed</etype>
<typoscript>
10 = IMAGE
10.file = GIFBUILDER
10.file {
XY = 400px,200px
10 = IMAGE
10.file.import = uploads/tx_templavoila/
10.file.import.current = 1
10.file.import.listNum = 0
}
<![CDATA[
10 = IMAGE
10.file.import = fileadmin/image/
10.file.import.current = 1
10.file.import.listNum = 0
10.file.maxW = 400px
10.file.minW = 400px
10.file.maxH = 200px
10.file.minH = 200px
]]>
</typoscript>
</tx_templavoila>
<tceforms type="array">
<config type="array">
<type>group</type>
<internal_type>file</internal_type>
<allowed>gif,png,jpg,jpeg</allowed>
<max_size>1000</max_size>
<uploadfolder>fileadmin/image</uploadfolder>
<show_thumbs>1</show_thumbs>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
</config>
<label>Main Image</label>
</tceforms>
</field_mainimg>
Dazu brauchst du einen ordner image im fileadmin ordner.
Wenn dein bild groesser/kleiner ist als die 400x200 vergibt Typo3 einen kryptischen namen. ausserdem wird es so nicht in ein *.gif umgewandelt, sprich der gifbuilder ist ausgeschaltet.
eine andere moeglichkeit waere
10 = IMAGE
10.file = GIFBUILDER
10.file {
XY = 400px,200px
[b]}[/b]
10.file.import = uploads/tx_templavoila/
10.file.import.current = 1
10.file.import.listNum = 0
10.file.maxW = 400px
10.file.minW = 400px
10.file.maxH = 200px
10.file.minH = 200px
Die fette klammer hab ich verschoben und
10 = IMAGE
entfernt das sollte auch funzen (nicht getestet)
gruesse aus dem verschneiten stuttgart kilian
Nochmal ich
wichtig ist auch das TypoScript so geschrieben wird und nicht typoscript
nochmals gruesse kilian
Hi,
erstmal vielen Dank für Deine Antwort und die Vorschläge.
Habe beide ausprobiert, aber keine der Möglichkeiten bringt bessere Ergebnisse:
<img src="typo3temp/GB/b3ad5ef214.gif" width="1" height="1" border="0" alt="" title="" /></img>
Der Gifbuilder (GDLib) funktioniert korrekt (laut "Configuration").
Was macht denn eigentlich dieses <![CDATA[ ?
hi sommersohn
hab gerade gesehen, dass du deinen img-tag in der vorlage zweimal beendest
<img /> und </img>
vielleicht liegt es daran
gruss
Hi,
habe mir die Datei noch einmal angeschaut. Habe den "Slash" im <img /> nicht mehr gefunden. Das img-Tag ist ok.
Wie wird das "Image-Field" denn für gewöhnlich verwendet? Muss ich da irgendwie ein Container-Element drum herum machen, oder so?
hab grad gesehen das ich im TS-Code was stehen lassen habe was da nicht reingehört hier nochmal die richtige variante.
<field_mainimg type="array">
<tx_templavoila type="array">
<title>Main Image</title>
<description>Pick the HTML container element where you want the automatically made submenu items to be placed.</description>
<sample_data type="array">
<numindex index="0"></numindex>
</sample_data>
<etype>imagefixed</etype>
<TypoScript>
[CDATA[
10 = IMAGE
10.file.import = fileadmin/image/
10.file.import.current = 1
10.file.import.listNum = 0
10.file.maxW = 400px
10.file.minW = 400px
10.file.maxH = 200px
10.file.minH = 200px
]]
</TypoScript>
</tx_templavoila>
<tceforms type="array">
<config type="array">
<type>group</type>
<internal_type>file</internal_type>
<allowed>gif,png,jpg,jpeg</allowed>
<max_size>1000</max_size>
<uploadfolder>fileadmin/image</uploadfolder>
<show_thumbs>1</show_thumbs>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
</config>
<label>Main Image</label>
</tceforms>
</field_mainimg>
du musst kein CO drumherum machen.
wenn das neuets nicht geht, probiere mal ein content element nur mit einem bild zu mappen.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Unbenanntes Dokument</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>hier auf das img mappen<br><img src="bild.gif" alt="derAlt"></td>
</tr>
</table>
</body>
</html>
einfach den body mappen und auf das <img alt="" /> ein Mapping Type:element / Editing Type: image fixed / set outer.
in der DS kannst du jetzt deine groessen festlegen.
geht das??
Sommersohn schrieb
Was macht denn eigentlich dieses <![CDATA[ ?
Hi! Der ist nur dazu da um auch sonderzeichen im XML nutzen zu können. Wie z.b. das < oder das >.