Tutorial: Using Page Components within Form Entry Masks of Content Objects
Language Alert: Unfortunately this page is still in german, please help by translating it.
- function form_sequence
Diese Funktion ermöglicht es auch in Contentobjekten Inhalte durch Bestückung mit Bausteinen zu pflegen. This function enables you to add content to content objects through components.
Durch die Angabe der Bausteingruppe wird festgelegt, welche Bausteine zur Verfügung stehen. By choosing the components group, you select which components are available to your content object.
Die Blocknummer bestimmt als welcher Block die Sequenz gespeichert wird. Sofern Sie in einem Contentobjekt mehrere Sequenzen verwenden, müssen Sie dafür verschiedene Blocknummern benutzen. The block number identifies the block that the sequence is saved as. If you want to use multiple sequences within one content object, you will have to use different block numbers.
Um die Sequenz zu rendern gehen Sie wie folgt vor: To render a sequence you can use this code:
// $myCO is the current content object // $block is the sequence number in form_sequence (default -1) $sql = "SELECT * FROM sequence_data WHERE dat_id_content = " . $myCO->id . " AND ver_id = 0 AND dat_blocknr=" . $block . " AND dat_editbuffer=0 ORDER BY dat_pos"; $rs = $myDB->query($sql); $html_block = ""; while ($row = mysql_fetch_array($rs)) { $tname = "PhenotypeComponent_" . $row["com_id"]; $myComponent = new $tname; $myComponent->init($row); $html_block .= $myComponent->render($myCO->my_style); } echo ($html_block);
Alternative: Nutzen Sie spezielle Seitengruppen (z.B. Sonderseiten) und verbinden Sie diese mit Datensätzen des Contentobjektes. Alternative scenario: Use special page groups and connect those with the data of the content object.
Erweiterung bei der Einbindung von Bausteinen über form_sequence: Extension for integrating components with form_sequence:
$myComponent→set(“content_type”,$this→content_type); $myComponent→set(“dat_id_content”,$this→id);
⇒ Der Baustein verfügt automatisch über die beiden Properties und kennt damit seinen Context. ⇒ The component automatically has both properties and therefore knows its context.
You think Phenotype Wiki/Documentation could be better?
We too. Please contribute: Edit this page
Recent Blog Posts
- Finally Multibyte - Phenotype 3.0
- Phenotype 2.9 explained
- Integration of PHPIDS (PHP-Intrusion Detection System)
- New Release: Phenotype 2.8 Ready for Download
- Restart: New Phenotype Website Live
- Phenotype worth: 2 Million $
- New Feature: Automatic Image Version Creation
- Additional smartURL variable: smartPATH