Template:Article header: Difference between revisions

Current answers. Practical procedures. Reliable reference.
Jump to navigation Jump to search
No edit summary
Resolve article eyebrow sections dynamically
Line 1: Line 1:
<p class="edfm-eyebrow noexcerpt">{{{eyebrow|{{{1|}}}}}}</p>{{#if:{{{deck|}}}|<p class="edfm-deck">{{{deck|}}}</p>}}<noinclude>
<p class="edfm-eyebrow noexcerpt">{{#invoke:PageContext|eyebrow|page={{{page|}}}|section={{{section|}}}}}</p>{{#if:{{{deck|}}}|<p class="edfm-deck">{{{deck|}}}</p>}}<noinclude>
== Usage ==
== Usage ==
Optional. Adds a small category "eyebrow" label above the page's real
Adds the EDFM section eyebrow and/or a muted one-line description ("deck") near the article title.
title, and/or a muted one-line description ("deck") directly under it —
 
see the redesign brief's Article header mockup:
Normal pages should not provide an eyebrow manually. The section is resolved centrally by [[Module:PageContext]] using structured page data, centralized page-family rules, limited exceptions in [[Module:Data/PageSections]], and a safe fallback.


<pre>
<pre>
EDFM // COMMANDER REFERENCE
{{Article header
 
|deck=Optional one-line description shown under the title.
TOOLS & RESOURCES
}}
 
Community tools, applications and services commonly used by commanders.
</pre>
</pre>


Placement in the wikitext doesn't matter (top of the article is
Use <code>section=</code> only for genuine exceptions that cannot be resolved from structured data or family rules:
conventional) — a small script in [[MediaWiki:Common.js]] moves the
eyebrow line to sit visually above [[MediaWiki:Common.css|#firstHeading]]
on page load. The real page title stays the genuine, semantic H1 the whole
time; this only adds text before/after it, it never replaces it. If a
reader has JavaScript disabled, the eyebrow still renders — directly under
the title instead of above it — so nothing is lost, only the exact
placement changes.


<pre>
<pre>
{{Article header
{{Article header
  |eyebrow=EDFM // Commander Reference
  |section=Combat
  |deck=Optional one-line description shown under the title.
  |deck=Optional one-line description shown under the title.
}}
}}
</pre>
</pre>


Both parameters are optional; using just <code>eyebrow=</code> or just
The rendered eyebrow is presentation text such as <code>EDFM // Ships & Equipment</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.
<code>deck=</code> is fine.


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

Revision as of 21:16, 24 August 2026

EDFM // Reference

Usage

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

Normal pages should not provide an eyebrow manually. The section is resolved centrally by Module:PageContext using structured page data, centralized page-family rules, limited exceptions in Module:Data/PageSections, and a safe fallback.

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

Use section= only for genuine exceptions that cannot be resolved from structured data or family rules:

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

The rendered eyebrow is presentation text such as EDFM // Ships & Equipment. 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.