Difference between revisions of "Template:Navbar-table"

From blackwiki
Jump to navigation Jump to search
test>Pizzahut2
m (Zero width space. Better would be plain=y if you can get this parameter to work inside this template.)
test>Pizzahut2
(Reverting to version from 20 December 2018, since VE is currently working again.)
Line 1: Line 1:
<includeonly>{{-}}{{navbar|{{#if:{{{template|}}}|{{{template}}}|{{{1}}}}}|brackets=y|text={{#if:{{{heading|}}}|'''{{{heading}}}'''|{{#if:{{{2|}}}|'''{{{2}}}'''|&#x200b;}}}}|style=position: relative; bottom: -11px;}}</includeonly><noinclude>
+
<includeonly>{{-}}{{navbar|{{#if:{{{template|}}}|{{{template}}}|{{{1}}}}}|brackets=y|text={{#if:{{{heading|}}}|'''{{{heading}}}'''&nbsp;|{{#if:{{{2|}}}|'''{{{2}}}'''&nbsp;}}}}<nowiki>[</nowiki>&thinsp;{{vedit|Template:{{#if:{{{template|}}}|{{{template}}}|{{{1}}}}}|<span title{{=}}"Edit this template with the VE. (Doesn't work if new wikitext mode is enabled.)">VisualEditor</span>}}&thinsp;<nowiki>]</nowiki>|style=position: relative; bottom: -11px;}}</includeonly><noinclude>{{navbar-table|Navbar-table|Optional heading}}
{{navbar-table|Navbar-table|Optional heading}}
 
 
{{Documentation|content=
 
{{Documentation|content=
 
Navigation bar for table templates, positioned above the table.
 
Navigation bar for table templates, positioned above the table.
Line 11: Line 10:
 
* <code><nowiki>{{navbar-table|template={{subst:PAGENAME}}}}</nowiki></code>
 
* <code><nowiki>{{navbar-table|template={{subst:PAGENAME}}}}</nowiki></code>
 
* <code><nowiki>{{navbar-table|template={{subst:PAGENAME}}|heading=</nowiki></code>''heading''<code><nowiki>}}</nowiki></code>
 
* <code><nowiki>{{navbar-table|template={{subst:PAGENAME}}|heading=</nowiki></code>''heading''<code><nowiki>}}</nowiki></code>
 +
 +
Note: Popular [[Template:Table cell templates|table cell templates]] (e.g. yes, no, tba, n/a) can cause issues when using the VisualEditor. The reason is that these templates contain a pipe character to separate formatting and text, but the VisualEditor isn't aware of this. As a result, table operations which change the table structure, such as merging/splitting cells or inserting/deleting/moving rows or columns, may not work properly.
 +
 +
Possible work-arounds for this issue:
 +
* Using plain text instead of a table cell template (e.g. <code>TBA</code>). This could also be done temporarily until visual editing is complete.
 +
* Adding subst: in front of the template name (e.g. <code><nowiki>{{subst:tba}}</nowiki></code>), so the table cell formatting is inserted into the source. The downside of this method is that future changes to the table cell templates won't be applied.
 
}}
 
}}
 
</noinclude>
 
</noinclude>

Revision as of 17:31, 20 June 2019

Template documentation

Navigation bar for table templates, positioned above the table.

Usage:

  • {{navbar-table|{{subst:PAGENAME}}}}
  • {{navbar-table|{{subst:PAGENAME}}|heading}}

Optionally you can also use named parameters:

  • {{navbar-table|template={{subst:PAGENAME}}}}
  • {{navbar-table|template={{subst:PAGENAME}}|heading=heading}}

Note: Popular table cell templates (e.g. yes, no, tba, n/a) can cause issues when using the VisualEditor. The reason is that these templates contain a pipe character to separate formatting and text, but the VisualEditor isn't aware of this. As a result, table operations which change the table structure, such as merging/splitting cells or inserting/deleting/moving rows or columns, may not work properly.

Possible work-arounds for this issue:

  • Using plain text instead of a table cell template (e.g. TBA). This could also be done temporarily until visual editing is complete.
  • Adding subst: in front of the template name (e.g. {{subst:tba}}), so the table cell formatting is inserted into the source. The downside of this method is that future changes to the table cell templates won't be applied.