Zum Inhalt springen

Bild wird nicht angezeigt

Erstellt am 11. September 2004 · 16 Antworten · letzte Antwort am 3. November 2004

Tags: Bilder, Frage

Ici ·

Hallo

Würde ja nur zu gerne sagen, dass es nun funktioniert. Aber leider noch immer nicht... Habe nun folgenden Code im Setup:

# Template
temp.tmpmain = TEMPLATE
temp.tmpmain {
  template = FILE
  template.file = fileadmin/template/main/tmpmain.html
  relPathPrefix = fileadmin/template/main/ 
  relPathPrefix.img = fileadmin/template/main/images/
}

# Default
page = PAGE
page.typeNum = 0
page.10 < temp.tmpmain

Gruss Ici

jenses ·

Hallo Ici !
Habe das gerade mal bei mir nachgebastelt,
funktioniert auch nicht mit "relPathPrefix.img".
Ich vermute mal, das es nur mit Bildern funktioniert,
die man direkt über das Template einbaut,
aber nicht mit Bildern, die durch die HTML-Vorlage positioniert werden.

Was bei mir funktioniert :
HTML-Vorlage & Bilder befinden sich im gleichen Ordner fileadmin/template/main.
Im Setup steht :

relPathPrefix = fileadmin/template/main/

viele Grüße
jenses

jenses ·

Hallo Ici !
Ich hab mich noch mal umgeschaut im Forum.
Es funktioniert wohl nicht auf die Weise, wie du es versuchst.
relPathPrefix funktioniert wohl nur im Zusammenhang mit der Autoparser-Erweiterung.

Workaround :
1. Installiere dir die Extension: Template Auto-parser.
2. Ändere deine HTML-Vorlage wie folgt :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<title>Untitled Document</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
</head> 

<body> 
<!-- ###DOKUMENT### begin -->
<table align="center"> 
<tr><td><img src="images/top_main.jpg" width="750" height="80"></td></tr>
</table> 
<!-- ###DOKUMENT### end -->
</body> 
</html>

3. Folgendes ins Setup deines Templates :

# Plugin Konfiguration:
plugin.tx_automaketemplate_pi1 {
content = FILE
content.file = fileadmin/template/main/tmpmain.html
elements {
BODY.all = 1
BODY.all.subpartMarker = DOCUMENT_BODY

HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title
TABLE.all = 1
}
relPathPrefix = fileadmin/template/main/
}

page = PAGE
page.typeNum = 0

temp.headTemplate = TEMPLATE
temp.headTemplate {
  template =< plugin.tx_automaketemplate_pi1
  workOnSubpart = DOCUMENT_HEADER
}
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
  template =< plugin.tx_automaketemplate_pi1
  workOnSubpart = DOCUMENT_BODY
}

page.10 < temp.mainTemplate
page.headerData.10 < temp.headTemplate

Getestet auf Funktionstüchtigkeit.

viele Grüße
jenses

Ici ·

Halloo Jenses

Jetzt funktionierts... Habe die Bilder nun doch in den Ordner images getan.

Im Setup habe ich den Code auf

template.relPathPrefix.img = fileadmin/template/main/images

geändert. Das "template." hat also gefehlt.

Danke für die Hilfe!

Gruss Ici

jenses ·

Hallo Ici !

Könntest du mir bitte HTML-Vorlage und Setup schicken ?
Ich hab schon alles Mögliche versucht,
aber bei mir funktioniert deine Lösung nicht !

viele Grüße
jenses

Ici ·
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table align="center" width="750" bgcolor="#F7F7F7" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tr><td><img src="images/top_main.jpg" width="750" height="80"></td></tr>
</table>
</td></tr>
<tr><td height="5"></td></tr>
<tr><td>
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td width="195" height="500"></td>
<td width="5" height="500"></td>
<td width="550" height="500"></td>
</tr></table>
</td></tr>
</table>
</body>
</html>
# Template
temp.tmpmain = TEMPLATE
temp.tmpmain {
  template = FILE
  template.file = fileadmin/template/main/tmpmain.html
  template.relPathPrefix = fileadmin/template/main/
}

# Default
page = PAGE
page.typeNum = 0
page.10 < temp.tmpmain
Ici ·

Noch ein Nachtrag... Nachdem ich nun eine Unterseite erstellt habe, wird das Bild nun wieder nicht angezeigt. Habe nun deine Version integriert und die funktioniert einwandfrei. Danke!

Gruss Ici

webs ·
jenses schrieb

Hallo Ici !
Ich hab mich noch mal umgeschaut im Forum.
Es funktioniert wohl nicht auf die Weise, wie du es versuchst.
relPathPrefix funktioniert wohl nur im Zusammenhang mit der Autoparser-Erweiterung.

Workaround :
1. Installiere dir die Extension: Template Auto-parser.
2. Ändere deine HTML-Vorlage wie folgt :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<title>Untitled Document</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
</head> 

<body> 
<!-- ###DOKUMENT### begin -->
<table align="center"> 
<tr><td><img src="images/top_main.jpg" width="750" height="80"></td></tr>
</table> 
<!-- ###DOKUMENT### end -->
</body> 
</html>

