NAVIGATION
This shows you the differences between two versions of the page.
|
deutsch:technik:systemvariablen:vorlagen [2010/09/26 07:43] Knut Heermann (flip-flop) |
deutsch:technik:systemvariablen:vorlagen [2018/06/03 18:08] (current) |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ====== Vorlagen ====== | ====== Vorlagen ====== | ||
| + | Siehe auch: [[deutsch/templates]] | ||
| - | ===== Einbinden der Felder "Kopfzeile:", "Fußzeile:", "links:", "rechts:" in "Haupt:" ===== | + | \\ |
| + | **Systemvariablen:** | ||
| + | <file> | ||
| + | - $block['name'] // Name: [Vorlagenname] | ||
| + | - $block['layout'] // Layout: [Layout-Nr.] | ||
| - | Normalerweise sind diese Felder nicht mehr brauchbar, da diese bei der Layoutvariante Block: "Eigene" nicht abgefragt werden. \\ | + | - $block['overwrite'] // Einstellungen: [Standard|Name der PHP-Datei in /template/inc_settings/template_default/] |
| - | Mit einem kleinen Ersetzer ist es jedoch möglich diese Eingabefelder im Feld "Haupt" einzubinden. \\ | + | |
| - | An den Stellen an denen der Inhalt dieser Felder in das Template eingebunden werden soll, werden Tags in "Haupt:" gesetzt. \\ | + | - $block["css"] // CSS Datei: Ausgabe im array z.B. Array([0] => frontend.css [1] => nav_horiz_drop_down.css) |
| - | * **{HEADERTEMP}** = Inhalt aus "Kopfzeile:" | + | - $block["htmlhead"] // Inhalt HTML Kopf: <head> |
| - | * **{FOOTERTEMP}** = Inhalt aus "Fußzeile:" | + | |
| - | * **{RIGHTTEMP}** = Inhalt aus "rechts:" | + | - $block['jslib'] // JS Bibliothek: [Bibliothekname] |
| - | * **{LEFTTEMP}** = Inhalt aus "links:" | + | - $block['jslibload'] // immer laden [0|1] |
| + | - $block['googleapi'] // Google Ajax Lib benutzen [0|1] | ||
| + | |||
| + | - $block['frontendjs'] // frontend.js laden (mehr aus historischen Gründen) [0|1] | ||
| + | - $block['jsonload'] // JS onload: [JS String] | ||
| + | - $block['feloginurl'] // FE LoginURL: [URL] | ||
| + | |||
| + | - $block['headertext'] // Inhalt Kopfzeile: [Inhalt] | ||
| + | - $block['maintext'] // Inhalt Haupt: [Inhalt] | ||
| + | - $block['footertext'] // Inhalt Fußzeile: [Inhalt] | ||
| + | - $block['lefttext'] // Inhalt links: [Inhalt] | ||
| + | - $block['righttext'] // Inhalt rechts: [Inhalt] | ||
| + | |||
| + | - $block['customblock_XXX'] // Inhalt Eigene Blöcke XXX [Inhalt] | ||
| + | |||
| + | - $block['errortext'] // Inhalt Fehler: [Inhalt] | ||
| + | </file> | ||
| + | |||
| + | \\ | ||
| + | |||
| + | ===== Einbinden einer statischen Datei als Vorlage in "Haupt:" ===== | ||
| + | |||
| + | Eine Möglichkeit, eine Datei auf dem Server als Vorlage zu verwenden. So wird das Editieren der Vorlage aus dem CMS in einen FTP fähigen Editor verlagert. | ||
| - | <note> | ||
| - | Es kann u.U. passieren, dass einige Funktionen in den alternativen Felder vor dem Einfügen in "Haupt:" von System abgearbeitet werden, dann müssen diese Anweisungen Direkt in "Haupt:" platziert werden. Alternativ könnte der RT {SHOW_CONTENT:.....} verwendet werden. | ||
| - | </note> | ||
| **Bedingung:** -> [[http://www.phpwcms-docu.de/confincphp_de.phtml|/config/phpwcms/conf.inc.php]] \\ | **Bedingung:** -> [[http://www.phpwcms-docu.de/confincphp_de.phtml|/config/phpwcms/conf.inc.php]] \\ | ||
| * $phpwcms['allow_ext_init'] = 1; | * $phpwcms['allow_ext_init'] = 1; | ||
| + | \\ | ||
| + | In dem Verzeichnis **template/inc_script/frontend_init/** wird die Datei **template_inject01.php** mit folgendem Inhalt abgelegt: | ||
| - | In dem Verzeichnis **template/inc_script/frontend_init/** wird die Datei **template_inject.php** mit folgendem Inhalt abgelegt: | + | <code php|h template_inject01.php |h> |
| - | + | ||
| - | <code php|h template_inject.php |h> | + | |
| <?php | <?php | ||
| /********************************************************************************************* | /********************************************************************************************* | ||
| - | * Backend Template field replacer | + | * Backend Template main replace |
| - | * Replaces the placeholder {HEADERTEMP}, {FOOTERTEMP}, {LEFTTEMP}, {RIGHTTEMP} in "main" | + | * Replaces the the main template with the contents of the |
| - | * with the contents of the fields "header", "footer", "left", "right". | + | * file "template/inc_script/template/main01.php". |
| * KH 07.01.2010 | * KH 07.01.2010 | ||
| **********************************************************************************************/ | **********************************************************************************************/ | ||
| Line 40: | Line 63: | ||
| // ------------------------------------------------------------------------------------------- | // ------------------------------------------------------------------------------------------- | ||
| - | if (!empty($block['headertext']) ) | + | if ($block['maintext'] == 'main01.php') |
| - | $block['maintext'] = str_replace('{HEADERTEMP}', $block['headertext'],$block['maintext']); | + | $block['maintext'] = file_get_contents(PHPWCMS_TEMPLATE.'/inc_script/template/'.$block['maintext']); |
| - | if (!empty($block['righttext'])) | + | |
| - | $block['maintext'] = str_replace('{RIGHTTEMP}' , $block['righttext'], $block['maintext']); | + | |
| - | if (!empty($block['footertext'])) | + | |
| - | $block['maintext'] = str_replace('{FOOTERTEMP}', $block['footertext'],$block['maintext']); | + | |
| - | if (!empty($block['lefttext'])) | + | |
| - | $block['maintext'] = str_replace('{LEFTTEMP}' , $block['lefttext'], $block['maintext']); | + | |
| ?> | ?> | ||
| Line 53: | Line 70: | ||
| \\ | \\ | ||
| - | Die selbstdefinierten "Custom"-Blöcke werden mit //(z.B. mit Blockname "BOX01" in Seitenlayout -> Blöcke -> Eigene:)// | + | |
| - | <code php>$block['customblock_BOX01']</code> | + | Die Vorlagendatei heißt in diesem Beispiel **main01.php** und ist in **template/inc_script/template/** abgelegt. \\ |
| - | angesprochen. | + | Das Script schaut im Vorlagenblock "Haupt:" nach ob dort der Text **main01.php** eingetragen ist. (Und nur dieser). |
| + | |||
| + | In **main01.php** wird der Quelltext für "Haupt:" abgelegt ohne den öffnenden/schließenden PHP-Tag %%<?php .... ?>%%. | ||
| <note important> | <note important> | ||
| - | Um die Abfrage schnell zu halten wird nicht gegen ein Vorhandensein der Tags im "Haupt:" geprüft. Daher liegt es in Ihrer Verantwortung hier nur Tags zu setzen, wenn auch entsprechender Content in den alternativen Feldern vorhanden ist. | + | Um die Abfrage schnell zu halten wird nicht gegen ein Vorhandensein der Vorlagendatei geprüft. |
| + | |||
| + | **Dieses Verfahren sollte nur in der Entwicklungsphase eingesetzt werden!!** | ||
| </note> | </note> | ||
| \\ | \\ | ||
| + | \\ | ||
| Line 87: | Line 108: | ||
| * $phpwcms['allow_ext_init'] = 1; | * $phpwcms['allow_ext_init'] = 1; | ||
| + | \\ | ||
| + | In dem Verzeichnis **template/inc_script/frontend_init/** wird die Datei **template_inject02.php** mit folgendem Inhalt abgelegt: | ||
| - | In dem Verzeichnis **template/inc_script/frontend_init/** wird die Datei **template_inject.php** mit folgendem Inhalt abgelegt: | + | <code php|h template_inject02.php |h> |
| - | + | ||
| - | <code php|h template_inject.php |h> | + | |
| <?php | <?php | ||
| /********************************************************************************************* | /********************************************************************************************* | ||
| Line 125: | Line 146: | ||
| Um die Abfrage schnell zu halten wird nicht gegen ein Vorhandensein der Tags im "Haupt:" geprüft. Daher liegt es in Ihrer Verantwortung hier nur Tags zu setzen, wenn auch entsprechender Content in den alternativen Feldern vorhanden ist. | Um die Abfrage schnell zu halten wird nicht gegen ein Vorhandensein der Tags im "Haupt:" geprüft. Daher liegt es in Ihrer Verantwortung hier nur Tags zu setzen, wenn auch entsprechender Content in den alternativen Feldern vorhanden ist. | ||
| </note> | </note> | ||
| + | |||
| + | \\ | ||
| + | |||
| + | Beide Verfahren können auch kombiniert werden. | ||