(Imported by WSPageSync)
(Imported by PageSync)
Tag: wsps-content-edit-tag
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<noinclude>{{Managed
<noinclude>
|Version=1.5
|Version notes=1.5 - Replaced wsfield button with widget:Link
1.4 - Replaced arraymap and array parserfunctions (from the extensions PageForms and Arrays) with WSArrays equivalents.
1.3 - Modified version for Chameleon 2.0
1.2 - Removed duplicate ul
1.1 - Add option to use Href for dropdown links, so you can use url parameters.
1.0 - First managed version
|Short description=
|Feature=Wiki:Feature/1530870851
|Status=Live
|Uses managed items=}}
 
This is the '''WSNavMenu''' template. It should be called in the following format:
This is the '''WSNavMenu''' template. It should be called in the following format:


<pre>
<pre>
{{WSNavMenu
{{WSNavMenu
|Input=<text> enter a list of pages, with each subitem on a new line and an empty line between main menu items (see example below). Use "*" to add a linktext different from the pagetitle and "-" to add a divider between lines.
|Input=(text) enter a list of pages, with each subitem on a new line and an empty line between main menu items (see example below). Use "*" to add a linktext different from the pagetitle.
}}
}}
</pre>
</pre>
Line 37: Line 25:
MediaWiki:Ws-header*Header
MediaWiki:Ws-header*Header
MediaWiki:Ws-footer*Footer
MediaWiki:Ws-footer*Footer
-
Wiki:page-types*Page types
Wiki:page-types*Page types
Wiki:Wiki pages*Wiki pages
Wiki:Wiki pages*Wiki pages
-
File:Logo.png*Logo
File:Logo.png*Logo
}}
}}
Line 72: Line 58:


</noinclude><includeonly><!--
</noinclude><includeonly><!--
-->{{#vardefine:@lt|*}}<!--
--><div class="navbar navbar-dark navbar-expand-md bg-primary mt-3 mt-md-0" ><!--
  --><div class="navbar navbar-dark navbar-expand-md bg-primary mt-3 mt-md-0" ><!--
  -->{{#widget:Link |type=button |class=navbar-toggler |datatoggle=collapse |datatarget=#navbar1}}<!--
    -->{{#widget:Link |type=button |class=navbar-toggler |datatoggle=collapse |datatarget=#navbar1}}<!--
  --><div class="collapse navbar-collapse justify-content-between w-100" id="navbar1"><!--
    --><div class="collapse navbar-collapse justify-content-between w-100" id="navbar1"><!--
    --><ul class="navbar-nav align-items-center"><!--
      --><ul class="navbar-nav align-items-center"><!--
      -->{{#invoke:WSNavMenu|innerMenu|input={{{Input|}}} }}<!--
        -->{{#caamap: {{{Input|}}}  |\n\n |xxx |<!--
        -->{{#cadefine:@item|{{#regex:xxx|/\n/|_@_}}|_@_}}<!--
        -->{{#ifeq: {{#casize:@item}} |1<!--
        -->|<!--
        --><li class="nav-item"><!--
          -->{{#vardefine:@navitem| xxx |{{#var:@lt }} }}<!--
          -->{{#vardefine:@navitem page |{{#explode:{{#var:@navitem}} |{{#var:@lt}} |0}} }}<!--
          -->{{#vardefine:@navitem title |{{#explode:{{#var:@navitem}} |{{#var:@lt}} |1}} }}<!--
          -->{{#widget:Link |type=a<!--
          -->|href={{fullurl:{{#var:@navitem page}} }}<!--
          -->|text={{#var:@navitem title |{{#var:@navitem page}} }}<!--
          -->|class=nav-link<!--
          -->|style=color:#fff<!--
        -->}}<!--
        --></li><!--
        -->|<!--
        --><li class="nav-item dropdown"><!--
          -->{{#widget:Link |type=a<!--
          -->|href=#<!--
          -->|text={{#caprint:@item[0] }} <!--
          --><b class="caret"><!--
          --></b><!--
          -->|class=nav-link dropdown-toggle<!--
          -->|style=color:#fff<!--
          -->|datatoggle=dropdown<!--
          -->}}<!--
          -->{{#caslice:@sub items|@item|1}}<!--
          --><ul class="dropdown-menu" role="menu" aria-labelledby=""><!--
            -->{{#camap:@sub items |yyy <!--
            -->|{{#switch: yyy<!--
            -->|-=<!--
            --><li class="divider"><!--
            --></li><!--
            -->|#default={{#vardefine:@navitem| yyy |{{#var:@lt }} }}<!--
              -->{{#vardefine:@navitem page |{{#explode:{{#var:@navitem}} |{{#var:@lt}} |0}} }}<!--
              -->{{#vardefine:@navitem title |{{#explode:{{#var:@navitem}} |{{#var:@lt}} |1}} }}<!--
              -->{{#vardefine:@navitem type |{{#explode:{{#var:@navitem}} |{{#var:@lt}} |2}} }}<!--
              -->{{#switch:{{#var:@navitem type}} <!--
              -->|Href={{Dropdown link<!--
                -->|Href={{#var:@navitem page}}<!--
                -->|Text={{#var:@navitem title |{{#var:@navitem page}} }}<!--
                -->}}<!--
              -->|#default={{Dropdown link<!--
                -->|Page={{#var:@navitem page}}<!--
                -->|Text={{#var:@navitem title |{{#var:@navitem page}} }}<!--
                -->}}<!--
              -->}}<!--
            -->}}<!--
            -->|}}<!--
          --></ul><!--
        --></li><!--
        -->}}<!--
      --></li>|\s}}<!--
     --></ul><!--  
     --></ul><!--  
     --><div class="d-flex justify-conent-end"><!--
     --><div class="d-flex justify-conent-end"><!--
Line 135: Line 68:
     --></div><!--  
     --></div><!--  
  --></div><!--
  --></div><!--
--></div><!--
--></div></includeonly>
--></includeonly>
ws-base-props
Line 1: Line 1:
 
{{Base properties
|Class=Application page
|Title=Template:WSNavMenu
|Version history={{Version history item
|Version number=2.0
|Version description=A Lua module is used to generate the inner menu, due to deprecation of Variables and WSArrays extensions
|Version date=2023-6-22 09:50:58
}}{{Version history item
|Version number=1.0
|Version description=Initial version
|Version date=2022-12-02 09:14:43
}}
}}
ws-class-props
Line 1: Line 1:
 
{{Csp class properties
|Type=CSP Basis Core
|Origin=CSP Basis
}}

Latest revision as of 09:37, 15 July 2025

This is the WSNavMenu template. It should be called in the following format:

{{WSNavMenu
|Input=(text) enter a list of pages, with each subitem on a new line and an empty line between main menu items (see example below). Use "*" to add a linktext different from the pagetitle.
}}
{{WSNavMenu
|Input=Main Page*{{Fa|home}} Home

Pages

Search*Search

{{Fa|lock}} Spaces
Special:AddSpace*Add a Space
Special:ActiveSpaces*Manage Active Spaces
Special:ArchivedSpaces*Manage Archived Spaces

{{Fa|lock}} Tools
MediaWiki:Ws-navmenu*NavMenu
MediaWiki:Ws-header*Header
MediaWiki:Ws-footer*Footer
Wiki:page-types*Page types
Wiki:Wiki pages*Wiki pages
File:Logo.png*Logo
}}

Test