data/TWiki/HierarchicalNavigation.txt
changeset 0 414e01d06fd5
child 1 e2915a7cbdfa
equal deleted inserted replaced
-1:000000000000 0:414e01d06fd5
       
     1 %META:TOPICINFO{author="TWikiContributor" date="1164471667" format="1.1" version="2"}%
       
     2 %META:TOPICPARENT{name="WebHome"}%
       
     3 ---+!! Hierarchical Navigation
       
     4 
       
     5 *Navigation block that displays the current topic, its parent and children (if any).* %BR%
       
     6 This is intended to be included in other topics, for example in a side navigation bar (WebLeftBar).
       
     7 
       
     8 _NOTE: The lookup for parent and children will increase the loading time of your pages._
       
     9 
       
    10 %TOC%
       
    11 
       
    12 ---++ Usage
       
    13 Two sections are defined:
       
    14    * =all=
       
    15    * =children=
       
    16    
       
    17 ---+++ Displaying the Parent - Current - Children block
       
    18 <blockquote>
       
    19 <verbatim>
       
    20 %INCLUDE{"%SYSTEMWEB%.HierarchicalNavigation" section="all"}%
       
    21 </verbatim>
       
    22 </blockquote>
       
    23 generates:
       
    24 
       
    25 %INCLUDE{"%SYSTEMWEB%.HierarchicalNavigation" section="all"}%
       
    26 
       
    27 
       
    28 When included in WebLeftBar (using default Pattern skin) this is styled to:
       
    29 
       
    30 <div id="patternLeftBarContents">
       
    31 %INCLUDE{"%SYSTEMWEB%.HierarchicalNavigation" section="all"}%
       
    32 </div>
       
    33 
       
    34 ---+++ Displaying child topics
       
    35 <blockquote>
       
    36 <verbatim>
       
    37 *Child topics:*
       
    38 %INCLUDE{"%SYSTEMWEB%.HierarchicalNavigation" section="children"}%
       
    39 </verbatim>
       
    40 </blockquote>
       
    41 generates:
       
    42 
       
    43 *Child topics:*
       
    44 %INCLUDE{"%SYSTEMWEB%.HierarchicalNavigation" section="children"}%
       
    45 
       
    46 
       
    47 <div style="display:none;">
       
    48 %STARTSECTION{name="all"}%<div class="twikiHierarchicalNavigation"><div class="twikiParentTopic">
       
    49 %SEARCH{ "^%BASETOPIC%$" web="%BASEWEB%" scope="topic" type="regex" nonoise="on" format="$percntIF{$quot$parent$quot then=$quot   * [[$web.$parent][$parent]]$quot else=$quot<nop>$quot}$percnt" }%<nop>
       
    50 </div>
       
    51 <div class="twikiCurrentTopic">
       
    52    * <nop>%BASETOPIC%
       
    53 </div>
       
    54 <div class="twikiChildTopics">
       
    55 %METASEARCH{type="parent" topic="%BASETOPIC%" format="   * [[$web.$topic][$topic]]"}%<nop>
       
    56 </div><!--twikiChildTopics--></div><!--/twikiHierarchicalNavigation-->%ENDSECTION{name="all"}%
       
    57 
       
    58 %STARTSECTION{name="children"}%<div class="twikiHierarchicalNavigation">
       
    59 <div class="twikiChildTopics">
       
    60 %METASEARCH{type="parent" topic="%BASETOPIC%" format="   * [[$web.$topic][$topic]]"}%<nop>
       
    61 </div><!--twikiChildTopics--></div><!--/twikiHierarchicalNavigation-->%ENDSECTION{name="children"}%
       
    62 
       
    63 </div>