Strict Standards: Declaration of action_plugin_dlcount::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/dlcount/action.php on line 14

Strict Standards: Declaration of action_plugin_indexmenu::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/indexmenu/action.php on line 169

Strict Standards: Declaration of action_plugin_ipban::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/ipban/action.php on line 67

Strict Standards: Declaration of action_plugin_loglog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/loglog/action.php on line 82

Strict Standards: Declaration of action_plugin_navi::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/navi/action.php on line 46

Strict Standards: Declaration of action_plugin_uparrow::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/uparrow/action.php on line 69

Strict Standards: Declaration of action_plugin_userspagecreate::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/userspagecreate/action.php on line 97

Strict Standards: Declaration of cache_instructions::retrieveCache() should be compatible with cache::retrieveCache($clean = true) in /home/www/wiki/inc/cache.php on line 289

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/auth.php on line 312

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 71

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/actions.php on line 154
Konditionale Ersetzer [phpwcms-HowTo:wiki]

Strict Standards: Declaration of syntax_plugin_code::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/code/syntax.php on line 41

Strict Standards: Declaration of syntax_plugin_tip::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/tip/syntax.php on line 38

Konditionale Ersetzer

Diese Technik ermöglicht es, abhängig davon, ob ein Bereich einen Inhalt hat oder nicht, entweder dort den Inhalt mitsamt dazugehörigem Code zu zeigen oder eben nicht.
So bleibt der Quellcode sauber und wird nicht “verstopft” mit leeren Containern und unnötigen Code-Resten.

Das Prinzip

Autor: Claus Szypura (update) http://phoenixmedia.de 2015/02/10

damit das funktioniert, gibt es mehrere BasisWrapper Ein Beispiel von Oliver: Forum

        <header>
            <nav>{NAV_LIST_UL:BP}</nav>
    [HEADER]
            <section class="header-content">{HEADER}</section>
    [/HEADER]
        </header>
        <div class"main[LEFT] has-marginal-left[/LEFT][RIGHT] has-marginal-right[/RIGHT]">
    [LEFT]
            <section class="col-left">{LEFT}</section>
    [/LEFT]
            <article>
                {CONTENT}
            </article>
    [RIGHT]
            <section class="col-left">{RIGHT}</section>
    [/RIGHT]
        </div>
        <footer>
            <p>&copy; 2015 Whatever</p>
    [FOOTER]
            <section class="footer-content">{FOOTER}</section>
    [/FOOTER]
        </footer>

Das gilt auch für CUSTOM_BLOCKS

einfach

[BLOCK]<tag>{BLOCK}</tag>[/BLOCK]
[BLOCK_ELSE]<tag>och nö, fehlt</tag>[/BLOCK_ELSE]

verschachtelt

[BLOCK_ELSE][RIGHT]<tag>{RIGHT}</tag>[/RIGHT][/BLOCK_ELSE]

Ein paar Beispiele gefällig?

LEFT sichtbar?

Wirklich? Hier ist das erste, ein sehr einfaches (nach Korrektur durch Oliver ;) )

[LEFT]
    <div class="col-md-3">
        {LEFT}
    </div>
[/LEFT ]
    <div class="col-md-[LEFT]9[/LEFT][LEFT_ELSE]12[/LEFT_ELSE]">
        {CONTENT}
    </div>

Was tut es? Genau das, was es soll: Wenn {LEFT} keinen Inhalt hat, dann dehnt sich der Inhalt über 12 Spalten aus. Im anderen Fall gibt es einen 3-Spalter und einen 9-Spalter nebeneinander (bootstrap)

LEVEL1_ID sichtbar?

von Oliver Forum

[LEFT]
    <div class="col-md-3">
        [LEVEL1_ID]{NAV_LIST_UL: F,  {LEVEL1_ID} , , act_path , active } [/LEVEL1_ID]
        {LEFT}
    </div>
[/LEFT ]
    <div class="col-md-[LEFT]9[/LEFT][LEFT_ELSE]12[/LEFT_ELSE]">
        {CONTENT}
    </div>

Level da?

[IF_CAT:28,29,30]<!-- whatever -->[/IF_CAT]
[IF_NOTCAT:0,1,2]<!-- whatever -->[/IF_NOTCAT]
deutsch/phpwcms-system/admin/vorlagen/konditionale_ersetzer_in_vorlagen.txt · Last modified: 2015/07/02 14:42 by Claus
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

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 79