Template:Navlist/Subpagename

From Wikibooks, open books for an open world
< Template:Navlist
Jump to: navigation, search
Template documentation[edit] [history] [purge]

Usage[edit]

Usage: {{Template:Navlist/Subpagename|name}} generates just the part of name after the last slash. It works by stripping off slash-separated prefixes of name.

Optional named parameter {{{mode}}} varies this behavior. If mode=long, only the first part of name is removed (up to and including the first slash), except that if there is no slash, nothing is removed. If mode=split, the generated text is as for long mode, but a linebreak is inserted just before the last slash.

Some examples (see note on editing):

Code Result Remark
{{Template:Navlist/Subpagename|Book}} Book  
{{Template:Navlist/Subpagename|Book/Chapter}} Chapter  
{{Template:Navlist/Subpagename|Book/Chapter/X}} X  
{{Template:Navlist/Subpagename|Book/Chapter/X/Y}} Y  
{{Template:Navlist/Subpagename|Book/Chapter/X/Y/Z}} Z  
{{Template:Navlist/Subpagename|Book/Chapter/X/Y/Z/W}} W  
{{Template:Navlist/Subpagename|Template:Navlist/Subpagename}} Subpagename  
{{Template:Navlist/Subpagename|Template:Navlist}} Template:Navlist doesn't remove namespace prefix
{{Template:Navlist/Subpagename|Book/A/B/C/Module|mode=long}} A/B/C/Module  
{{Template:Navlist/Subpagename|Book/A/B/C/Module|mode=split}} A/B/C
Module