https://www.infra-repository.org/oiar-2013/index.php?title=Template:Get_Element_Types&feed=atom&action=history
Template:Get Element Types - Revision history
2024-03-29T05:41:24Z
Revision history for this page on the wiki
MediaWiki 1.40.0
https://www.infra-repository.org/oiar-2013/index.php?title=Template:Get_Element_Types&diff=1024&oldid=prev
Jan Schoonderbeek: updated search and explanation
2012-12-29T10:55:40Z
<p>updated search and explanation</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:55, 29 December 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><noinclude></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><noinclude></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Templates]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Templates]]</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>This template only serves to find all element types for a given page. It is called with only one parameter:</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>This template only serves to find all element types for a given page <ins style="font-weight: bold; text-decoration: none;">- it doesn't print them</ins>. It is called with only one parameter <ins style="font-weight: bold; text-decoration: none;">''page''</ins>:</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre><nowiki></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre><nowiki></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Get Element Types|page=}}</nowiki></pre></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Get Element Types|page=}}</nowiki></pre></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>After calling this template, there exist two arrays (using [http://www.mediawiki.org/wiki/Extension:ArrayExtension extension ArrayExtension]):</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>After calling this template, there exist two arrays (using [http://www.mediawiki.org/wiki/Extension:ArrayExtension extension ArrayExtension]):</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* Array "Cats", containing all categories that ''page'' is a member of <del style="font-weight: bold; text-decoration: none;">(with a comma as delimiter)</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* Array "Cats", containing all categories that ''page'' is a member of<ins style="font-weight: bold; text-decoration: none;">;</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* Array "ElementTypes", containing the types of element that the ''page'' is a member of (stripped of the prefix "Element type" <del style="font-weight: bold; text-decoration: none;">and with a comma as delimiter</del>)</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* Array "ElementTypes", containing the types of element that the ''page'' is a member of (stripped of the prefix "Element type")</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Thus, if page ''EL.Example'' is a member of categories ''FooBar, Element type foo, Element type bar'', then<br> </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Thus, if page ''EL.Example'' is a member of categories ''FooBar, Element type foo, Element type bar'', then<br> </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Cats=''FooBar, Element type foo, Element type bar''<br></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Cats=''FooBar,Element type foo,Element type bar''<br></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>ElementTypes=''foo, bar''</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>ElementTypes=''foo,bar''</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">After calling this template, you can access the categories and Element Types using the [http://www.mediawiki.org/wiki/Extension:ArrayExtension#arrayprint #arrayprint] function. An example that creates a pretty, comma delimited list:</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><pre><nowiki>{{#arrayprint:ElementTypes||@ |@ |print=pretty}}</nowiki></pre></ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>----</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>----</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div></noinclude><includeonly>{{#arraydefine:Cats|{{<del style="font-weight: bold; text-decoration: none;">#show:</del>{{{page}}}<del style="font-weight: bold; text-decoration: none;">|?Category|link=none|sep=,</del>}}|,|unique}}{{#<del style="font-weight: bold; text-decoration: none;">arraydefine</del>:ElementTypes<del style="font-weight: bold; text-decoration: none;">}}{{#arrayprint:</del>Cats|<del style="font-weight: bold; text-decoration: none;">|@@@@|<nowiki</del>/<del style="font-weight: bold; text-decoration: none;">>{{#switch:{{#sub:@@@@|0|13}}|</del>Element <del style="font-weight: bold; text-decoration: none;">type ={{#ifeq:{{#arraysize:ElementTypes}}</del>|0|<del style="font-weight: bold; text-decoration: none;">{{#arraydefine:ElementTypes</del>|{{#sub:<del style="font-weight: bold; text-decoration: none;">@@@@|13}}}}|{{#arraydefine:ElementTypes|{{#arrayprint:ElementTypes|,}},{{#sub:@@@@</del>|13<del style="font-weight: bold; text-decoration: none;">}}}}}}</del>}}}}</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div></noinclude><includeonly>{{#arraydefine:Cats|{{<ins style="font-weight: bold; text-decoration: none;">ShowCategories|page=</ins>{{{page}}}}}|,|unique}}{{#<ins style="font-weight: bold; text-decoration: none;">arraysearcharray</ins>:ElementTypes<ins style="font-weight: bold; text-decoration: none;">|</ins>Cats|/<ins style="font-weight: bold; text-decoration: none;">^</ins>Element<ins style="font-weight: bold; text-decoration: none;">\stype\s/</ins>|0|<ins style="font-weight: bold; text-decoration: none;">-1</ins>|{{#sub:<ins style="font-weight: bold; text-decoration: none;">$0</ins>|13}}}}</div></td></tr>
</table>
Jan Schoonderbeek
https://www.infra-repository.org/oiar-2013/index.php?title=Template:Get_Element_Types&diff=398&oldid=prev
Jan Schoonderbeek: start
2012-11-11T23:22:21Z
<p>start</p>
<p><b>New page</b></p><div><noinclude><br />
[[Category:Templates]]<br />
This template only serves to find all element types for a given page. It is called with only one parameter:<br />
<pre><nowiki><br />
{{Get Element Types|page=}}</nowiki></pre><br />
After calling this template, there exist two arrays (using [http://www.mediawiki.org/wiki/Extension:ArrayExtension extension ArrayExtension]):<br />
* Array "Cats", containing all categories that ''page'' is a member of (with a comma as delimiter)<br />
* Array "ElementTypes", containing the types of element that the ''page'' is a member of (stripped of the prefix "Element type" and with a comma as delimiter)<br />
Thus, if page ''EL.Example'' is a member of categories ''FooBar, Element type foo, Element type bar'', then<br> <br />
Cats=''FooBar, Element type foo, Element type bar''<br><br />
ElementTypes=''foo, bar''<br />
----<br />
</noinclude><includeonly>{{#arraydefine:Cats|{{#show:{{{page}}}|?Category|link=none|sep=,}}|,|unique}}{{#arraydefine:ElementTypes}}{{#arrayprint:Cats||@@@@|<nowiki/>{{#switch:{{#sub:@@@@|0|13}}|Element type ={{#ifeq:{{#arraysize:ElementTypes}}|0|{{#arraydefine:ElementTypes|{{#sub:@@@@|13}}}}|{{#arraydefine:ElementTypes|{{#arrayprint:ElementTypes|,}},{{#sub:@@@@|13}}}}}}}}}}</div>
Jan Schoonderbeek