Seite 1 von 1

Mehrere Textfelder

Verfasst: So 6. Okt 2013, 04:41
von caps-log
hallo zusammen,
ich habe die 4.9.0 version eingerichtet und würde gerne mehrere editierbare textfelder mit dem content_text modul realisieren.
leider wird in den entsprechend zugeordneten feldern immer der gleiche inhalt angezeigt.

habe versucht das kopien vom content_text modul an folgender stelle anzupassen:

// get text from content type HTML with index 1
$text = "CMS_HTML[1]";

jedoch klappt dies scheinbar nicht:

// get text from content type HTML with index 1
$text = "CMS_HTML[2]";

kann mir jemand einen tipp geben?

Re: Mehrere Textfelder

Verfasst: So 6. Okt 2013, 17:14
von Seelauer
Servus,
das besagte Modul kenne ich jetzt (noch) nicht, aber ein Versuch ist es wert:
$text = "CMS_HTML[1]";
$text .= "CMS_HTML[2]";

Re: Mehrere Textfelder

Verfasst: So 6. Okt 2013, 18:39
von caps-log
Seelauer hat geschrieben: $text .= "CMS_HTML[2]";
hi seelauer, leider hat dieser code bei mir nix gebracht,
trotzdem danke für den schnellen vorschlag!
servus, tl

Re: Mehrere Textfelder

Verfasst: Mo 7. Okt 2013, 05:20
von Seelauer
Komisch,
das ergänzte Modul "content_text" funktioniert bei mir:

Code: Alles auswählen

/**
 * description: standard text
 *
 * @package Module
 * @subpackage ContentText
 * @version SVN Revision $Rev:$
 *
 * @author marcus.gnass@4fb.de
 * @copyright four for business AG <www.4fb.de>
 * @license http://www.contenido.org/license/LIZENZ.txt
 * @link http://www.4fb.de
 * @link http://www.contenido.org
 */

// assert framework initialization
defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');

// get text from content type HTML with index 1 and 2
$text = "CMS_HTML[1]";
$text .= "CMS_HTML[2]";
// When in backend edit mode add a label so the author
// knows what to type in the shown field.
if (cRegistry::isBackendEditMode()) {
    #$label = mi18n("LABEL_TEXT");
	$label = "Texteingabe möglich";
} else {
    $label = NULL;
}

// use smarty template to output header text
$tpl = cSmartyFrontend::getInstance();
$tpl->assign('label', $label);
$tpl->assign('text', $text);
$tpl->display('get.tpl');

?>

Re: Mehrere Textfelder

Verfasst: Mi 9. Okt 2013, 20:31
von caps-log
Hi Seelauer,

wie bindest du das neue Modul ein? Ich habe das alte und das neue (von dir vorgeschlagene) parallel eingesetzt, und erhalte im WSYWYG Editor folgende Ausgabe:
/** * description: standard text * * @package Module * @subpackage ContentText * @version SVN Revision $Rev:$ * * @author marcus.gnass@4fb.de * @copyright four for business AG * @license http://www.contenido.org/license/LIZENZ.txt * @link http://www.4fb.de * @link http://www.contenido.org */ // assert framework initialization defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.'); // get text from content type HTML with index 1 and 2 $text = "
Hintergrund und Philosophie

Das einfachste CMS für Ihre Webdienste ist das Resultat von über 10 Jahren Erfahrung und Weiterentwicklung. Die Philosophie von CONTENIDO ist und war schon immer die Einfachheit und Reduzierung der Komplexität.

Im Inter-, Extra und Intranet, für mobile Websites, der Content Syndication oder als Content Provider für Shopsysteme hat sich das Content Management System CONTENIDO in zahlreichen Installationen bei namhaften Unternehmen bewährt und gehört heute zu Recht zu einem der führenden Open Source CMS im deutschsprachigen Raum.

Dabei wurde von Beginn an großen Wert auf die einfache Bedienung und die Modularität des Systems gelegt.

Unsere Prinzipien: Einfach benutzen, einfach grenzenlos, einfach einfach.
"; $text .= "

"; // When in backend edit mode add a label so the author // knows what to type in the shown field. if (cRegistry::isBackendEditMode()) { #$label = mi18n("LABEL_TEXT"); $label = "Texteingabe möglich"; } else { $label = NULL; } // use smarty template to output header text $tpl = cSmartyFrontend::getInstance(); $tpl->assign('label', $label); $tpl->assign('text', $text); $tpl->display('get.tpl'); ?>
Das von dir beschriebene Modul liest somit den vorhandenen content aus dem original HTML Text des Contenido-Prototypen aus.
Viele Grüße, Torsten

Re: Mehrere Textfelder

Verfasst: Di 15. Okt 2013, 15:42
von MVision
Ich weiß ja nicht, ob das noch aktuell ist, aber bei dem Modul fehlt das öffnende <?php

Also so:

Code: Alles auswählen

<?php
    /**
     * description: standard text
     *
     * @package Module
     * @subpackage ContentText
     * @version SVN Revision $Rev:$
     *
     * @author marcus.gnass@4fb.de
     * @copyright four for business AG <www.4fb.de>
     * @license http://www.contenido.org/license/LIZENZ.txt
     * @link http://www.4fb.de
     * @link http://www.contenido.org
     */

    // assert framework initialization
    defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');

    // get text from content type HTML with index 1 and 2
    $text = "CMS_HTML[1]";
    $text .= "CMS_HTML[2]";
    // When in backend edit mode add a label so the author
    // knows what to type in the shown field.
    if (cRegistry::isBackendEditMode()) {
        #$label = mi18n("LABEL_TEXT");
       $label = "Texteingabe möglich";
    } else {
        $label = NULL;
    }

    // use smarty template to output header text
    $tpl = cSmartyFrontend::getInstance();
    $tpl->assign('label', $label);
    $tpl->assign('text', $text);
    $tpl->display('get.tpl');

    ?>

Re: Mehrere Textfelder

Verfasst: Mi 16. Okt 2013, 23:40
von caps-log
hallo mvision, das hatte ich ergänzt und ausprobiert, dennoch hat es nicht geklappt...
in den alten contenido-versionen konnte man im textmodul einfach das feld CMS_HTML[1]
mit neuer nummer in einem neuen textmodul speichern, und fertig wars.
das scheint jetzt nichtmehr zu gehen.

Re: Mehrere Textfelder

Verfasst: Mi 23. Okt 2013, 18:30
von MVision
Hallo Torsten,

also, bei mir funktioniert es mit dem CMS_HTML[2] in einem neuen Modul.

Hast du denn auch die Template-Datei get.tpl unter "HTML" eingefügt? Außerdem muss unter "Übersetzung" noch etwas bei LABEL_TEXT etwas eingetragen werden.

Viele Grüße,
Miriam

Re: Mehrere Textfelder

Verfasst: Mi 23. Okt 2013, 19:44
von dominik.ziegler
Du bist nicht zwingend auf ein Template angewiesen. Ein einfach
echo "CMS_HTML[1]";
sollte ebenfalls eine entsprechende Eingabemaske "produzieren".