Template:SubPageListHelper

From Open Energy Information

This is the SubPageListHelper template. It is designed for use by an ask query displaying subpages. This template will strip out the page prefix leaving only the SUBPAGENAME for each result.

Parameters

None


Dependencies
  • An ask query passing results to the template


Usage

It should be invoked using an ask query with a result format that supports the use of templates. For more information on result formats, see Help:FormattingResults.

Sample usage:

{{#ask:[[Category:Marine and Hydrokinetic Technology Projects]]
|format=listwidget
|widget=alphabet  
|limit=500
|template=SubPageListHelper
}}


This is quite the wiki hack. The passed-in link {{{1}}} arrives as [[main/sublink|main/sublink]]. The replacing, exploding and parsing strips the original pagename and the last half of the sublink including the trailing ]]'s, which is why the link generated in the template does not include them.

This template will not work properly if an alternate name is specified for the subpage results being returned.


Example

For an example of this template in use, please see the MHK Projects page.

Edit the page to see the template code.