3. Folgendes ins Setup deines Templates :

# Plugin Konfiguration:
plugin.tx_automaketemplate_pi1 {
content = FILE
content.file = fileadmin/template/main/tmpmain.html
elements {
BODY.all = 1
BODY.all.subpartMarker = DOCUMENT_BODY

HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title
TABLE.all = 1
}
relPathPrefix = fileadmin/template/main/
}

page = PAGE
page.typeNum = 0

temp.headTemplate = TEMPLATE
temp.headTemplate {
  template =< plugin.tx_automaketemplate_pi1
  workOnSubpart = DOCUMENT_HEADER
}
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
  template =< plugin.tx_automaketemplate_pi1
  workOnSubpart = DOCUMENT_BODY
}

page.10 < temp.mainTemplate
page.headerData.10 < temp.headTemplate

Getestet auf Funktionstüchtigkeit.

viele Grüße
jenses

Schön und gut, aber mein Body-Tag wird komischer weise nicht berücksichtigt, wie kann ich das mit dem Auto-Parser-Plugin zum Laufen bringen?

greetz!
webs

webs ·

aber wenn er innerhalb der subparts liegt.
erstellt er folgendes:

...
...
</head>
<body bgcolor="#FFFFFF">

<!-- ###DOKUMENT### begin -->
<body>
</body>
</html>

Und man bekommt natürlich anstatt des Inhalts nur ne weiße seite o.O

webs ·

Hier noch mal, Dein Beispiel @jenses

Setup-code

# Plugin Konfiguration: 
 plugin.tx_automaketemplate_pi1 { 
 content = FILE 
 content.file = fileadmin/ec_templates/tempmain.htm
 elements { 
 BODY.all = 1 
 BODY.all.subpartMarker = DOCUMENT_BODY 
 
 HEAD.all = 1 
 HEAD.all.subpartMarker = DOCUMENT_HEADER 
 HEAD.rmTagSections = title 
 TABLE.all = 1 
 } 
 relPathPrefix = fileadmin/ec_templates/
 } 
 
 page = PAGE
 page.typeNum = 0 
 
 temp.headTemplate = TEMPLATE 
 temp.headTemplate { 
   template =< plugin.tx_automaketemplate_pi1 
   workOnSubpart = DOCUMENT_HEADER 
 } 
 temp.mainTemplate = TEMPLATE 
 temp.mainTemplate { 
   template =< plugin.tx_automaketemplate_pi1 
   workOnSubpart = DOCUMENT_BODY 
 } 
 
page.10 < temp.mainTemplate 
page.headerData.10 < temp.headTemplate

HTML-code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<!-- ###DOKUMENT### begin -->
<body bgcolor="#000000">
<table align="center">
<tr><td><img src="_data/_globals/g_head.jpg"></td></tr>
</table>
</body>
<!-- ###DOKUMENT### end -->
</html>

Generiert wird folgendes code

<!DOCTYPE html
	PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- 
	This website is brought to you by TYPO3 - get.content.right
	TYPO3 is a free open source Content Management Framework created by Kasper Skaarhoj and licensed under GNU/GPL.
	TYPO3 is copyright 1998-2004 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
	Information and contribution at http://www.typo3.com
-->

	<style type="text/css">
		/*<![CDATA[*/
	<!--
	/* default styles for extension "tx_thmailformplus_pi1" */
  .tx-thmailformplus-pi1 H2 { margin-top: 0px; margin-bottom: 0px; }
	-->
		/*]]>*/
	</style>
 
  
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
 
	<title>www.domain.de</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<meta name="generator" content="TYPO3 3.6 CMS" />
	<script type="text/javascript">
		/*<![CDATA[*/
	<!--
		browserName = navigator.appName;
		browserVer = parseInt(navigator.appVersion);
		var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
		if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror") {version = "n3";} else {version = "n2";}
			// Blurring links:
		function blurLink(theObject)	{	//
			if (msie4)	{theObject.blur();}
		}
		
	// -->
		/*]]>*/
	</script>


</head>
<body bgcolor="#FFFFFF">

<table align="center"> 
 <tr><td><img src="fileadmin/ec_templates/_data/_globals/g_head.jpg"></td></tr> 
 </table> 

</body>
</html>

Woran kann's wohl liegen?

jenses ·

1. Die zeitgemäße Variante : man schreibt den ganzen Body-Kram in das Stylesheet und bindet dieses ein :
page.stylesheet = mein_stylesheet.css
page.bodyTag =
#damit er nicht bgcolor="#FFFFFF" ausgibt

2.Variante ins Template :
page.bodyTag = <body bgColor = "#DBD9D9">
oder welche Farbe auch immer.
Hat den Nachteil, das der Validator über bgcolor meckern wird 😉

viele Grüße
jenses

webs ·

danke, das kenn ich schon, nur ich dachte dass body-tag (wie auch der header) über autoparser irgendwie automatisch eingebunden wird. aber naja wenns nicht geht...