... Und hier noch der Workaround
mit separatem Texteingabeformular:
In der Con_type neuen Eintrag CMS_HTMLINSITE erzeugen. (z. B. mit phpMyAdmin)
Feldinhalte:
idtype: 11
type: CMS_HTMLINSITE
Code: Alles auswählen
/**
* CMS_HTMLINSITE */
$tmp = $a_content['CMS_HTMLINSITE'][$val];
$tmp = urldecode($tmp);
$tmp = AddSlashes(AddSlashes($tmp));
$tmp = str_replace("\\\'","'",$tmp);
if ($edit) {
$before="<div id=\"HTMLINSITE_".$db->f("idtype")."_".$val."\" onFocus=\"this.style.border='1px solid #bb5577'\"".
" onBlur=\"this.style.border='1px dashed #bfbfbf'\" style=\"border:1px dashed #bfbfbf\" contentEditable=\"true\" >";
$editbutton = "</div><a href=\"javascript:setcontent('$idartlang','".$sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTMLINSITE&typenr=$val&lang=$lang")."')\">
<img src=\"".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edittext.gif\" border=\"0\"></a>
<a href=\"javascript:setcontent('$idartlang','0')\"><img src=\"".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_speichern.gif\" border=\"0\"> </a>";
$editbutton = AddSlashes(AddSlashes($editbutton));
$editbutton = str_replace("\\\'","'",$editbutton);
$before= AddSlashes(AddSlashes($before));
$before = str_replace("\\\'","'",$before);
if ($tmp == "") {
$tmp = " ";
}
$tmp = $before.$tmp.$editbutton;}
(Es handelt sich um den Code aus dem "CMS_HTML"-Eintrag. "CMS_HTML" ist überall durch "CMS_HTMLINSITE" ersetzt, "HTML_" im div-Tag durch "HTMLINSITE_". Der Link zum "Edit-Button" in der $editbutton ist jetzt wieder da.)
description: Text / Insite-Editing
Andere Felder werden automatisch belegt
Datei include.CMS_HTMLINSITE.php erstellen
Code: Alles auswählen
<?php
/******************************************
* File : include.CMS_HTMLINSITE.php
* Project : Contenido
* Descr : Include file for editiing
* content of type CMS_HTMLINSITE
*
******************************************/
if ($doedit == "1") {
consaveContentEntry($idartlang, "CMS_HTMLINSITE", $typenr, $CMS_HTMLINSITE);
conGenerateCodeForArtInAllCategories($idart);
header("Location:".$sess->url($cfgClient[$client]["path"]["htmlpath"]."front_content.php?area=$tmp_area&idart=$idart&idcat=$idcat&lang=$lang&changeview=edit")."");
}
?>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="<?php print $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["styles"] ?>contenido.css">
<base href="<?php echo $cfgClient[$client]["path"]["htmlpath"]; ?>">
</head>
<body>
<table width="100%" border=0 cellspacing="0" cellpadding="0" bgcolor="#ffffff">
<tr>
<td width="10" rowspan="4"><img src="<?php print $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"] ?>spacer.gif" width="10" height="10"></td>
<td width="100%"><img src="<?php print $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"] ?>spacer.gif" width="10" height="10"></td>
<td width="10" rowspan="4"><img src="<?php print $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"] ?>spacer.gif" width="10" height="10"></td>
</tr>
<tr>
<td>
<?php
getAvailableContentTypes($idartlang);
echo " <FORM name=\"editcontent\" method=\"post\" action=\"".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["includes"]."include.backendedit.php\">";
$sess->hidden_session();
echo " <INPUT type=hidden name=lang value=\"$lang\">";
echo " <INPUT type=hidden name=typenr value=\"$typenr\">";
echo " <INPUT type=hidden name=idart value=\"$idart\">";
echo " <INPUT type=hidden name=action value=\"10\">";
echo " <INPUT type=hidden name=type value=\"$type\">";
echo "<INPUT type=hidden name=doedit value=1>";
echo " <INPUT type=hidden name=idcat value=\"$idcat\">";
echo " <INPUT type=hidden name=idartlang value=\"$idartlang\">";
echo "<INPUT type=hidden name=changeview value=\"edit\">";
echo " <TABLE cellpadding=$cellpadding cellspacing=$cellpadding border=0>";
echo " <TR><TD valign=top class=text_medium> ".$typenr.". ".$a_description[$type][$typenr].": </TD><TD class=content>";
echo " <TEXTAREA name=CMS_HTMLINSITE ROWS=15 COLS=90>".urldecode($a_content[$type][$typenr])."</TEXTAREA>";
echo " </TD></TR>";
$tmp_area = "con_editcontent";
echo " <TR valign=top><TD colspan=2><br>
<a href=".$sess->url("front_content.php?area=$tmp_area&idart=$idart&idcat=$idcat&lang=$lang")."><img src=\"".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_cancel.gif\" border=0></a>
<INPUT type=image name=submit value=editcontent src=\"".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif\" border=0>
</TD></TR>";
echo " </TABLE>
</FORM>";
?>
</td></tr></table>
</body>
</HTML>
Datei include.CMS_HTMLINSITE.php in das Verzeichnis [client]/contenido/includes hochladen
Modul Text (Insite-Editor) erstellen
Ausgabe:
oder
Code: Alles auswählen
<?php
$str_htmlinsite_1 = strip_tags("CMS_HTMLINSITE[1]");
if($contenido || ($str_htmlinsite_1 != "" && !ereg("^( | |\+|\n|\s)*$" , $str_htmlinsite_1))) echo "<span class=\"small\">CMS_HTMLINSITE[1]<br></span>";
?>
Bei der zweiten Möglichkeit wird kein HTML-Code erzeugt, wenn das Feld leer ist. Das ermöglicht eine etwas offenere Layout-Getaltung.
Modul wie gewohnt zuweisen.
Für Funktion keine Gewähr... Bisher hat's aber geklappt.
Gruß
Oli