Template:Article header: Difference between revisions

Current answers. Practical procedures. Reliable reference.
Jump to navigation Jump to search
Suppress content-type suffix when primary section falls back
Render linked contextual article eyebrow segments
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<p class="edfm-eyebrow noexcerpt">EDFM // {{#invoke:PageContext|getPrimarySection|page={{{page|}}}|section={{{section|}}}|topic={{{topic|}}}}}{{#if:{{#invoke:PageContext|getDisplayContentType|page={{{page|}}}|section={{{section|}}}|topic={{{topic|}}}|type={{{type|}}}|contentType={{{contentType|}}}}}| / {{#invoke:PageContext|getDisplayContentType|page={{{page|}}}|section={{{section|}}}|topic={{{topic|}}}|type={{{type|}}}|contentType={{{contentType|}}}}}}}</p>{{#if:{{{deck|}}}|<p class="edfm-deck">{{{deck|}}}</p>}}<noinclude>
<p class="edfm-eyebrow noexcerpt">EDFM // {{#invoke:PageContext|renderEyebrowBody|page={{{page|}}}|section={{{section|}}}|topic={{{topic|}}}|context={{{context|}}}|secondaryContext={{{secondaryContext|}}}|type={{{type|}}}|contentType={{{contentType|}}}}}</p>{{#if:{{{deck|}}}|<p class="edfm-deck">{{{deck|}}}</p>}}<noinclude>
== Usage ==
== Usage ==
Adds the EDFM context eyebrow and/or a muted one-line description ("deck") near the article title.
Adds the EDFM context eyebrow and/or a muted one-line description ("deck") near the article title.


Normal pages should not provide an eyebrow manually. [[Module:PageContext]] resolves two separate dimensions:
Normal pages should not provide an eyebrow manually. [[Module:PageContext]] resolves three separate semantic dimensions:


* primary topic/section, such as <code>Engineering</code>, <code>Mining</code>, or <code>Ships & Equipment</code>;
* primary topic/section, such as <code>Engineering</code>, <code>Mining</code>, or <code>Ships & Equipment</code>;
* optional secondary context, such as <code>Ships</code>, <code>Modules</code>, <code>Weapons</code>, or <code>Engineers</code>;
* optional content type, currently used for meaningful types such as <code>Field Procedures</code>.
* optional content type, currently used for meaningful types such as <code>Field Procedures</code>.
The visible eyebrow intentionally stays compact: <code>EDFM //</code> plain text followed by a linked primary section and, at most, one second segment. Content type takes display priority over ordinary secondary context.


<pre>
<pre>
Line 14: Line 17:
</pre>
</pre>


Use <code>section=</code> and/or <code>type=</code> only for genuine exceptions that cannot be resolved from structured data or central rules:
Use <code>section=</code>, <code>context=</code>, and/or <code>type=</code> only for genuine exceptions that cannot be resolved from structured data or central rules:


<pre>
<pre>
{{Article header
{{Article header
  |section=Engineering
  |section=Engineering
|context=Engineers
  |type=Field Procedures
  |type=Field Procedures
  |deck=Optional one-line description shown under the title.
  |deck=Optional one-line description shown under the title.
Line 24: Line 28:
</pre>
</pre>


The rendered eyebrow is presentation text such as <code>EDFM // Engineering / Field Procedures</code>. The real page title remains the semantic H1. [[MediaWiki:Common.js]] moves the eyebrow above the H1 visually when JavaScript is available; without JavaScript it remains in article content below the H1.
The rendered eyebrow is presentation text such as <code>EDFM // [[Engineering]] / [[Field Procedures]]</code>. The real page title remains the semantic H1. [[MediaWiki:Common.js]] moves the eyebrow above the H1 visually when JavaScript is available; without JavaScript it remains in article content below the H1.


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 21:58, 24 August 2026

EDFM // Reference

Usage

Adds the EDFM context eyebrow and/or a muted one-line description ("deck") near the article title.

Normal pages should not provide an eyebrow manually. Module:PageContext resolves three separate semantic dimensions:

  • primary topic/section, such as Engineering, Mining, or Ships & Equipment;
  • optional secondary context, such as Ships, Modules, Weapons, or Engineers;
  • optional content type, currently used for meaningful types such as Field Procedures.

The visible eyebrow intentionally stays compact: EDFM // plain text followed by a linked primary section and, at most, one second segment. Content type takes display priority over ordinary secondary context.

{{Article header
 |deck=Optional one-line description shown under the title.
}}

Use section=, context=, and/or type= only for genuine exceptions that cannot be resolved from structured data or central rules:

{{Article header
 |section=Engineering
 |context=Engineers
 |type=Field Procedures
 |deck=Optional one-line description shown under the title.
}}

The rendered eyebrow is presentation text such as EDFM // Engineering / Field Procedures. The real page title remains the semantic H1. MediaWiki:Common.js moves the eyebrow above the H1 visually when JavaScript is available; without JavaScript it remains in article content below the H1.