CMS_IMG[1] ?

Gesperrt
pw
Beiträge: 16
Registriert: Di 30. Mär 2004, 19:18
Kontaktdaten:

CMS_IMG[1] ?

Beitrag von pw »

Hallo zusammen,

als contenido Neuling habe ich -logischerweise- eine Frage:

ich habe ein Modul mit folgendem Inhalt:

Code: Alles auswählen

<table width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr>
	           <td valign="top"><?php
if ("CMS_IMG[1]" != "") {
    $img = '<img src="CMS_IMG[1]" border="0">';
    if ("CMS_LINK[1]" != "http://") {
       $img = sprintf('<a href="%s" target="%s">%s</a>',"CMS_LINK[1]", "CMS_LINKTARGET[1]", $img);
    }
    echo $img;
}
?></td>
                </tr>
</table>
<table width="100%" cellpadding="4" cellspacing="0" border="0">
 	<tr>
	           <td valign="top" class="contentHead1"><?php echo "CMS_HTMLHEAD[1]"; ?></td>
                </tr>
	<tr>
	           <td valign="top" class="contentHead2"><?php echo "CMS_HTMLHEAD[2]"; ?></td>
                </tr>
	<tr>
	           <td valign="top" class="contentHtml"><?php echo "CMS_HTML[1]"; ?></td>
                </tr>
                <tr>
	           <td valign="top" class="contentHtml"><?php echo "CMS_HTML[2]"; ?></td>
                </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" height="100%">
                <tr><td height="100%">&nbsp;</td></tr>
</table>

Wenn ich einen Artikel anlegen möchte mit diesem Modul in einem Template, funktioniert das auch prächtig bis auf das oben eingebaute Bild. Hier habe ich keinen Link im Edit-Modus, wo ich ein Bild auswählen könnte.
Alle Textboxen sind perfekt vorhanden so wie es sein soll....

Weiß jemand Rat?

Vielen Dank schon mal!
timo
Beiträge: 6284
Registriert: Do 15. Mai 2003, 18:32
Wohnort: Da findet ihr mich nie!
Kontaktdaten:

Beitrag von timo »

der edit-button wird über CMS_IMGDESCR[1] getriggert...
pw
Beiträge: 16
Registriert: Di 30. Mär 2004, 19:18
Kontaktdaten:

Beitrag von pw »

Ah danke! das klappt nun.

Wenn ich aber keinen Link zum Bild angegeben habe, wird trotzdem einer geschrieben.

wie müßte folgender Code umgebaut werden, damit dann kein href mehr um das img tag geschrieben wird?

Code: Alles auswählen

if ("CMS_LINK[1]" != "http://" && "CMS_LINK[1]"!="") {
        $img = sprintf('<a href="%s" target="%s">%s</a>',"CMS_LINK[1]", "CMS_LINKTARGET[1]", $img);
}

pw
Beiträge: 16
Registriert: Di 30. Mär 2004, 19:18
Kontaktdaten:

Beitrag von pw »

ich hab nun

Code: Alles auswählen

 if ("CMS_LINK[1]" != "http://" && "CMS_LINK[1]"!="" && "CMS_LINKTARGET[1]" !="") {
        $img = sprintf('<a href="%s" target="%s">%s</a>',"CMS_LINK[1]", "CMS_LINKTARGET[1]", $img);

    }
draus gemacht. schaut ganz gut aus, solange man bei jedem Bild dann eben den target-Frame angibt, das auch wirklich verlinkt ist......

Ich denke es gibt sicher eine bessere Abänderung........ lasst was hören :-)
Gesperrt