Difference between revisions of "Template:Sublist"

From QBWiki
Jump to navigation Jump to search
m
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>{{Add|sublist_index|1}}{{#vardefine:sublist_{{#var:sublist_index}}|{{{1|}}}}}{{{1|}}}</includeonly><noinclude>
 
<includeonly>{{Add|sublist_index|1}}{{#vardefine:sublist_{{#var:sublist_index}}|{{{1|}}}}}{{{1|}}}</includeonly><noinclude>
 
{{Template doc|
 
{{Template doc|
An attempt to get around the 1000 character limit for functions in [https://www.mediawiki.org/wiki/Extension:ParserFunctions/String_functions ParserFunctions] when constructing a list that can be accessed with [[Template:List lookup helper|List lookup helper]].
+
An attempt to get around the 1000 character limit for functions in [https://www.mediawiki.org/wiki/Extension:ParserFunctions/String_functions ParserFunctions] when constructing a list that can be accessed with [[Template:List lookup helper/sublist case|List lookup helper/sublist case]].
 +
 
 +
* sublist_index - is equal to the number of sublists (up to this point)
  
 
For long lists, subsections should be split into sections of less than 1000 characters.
 
For long lists, subsections should be split into sections of less than 1000 characters.
  
 
<pre>
 
<pre>
{{Sublist|*entry 1}}
+
{{Sublist|*entry 1
 +
* entry 2
 +
* entry 3
 +
* entry 4}}
 
{{#var:sublist_index}}: {{#var:sublist_1}}
 
{{#var:sublist_index}}: {{#var:sublist_1}}
{{Sublist|*entry 2}}
+
{{Sublist|*entry 5}}
 
{{#var:sublist_index}}: {{#var:sublist_2}}
 
{{#var:sublist_index}}: {{#var:sublist_2}}
 
</pre>
 
</pre>
  
{{Sublist|*entry 1}}
+
{{Sublist|*entry 1
 +
* entry 2
 +
* entry 3
 +
* entry 4}}
 
{{#var:sublist_index}}: {{#var:sublist_1}}
 
{{#var:sublist_index}}: {{#var:sublist_1}}
{{Sublist|*entry 2}}
+
{{Sublist|*entry 5}}
 
{{#var:sublist_index}}: {{#var:sublist_2}}
 
{{#var:sublist_index}}: {{#var:sublist_2}}
  
 
}}</noinclude>
 
}}</noinclude>

Latest revision as of 18:41, 20 December 2025

Template documentation

An attempt to get around the 1000 character limit for functions in ParserFunctions when constructing a list that can be accessed with List lookup helper/sublist case.

  • sublist_index - is equal to the number of sublists (up to this point)

For long lists, subsections should be split into sections of less than 1000 characters.

{{Sublist|*entry 1
* entry 2
* entry 3
* entry 4}}
{{#var:sublist_index}}: {{#var:sublist_1}}
{{Sublist|*entry 5}}
{{#var:sublist_index}}: {{#var:sublist_2}}
  • entry 1
  • entry 2
  • entry 3
  • entry 4

1:

  • entry 1
  • entry 2
  • entry 3
  • entry 4
  • entry 5

2:

  • entry 5