User:Stux/getCurrPage-lookup Template

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(new crazy template... (and there isn't even a bit of code written))
(and why no code? because I haven't figured out the parameter spec yet ^_^;;)
Line 4: Line 4:
=== Usage ===
=== Usage ===
-
:<code><nowiki>{{getCurrPage-lookup|</nowiki>''template-name''|[idx ''</code>or<code>'' name ''</code>(to lookup)<code>'']|[n=1]|[prev=1]|[next=1]}}</code>
+
:<code><nowiki>{{getCurrPage-lookup|</nowiki>''template-name''|[name=''</code>alternative name<code>'']|[prev=1]|[next=1]}}</code>
=== Expected Input Template Parameter Format ===
=== Expected Input Template Parameter Format ===

Revision as of 10:26, 26 January 2021


This crazy meta-template will query another template for its nav index or name based on the current {{PAGENAME}} value. Optionally, it can also provide the next and previous name/index values based on the same criteria.

Usage

{{getCurrPage-lookup|template-name|[name=alternative name]|[prev=1]|[next=1]}}

Expected Input Template Parameter Format

We expect the template to take the following parameters:

{{template-name|idx or name (to lookup)|[n=1]}}

The optional n=1 parameter determines whether the lookup is by index or by name:

{{template-name|idx}}

This returns a full (or sometimes partial) page name value based on its nav index. Also,

{{template-name|name|n=1}}

Would return a nav index value based on a Page Name.

Personal tools