Template:Character Tabs: Difference between revisions

Template page
m (change to autopopulate from subpages)
m (change to use SubPageList extension)
Line 1: Line 1:
<includeonly>
<includeonly>{{#subpages:
<div class="NOL-tabs" style="margin:0px;display:inline-block;">
|page={{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}
<li style="display:inline-block;">[[{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}|Main]]<span class="NOL-tabs-divider"> &middot; </span></li>
|format=ul
</div> <div class="NOL-tabs" style="margin-left: -22.4px; margin-bottom: -6px; display:inline-block !important;">{{Special:PrefixIndex/{{{1}}}/|hideredirects=1 |stripprefix=1}}</div>
|pathstyle=
<!--
|showpage=no
|element=div
|class=NOL-tabs
|kidsonly=yes
|default=<span style="display:none;"></span>
}}<!--
--></includeonly><!--
--></includeonly><!--


Line 10: Line 15:
--><noinclude>
--><noinclude>
== Usage ==
== Usage ==
This template will not show links to pages that do not exist (i.e. are redlinked and carry the class "new" (<code>a.new</code>). <ref>This feature requires the following lines of css be added to any skin (i.e. to "Common.css" and "Mobile.css") that does not already include it (any skin other than the Cathedral skin):
<pre>
/* CUSTOM TABS */
ul.NOL-tabs {
margin:0px !important;
}
.NOL-tabs li {
display: inline-block;
}
/* float the bullet points to the left of each item */
.NOL-tabs-divider {
    float: left;
    margin: 0px 5px;
}
/* hide new links */
.NOL-tabs li a.new {
    display: none !important;
}
/* hide bullet points for new links */
.NOL-tabs li a.new ~ span.NOL-tabs-divider {
    display: none;
}
/* hide bullet points for the first listed item */
.NOL-tabs li:first-child a ~ span.NOL-tabs-divider {
display:none;
}</pre></ref>
{{Character Tabs|Lambda-11|λ-No.11-}}
{{Character Tabs|BlazBlue: Cross Tag Battle}}
<pre><nowiki>
<pre><nowiki>
On the character's page:
{{Character Tabs|character name}}
{{Character Tabs|character name}}
{{Character Tabs|Kagura Mutsuki}}


On a character's Main page for characters with a different display name (i.e. the Murakumo Units):
or for pages with different display names:
{{Character Tabs|character name|displayname}}
{{Character Tabs|Λ-No.11-|Lambda-11}}
{{Character Tabs|Lambda-11|λ-No.11-}}
</nowiki></pre>
</nowiki></pre>


This tab includes links to the following subpages:
== Testing ==
<pre>
1 Character {{Character Tabs|Λ-No.11-|Lambda-11}}
(Main)
2 Character {{Character Tabs|Bang Shishigami}}
Gallery
3 BBTAG {{Character Tabs|BlazBlue: Cross Tag Battle}}
Gameplay
4 No subpages {{Character Tabs|Template:Character Tabs}}
Quotes
5
</pre>
6
== Notes ==
Uses the [https://github.com/JeroenDeDauw/SubPageList/blob/master/doc/USAGE.md SubPageList] extension, which supposedly should work as intended. However, template parsing fails and showpage=yes might not be working as intended (instead of being appended to the list as a list item ("li" element), it is being appended as a separate paragraph ("p" element), which complicates styliing).
 
For now tabs will only show the list of subpages.


== Notes ==
{{#tag:references}}
{{#tag:references}}


</noinclude>
</noinclude>

Revision as of 23:09, 28 February 2018

Usage

{{Character Tabs|character name}}

or for pages with different display names:
{{Character Tabs|Λ-No.11-|Lambda-11}}

Testing

1 Character

2 Character

3 BBTAG

4 No subpages 5 6

Notes

Uses the SubPageList extension, which supposedly should work as intended. However, template parsing fails and showpage=yes might not be working as intended (instead of being appended to the list as a list item ("li" element), it is being appended as a separate paragraph ("p" element), which complicates styliing).

For now tabs will only show the list of subpages.