Runes of Magic Wiki
Register
mNo edit summary
mNo edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
  +
<includeonly><!--
<includeonly><!-- This code is just waiting on #simplesort to go live. I will also need to replace the direct field names with #var (below)
 
-->{{#vardefine:list2 |{{#if:{{{list2|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{list2}}}}} |{{{list2}}} }} | }} }}<!--
+
-->{{#vardefine:list2 |{{#if:{{{list2|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{list2}}}}} |{{{list2}}} }} |}} }}<!--
-->{{#vardefine:list3 |{{#if:{{{list3|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{list3}}}}} |{{{list3}}} }} | }} }}<!--
+
-->{{#vardefine:list3 |{{#if:{{{list3|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{list3}}}}} |{{{list3}}} }} |}} }}<!--
-->{{#vardefine:list4 |{{#if:{{{list4|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{list4}}}}} |{{{list4}}} }} | }} }}<!--
+
-->{{#vardefine:list4 |{{#if:{{{list4|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{list4}}}}} |{{{list4}}} }} |}} }}<!--
-->{{#vardefine:list5 |{{#if:{{{list5|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{list5}}}}} |{{{list5}}} }} | }} }}<!--
+
-->{{#vardefine:list5 |{{#if:{{{list5|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{list5}}}}} |{{{list5}}} }} |}} }}<!--
-->{{#vardefine:notes |{{#if:{{{notes|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{notes}}}}} |{{{notes}}} }} | }} }}<!--
+
-->{{#vardefine:notes |{{#if:{{{notes|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{notes}}}}} |{{{notes}}} }} |}} }}<!--
-->{{#vardefine:mobtypes |{{#if:{{{mobtypes|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{mobtypes}}}}} |{{{mobtypes}}} }} | }} }}<!--
+
-->{{#vardefine:mobtypes |{{#if:{{{mobtypes|}}} |{{#if:{{{sorted|}}} |{{#simplesort:keyed|{{{list1|}}}|{{{mobtypes}}}}} |{{{mobtypes}}} }} |}} }}<!--
 
-->{{#vardefine:list1|{{#if:{{{sorted|}}}|{{#simplesort:{{{list1|}}}}}|{{{list1|}}}}}}}<!--
 
-->{{#vardefine:list1|{{#if:{{{sorted|}}}|{{#simplesort:{{{list1|}}}}}|{{{list1|}}}}}}}<!--
 
-->{{#vardefine:counter|0}}<!--
 
-->{{#vardefine:counter|0}}<!--
Line 15: Line 15:
 
-->{{#if:{{{usebr|}}}||</{{#if:{{{ol|}}}|o|u}}l>}}</includeonly><noinclude>
 
-->{{#if:{{{usebr|}}}||</{{#if:{{{ol|}}}|o|u}}l>}}</includeonly><noinclude>
 
This replaces my original template using the #while function to control the looping.
 
This replaces my original template using the #while function to control the looping.
 
Documentation for the Loops extension can be found at [https://www.mediawiki.org/wiki/Extension:Loops https://www.mediawiki.org/wiki/Extension:Loops].
 
   
 
The difference between this and my original listproc templates is that this approach has no limit to the length of the lists. We do still have a list length issue because of the 99 Expensive Parser Functions limit. For instance, a [[Template:Mob]] page for a Merchant or Instructor that uses the Drops fields to list the For Sale items, or a Boss page that lists everything they drop, will exceed this limit causing the item icons to stop rendering once this limit is surpassed. At this time there is nothing we can do about this limit.
 
The difference between this and my original listproc templates is that this approach has no limit to the length of the lists. We do still have a list length issue because of the 99 Expensive Parser Functions limit. For instance, a [[Template:Mob]] page for a Merchant or Instructor that uses the Drops fields to list the For Sale items, or a Boss page that lists everything they drop, will exceed this limit causing the item icons to stop rendering once this limit is surpassed. At this time there is nothing we can do about this limit.
Line 24: Line 22:
 
The basic idea is to have a group of comma-delimited lists, each of which defines a part of what I need. Note: MediaWiki does not allow recursion.
 
The basic idea is to have a group of comma-delimited lists, each of which defines a part of what I need. Note: MediaWiki does not allow recursion.
   
 
See also: [[Template:Clistproc]], [[Template:nolistproc]]
  +
  +
==Dependent Extensions==
 
This template makes extensive use of [https://www.mediawiki.org/wiki/Extension:SimpleSort #SimpleSort], written by Clark Verbrugge (MediaWiki user [http://www.mediawiki.org/wiki/User:Clump clump]). This uses the "keyed" option to sort '''list 2''' thru '''mobtypes''' in the same order as '''list1''' to maintain the connections.
 
This template makes extensive use of [https://www.mediawiki.org/wiki/Extension:SimpleSort #SimpleSort], written by Clark Verbrugge (MediaWiki user [http://www.mediawiki.org/wiki/User:Clump clump]). This uses the "keyed" option to sort '''list 2''' thru '''mobtypes''' in the same order as '''list1''' to maintain the connections.
   
  +
[http://www.mediawiki.org/wiki/Extension:Loops #while from Extension:Loops] (by David M. Sledge and [http://www.mediawiki.org/wiki/User:Danwe Daniel Werner]) is also used/needed.
See also: [[Template:Clistproc]], [[Template:nolistproc]]
 
  +
 
==Usage==
 
==Usage==
 
<pre>{{ulistproc
 
<pre>{{ulistproc
Line 67: Line 69:
 
:passed to linker. Used if linker=itemlink
 
:passed to linker. Used if linker=itemlink
 
;sorted
 
;sorted
:(switch) IF non-blank, sort the lists!
+
:(switch) IF non-blank, sort the lists using [https://www.mediawiki.org/wiki/Extension:SimpleSort #SimpleSort]!
   
 
{| class="wikitable"
 
{| class="wikitable"
Line 87: Line 89:
 
|mobtypes|| NPC, Monster, Passive or Ambience
 
|mobtypes|| NPC, Monster, Passive or Ambience
 
|-
 
|-
!rowspan="5"|itemlink
+
!rowspan="6"|itemlink
|rowspan="5"|<pre>{{ulistproc
+
|rowspan="6"|<pre>{{ulistproc
 
|linker=itemlink
 
|linker=itemlink
 
|list1=
 
|list1=
Line 95: Line 97:
 
|list4=
 
|list4=
 
|notes=
 
|notes=
  +
|sorted=y
 
|}}</pre>
 
|}}</pre>
 
|list1|| items
 
|list1|| items
Line 105: Line 108:
 
|-
 
|-
 
|notes|| most useful on lists of armor to display the armor type
 
|notes|| most useful on lists of armor to display the armor type
  +
|-
  +
|sorted||used by [[Template:Mob]] to sort the list of dropped items
 
|-
 
|-
 
!rowspan="5"|questlink
 
!rowspan="5"|questlink

Latest revision as of 14:20, 7 December 2016

This replaces my original template using the #while function to control the looping.

The difference between this and my original listproc templates is that this approach has no limit to the length of the lists. We do still have a list length issue because of the 99 Expensive Parser Functions limit. For instance, a Template:Mob page for a Merchant or Instructor that uses the Drops fields to list the For Sale items, or a Boss page that lists everything they drop, will exceed this limit causing the item icons to stop rendering once this limit is surpassed. At this time there is nothing we can do about this limit.


This duplicates, in wikicode, a function, that I miss very much from ZAM. We had a wiki function called #commalist that would take multiple lists and process them against a mask to create displays.

The basic idea is to have a group of comma-delimited lists, each of which defines a part of what I need. Note: MediaWiki does not allow recursion.

See also: Template:Clistproc, Template:nolistproc

Dependent Extensions

This template makes extensive use of #SimpleSort, written by Clark Verbrugge (MediaWiki user clump). This uses the "keyed" option to sort list 2 thru mobtypes in the same order as list1 to maintain the connections.

#while from Extension:Loops (by David M. Sledge and Daniel Werner) is also used/needed.

Usage

{{ulistproc
|pre=
|linker=
|list1=
|list3=
|list4=
|list5=
|notes=
|mobtypes=
|type=
|noprefix=
|usebr=
|px=
|ol=
|noicon=
|sorted=
|}}

pre=

Display this before each call to the linker. Added specifically for Template:BWItem to display "Quest " to the left of each quest name this item is needed for.

list1= to list5=

With the above fields, we are going to extract the first value from each and use it to build a call to [[Template: {{{linker|}}}]] while building an Unordered List. list1 controls the output. if list1 has fewer elements than the others, it will stop when it runs out of list1. If list1 has more, it will treat the short lists as blanks. list2 is ONLY needed if you need to be able to use alternate names for values in list1. If list1 contains a blank element processing will stop there.

notes=

if the value is not blank it is placed to the right of the linker call, inside parentheses, as a note

mobtypes=

This is only needed IF linker=moblink. This allows you to tell if each mob in the list is a Monster, NPC, Passive or Ambience.

type=

If you are using this for zonelink or poilink calls on a Quest, Object or Mob page, you use this to tell the linker to add the ...by Zone or ...by POI category. Generally, suers do not need to worry about this, as the Quest, Object or Mob template will set the type= when it calls Ulistproc.

noprefix=

Currently, this only applies if linker=questlink.

usebr=

If NOT blank, make this a vertical list using <br /> instead of <ul>. Default is to make this an Unordered List.
px=
Used only by classlink to set the class icon size
ol
(switch) use Ordered List instead of the default of Unordered List. Ordered List means the list is numbered instead of using bullets.
noicon
passed to linker. Used if linker=itemlink
sorted
(switch) IF non-blank, sort the lists using #SimpleSort!
Linker-Specific Notes
Linker Skeleton Parameters Notes
moblink
{{ulistproc
|linker=moblink
|list1=
|list2=
|mobtypes=
|}}
list1 mob name
list2 not likely to be needed
mobtypes NPC, Monster, Passive or Ambience
itemlink
{{ulistproc
|linker=itemlink
|list1=
|list2=
|list3=
|list4=
|notes=
|sorted=y
|}}
list1 items
list2 not needed
list3 quantity
list4 quality
notes most useful on lists of armor to display the armor type
sorted used by Template:Mob to sort the list of dropped items
questlink
{{ulistproc
|linker=questlink
|list1=
|list2=
|list3=
|list4=
|list5=
|}}
list1 quest names
list2 actual quest name with missing punctuation (if any)
list3 level
list4 questtype (Daily, Public, Epic, etc
list5 party (Group, Raid, Group 4, etc)


Bludwyng
This template was created, or is maintained, by Bludwyng (contribs).

In-game, you can find me on Ayvenas. I regularly play: Mithrandyr, Bludwyng, Grymjack, and Kerfuffle.


Bludwyng's: PagesTemplatesWants/HavesSandbox