Seite 1 von 1
Defaultwerte?
Verfasst: Di 3. Jan 2006, 20:10
von FriFra
Kann man irgendwie Defaultwerte für bestimmte Felder festlegen?
Ich will, dass die beiden Bilder perDefault vorbelegt sind und eben nur optional geändert werden können...

Re: Defaultwerte?
Verfasst: Di 3. Jan 2006, 20:55
von mvf
schau mal in den beispielmandanten, da ist genau dein ziel abgebildet wenn ich nicht irre
im layout container für die images anlegen
im template image modul in die container platzieren und konfigurieren
Verfasst: Di 3. Jan 2006, 21:22
von FriFra
Ich verwende doch für den Artikel schon das Standardtemplate und da sind die Bilder korrekt konfiguriert. Trotzdem sind sie bei neuen Artikeln immer leer

Verfasst: Di 3. Jan 2006, 21:29
von mvf
welches modul verwendest du für die bilder?
das modul 'Illustration' aus der standard 4.6.4? und nur sicherheisthalber, im template 'vorkonfiguration' ist es konfiguriert, der tab neben visuelles editieren?
Verfasst: Di 3. Jan 2006, 21:41
von FriFra
mvf hat geschrieben:welches modul verwendest du für die bilder?
das modul 'Illustration' aus der standard 4.6.4? und nur sicherheisthalber, im template 'vorkonfiguration' ist es konfiguriert, der tab neben visuelles editieren?
Das Modul heist bei mir "Bild (1)"
Code: Alles auswählen
<?php
if ("CMS_IMG[1]" != "") {
$img = '<img src="CMS_IMG[1]" border="0">';
if ("CMS_LINK[2]" != "http://") {
$img = sprintf('<a href="%s" target="%s">%s</a>',"CMS_LINK[1]", "CMS_LINKTARGET[1]", $img);
}
echo $img;
}
echo "<br>";
echo "CMS_IMGDESCR[1]";
echo "<br>";
echo "CMS_LINKDESCR[1]";
echo "<br>";
?>
Verfasst: Di 3. Jan 2006, 21:56
von mvf
FriFra hat geschrieben:Das Modul heist bei mir "Bild (1)"
wie bereits beschrieben, eine standard installation mit beispielmandanten und inhalten anlegen als referenz, da wird das modul illustration genutzt, versuch des zunächst für eine seite, bin mir nicht sicher ob man des mehrfach einsetzen kann ohne modifikation.
Verfasst: Di 3. Jan 2006, 21:59
von FriFra
Das Modul IST eine Kopie den entspr. Moduls des Beispielmandanten...
Verfasst: Di 3. Jan 2006, 22:18
von mvf
FriFra hat geschrieben:Das Modul IST eine Kopie den entspr. Moduls des Beispielmandanten...
wäre mir neu aber ich lasse mich gerne belehren.
im beispielmandanten der 4.6.4 wird das modul illsutration verwendet für das image oben rechts
MODUL Illustration
input:
Code: Alles auswählen
?><?php
/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname : Illustration
* Author(s) : Andreas Lindner, 4fb
* Copyright : Contenido - four for business, Andreas Lindner
* Created : 12.08.2005
************************************************/
#Selected img directory
$cms_dirname = "CMS_VALUE[1]";
#Selected img
$cms_filename = "CMS_VALUE[2]";
if ($cms_dirname == '' || $cms_dirname == '0') {
$cms_dirname = 'bilder/';
}
#Get paths
$sql = "SELECT
htmlpath, frontendpath
FROM
".$cfg["tab"]["clients"]."
WHERE
idclient = ".$client." ";
$db->query($sql);
if ($db->next_record()) {
$htmlpath = $db->f('htmlpath');
$frontendpath = $db->f('frontendpath');
}
#Choose image folder
echo '<table cellpadding="0" cellspacing="0" border="0">
<tr><td class="text_medium" style="padding:5px">'.mi18n("Das Bild soll folgende Größe haben: 170 x 80 px").'</td></tr>
<tr><td class="text_medium" style="padding:5px">'.mi18n("Bildverzeichnis wählen").': </td></tr>
<tr><td class="text_medium" style="padding:5px">';
echo '<select name="CMS_VAR[1]" style="width:200px">';
#Get upload directories
$sql = "SELECT DISTINCT
dirname
FROM
".$cfg["tab"]["upl"]."
WHERE
idclient='$client' AND
filetype IN ('jpeg','jpg','gif','png')
ORDER BY
dirname";
$db->query($sql);
$selected = false;
while ($db->next_record()) {
$dirname = $db->f('dirname');
if ($cms_dirname != $dirname) {
echo '<option value="'.$dirname.'"> '.$dirname.'</option>';
} else {
$selected = true;
echo '<option value="'.$dirname.'" selected="selected"> '.$dirname.'</option>';
}
}
if (!$selected) {
echo '<option value="0" selected="selected">'.i18n("Bitte wählen").'</option>';
} else {
echo '<option value="0">'.i18n("Bitte wählen").'</option>';
}
#Choose image file
echo '</select> <input type="image" src="images/submit.gif">
<tr><td class="text_medium" style="padding:5px">'.mi18n("Bild wählen").': </td></tr>
<tr><td class="text_medium" style="padding:5px">';
echo '<select name="CMS_VAR[2]" style="width:200px">';
echo '<option value="0" selected="selected">'.i18n("Bitte wählen").'</option>';
if ($cms_dirname != '0') {
#Get uploaded files
$sql = "SELECT
filename
FROM
".$cfg["tab"]["upl"]."
WHERE
idclient = '$client' AND
filetype IN ('jpeg','jpg','gif','png','swf') AND
dirname = '$cms_dirname'
ORDER BY
filename";
$db->query($sql);
while ($db->next_record()) {
$img_name = $db->f('filename');
if ($cms_filename != $img_name) {
echo '<option value="'.$img_name.'"> '.$img_name.'</option>';
} else {
echo '<option selected="selected" value="'.$img_name.'"> '.$img_name.'</option>';
}
}
}
echo '</select> <input type="image" src="images/submit.gif">';
#Preview image
if ($cms_dirname != '0' AND $cms_filename != '0' AND strlen($cms_dirname) > 0 AND strlen($cms_filename) > 0) {
$img_path = $htmlpath.$cfgClient[$client]['upload'].$cms_dirname.$cms_filename;
$img_split = preg_split("/\./", $cms_filename);
$count = count($img_split);
$type = $img_split[$count -1];
echo '<tr><td colspan="2" style="padding:5px">
<img src="'.$img_path.'">
</td></tr> ';
}
echo '</td></tr>';
echo '</table>';
?><?php
output:
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Illustration
* Author(s) : Andreas Lindner, 4fb
* Copyright : Contenido - four for business, Andreas Lindner
* Created : 12.08.2005
************************************************/
#Selected img directory
$cms_dirname = "CMS_VALUE[1]";
#Selected img
$cms_filename = "CMS_VALUE[2]";
#Default settings
$img_width = 170;
$img_height = 80;
$defaultImage = 'bilder/illu.jpg';
$htmlpath = $cfgClient[$client]['path']['htmlpath'];
$frontendpath = $cfgClient[$client]['path']['frontend'];
$img_path = $htmlpath.$cfgClient[$client]['upload'].$defaultImage;
$img_path_fs = $frontendpath.$cfgClient[$client]['upload'].$defaultImage;
#Check configured images
if ($cms_dirname != '0' AND $cms_filename != '0' AND strlen($cms_dirname) > 0 AND strlen($cms_filename) > 0) {
$img_path = $htmlpath.$cfgClient[$client]['upload'].$cms_dirname.$cms_filename;
$img_path_fs = $frontendpath.$cfgClient[$client]['upload'].$cms_dirname.$cms_filename;
$img_split = preg_split("/\./", $cms_filename);
$count = count($img_split);
$type = $img_split[$count -1];
if (!file_exists($img_path_fs)) {
$img_path = $htmlpath.$cfgClient[$client]['upload'].$defaultImage;
$img_path_fs = $frontendpath.$cfgClient[$client]['upload'].$defaultImage;
}
}
#Scale image
$image = capiImgScale($img_path_fs, $img_width, $img_height, false, false, 10, false);
#Get dimensions of scaled image
list ($width, $height, $type, $attr) = getimagesize($image);
#Output image tag
echo '<img src="'.$image.'" width="'.$width.'" height="'.$height.'" alt="'.mi18n("Illustration").'" title="'.mi18n("Illustration").'"/>';
?>
Verfasst: Di 3. Jan 2006, 22:46
von FriFra
Also ich hab diesen Code mal eingefügt... mit dem Ergebnis, dass das Bild nun weg ist

...
Ich hab dann wieder den Originalcode eingefügt, dann ist wenigstens das Bild wieder da

Verfasst: Di 3. Jan 2006, 23:32
von rezeptionist
hast du das Modul auch Konfiguriert ???
greets
Verfasst: Mi 4. Jan 2006, 00:30
von FriFra
Jetzt funzts

mvf hat sich die Sache mal angesehen und mir auf die Sprünge geholfen
