Difference between revisions of "Template:List MenuEntries"

From Salem Wiki
Jump to: navigation, search
(Initial setup)
 
m (recode)
Line 1: Line 1:
 
{{#ask:
 
{{#ask:
 
[[isGameMenu::n]]
 
[[isGameMenu::n]]
[[isinGameMenu::{{#ifeq:
+
[[isinGameMenu::{{#if: {{{menu|}}}
{{SUBJECTSPACE: {{{page|{{FULLPAGENAME}} }}} }}
+
| {{{menu}}}
| {{ns:Template}}
+
| {{#ifeq: {{SUBJECTSPACE: {{FULLPAGENAME}} }}
| GameMenu
+
| {{ns:Template}}
| {{#titleparts: {{{page|{{PAGENAME}} }}} ||-1 }}
+
| +
}}]]
+
| {{#titleparts: {{PAGENAME}} ||-1 }}
|intro=Non-menu entries you can find in the [[{{#ifeq:
+
}}
{{SUBJECTSPACE: {{{page|{{FULLPAGENAME}} }}} }}
+
}}]]
| {{ns:Template}}
+
|intro=Non-menu entries <!--
| GameMenu
+
-->{{#if: {{{menu|}}}
| {{{page|{{PAGENAME}} }}}
+
| you can find in the <!--
}}<!--
+
-->[[<!--
-->|<!--
+
-->{{FULLPAGENAME}}<!--
-->'''''{{#ifeq:
+
-->|<!--
{{#ifeq:
+
-->'''''{{{menu}}}'''''<!--
{{SUBJECTSPACE: {{{page|{{FULLPAGENAME}} }}} }}
+
-->]]-menu<nowiki> </nowiki>
| {{ns:Template}}
+
}}are:<ul>
| GameMenu
 
| {{#titleparts: {{{page|{{PAGENAME}} }}} ||-1 }}
 
}}
 
| GameMenu
 
| Main
 
| {{#titleparts: {{{page|{{PAGENAME}} }}} ||-1}}
 
}}'''''<!--
 
-->]]-menu are:<ul>
 
 
|outro=</ul>
 
|outro=</ul>
 
|default=no entries found.
 
|default=no entries found.

Revision as of 15:53, 16 June 2012

Non-menu entries are:


Template documentation (for the template shown above, sometimes hidden or invisible)

Description

This template is used to automatically list the non-menu entries of a GameMenu using an SMW-Query.
It uses {{List MenuEntries/query template}} for output formating.
This template is used by {{GameMenu intro}}.
See these pages for more SMW-documentation:

Syntax

Type the below code somewhere on a page:
{{List MenuEntries}}
It can accept one parameter to select a specific menu to list, to accommodate usage on any page.
This optional named parameter is called menu and controls which info is displayed according to its value:
  • this
    List non-menu pages that have Property:isinGameMenu set to the last part of the pagename where you invoke this template in. (eg. 'sub' for page 'main/sub')
    This is the default for normal pages, see below for exception.
  • any
    List all non-menu pages that have Property:isinGameMenu set to any value. (SMW-Query conditon-value '+')
    This is the default when in the Template-namespace.
  • When using anything other as this or any
    It will use the last part of this value as a SMW-Query conditon-value for Property:isinGameMenu to select pages. (eg. 'sub' for 'main/sub')
    It will use the last part of this value to display as menu-name. (eg. 'sub' for 'main/sub')
    It will use the whole value as link-target for the displayed menu-name. (eg. 'main/sub' for 'main/sub')
    So unless you have redirect-pages setup, you should use the whole path of the menu-structure to list entries of some menu on any-other pages !
    Example: 'Build' as value would properly display the non-menu entries for the Build menu, but it would link to a page named "Build" and not the one inside the menu-hierarchy, which would be "GameMenu/Build" in this case...

Examples

  1. {{List MenuEntries}} gives:
    Non-menu entries are:
  2. {{List MenuEntries|menu=GameMenu/Build}} gives:
    no entries found.