Differences

This shows you the differences between two versions of the page.

deutsch:technik:systemvariablen:vorlagen [2010/09/26 07:41]
Knut Heermann (flip-flop) created
deutsch:technik:systemvariablen:vorlagen [2018/06/03 18:08] (current)
Line 3: Line 3:
====== Vorlagen ====== ====== Vorlagen ======
   
 +Siehe auch: [[deutsch/templates]]
 +
 +\\
 +**Systemvariablen:**
 +<file>
 +- $block['name']              // Name:                    [Vorlagenname]
 +- $block['layout']            // Layout:                  [Layout-Nr.]
 +
 +- $block['overwrite']         // Einstellungen:           [Standard|Name der PHP-Datei in /template/inc_settings/template_default/]
 +
 +- $block["css"]               // CSS Datei: Ausgabe im array z.B. Array([0] => frontend.css [1] => nav_horiz_drop_down.css)
 +- $block["htmlhead"]          // Inhalt HTML Kopf: <head>
 +
 +- $block['jslib']             // JS Bibliothek:           [Bibliothekname]
 +- $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.
 +
 +
 +**Bedingung:**  -> [[http://www.phpwcms-docu.de/confincphp_de.phtml|/config/phpwcms/conf.inc.php]] \\
 +  * $phpwcms['allow_ext_init']  = 1;
 +
 +\\
 +In dem Verzeichnis **template/inc_script/frontend_init/** wird die Datei **template_inject01.php** mit folgendem Inhalt abgelegt:
 +
 +<code php|h template_inject01.php |h>
 +<?php
 +/*********************************************************************************************
 +* Backend Template main replace
 +* Replaces the the main template with the contents of the
 +* file "template/inc_script/template/main01.php".
 +* KH 07.01.2010
 +**********************************************************************************************/
 +
 +// -------------------------------------------------------------------------------------------
 +// obligate check for phpwcms constants
 +  if (!defined('PHPWCMS_ROOT')) {
 +    die("You Cannot Access This Script Directly, Have a Nice Day."); }
 +// -------------------------------------------------------------------------------------------
 +
 +if ($block['maintext'] == 'main01.php')
 + $block['maintext'] = file_get_contents(PHPWCMS_TEMPLATE.'/inc_script/template/'.$block['maintext']);
 +
 +?>
 +</code>
 +
 +\\
 +
 +Die Vorlagendatei heißt in diesem Beispiel **main01.php** und ist in **template/inc_script/template/** abgelegt. \\
 +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>
 +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>
 +
 +\\
 +\\
 +
 +
 +
 +
 +
===== Einbinden der Felder "Kopfzeile:", "Fußzeile:", "links:", "rechts:" in "Haupt:"  ===== ===== Einbinden der Felder "Kopfzeile:", "Fußzeile:", "links:", "rechts:" in "Haupt:"  =====
Line 22: 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 60: 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.
deutsch/technik/systemvariablen/vorlagen.1285479695.txt.gz · Last modified: 2018/06/03 18:06 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0