Difference between revisions of "Template:ContentTemplateModernInline"

From Holdfast: Nations At War
Jump to navigation Jump to search
(Created page with "<!-- Modern content layout with ZERO site CSS and NO TemplateStyles. Everything is inline. Media queries aren't possible; use |layout=stack to force vertical layout. -->...")
 
 
(40 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- Modern content layout with ZERO site CSS and NO TemplateStyles.
+
<!-- ContentTemplateModernInline — MW 1.35 safe --> {{HeaderTemplate|welcome={{{welcome|}}}|blurb={{{blurb|}}}}} {{#ifeq:{{{show_toc|no}}}|yes|__TOC__|__NOTOC__}}<nowiki/><!--trim--> <!-- Inline edit chips (off by default; set | show_tools = yes to show) --> {{#ifeq:{{{show_tools|no}}}|yes| <div style="display:flex;justify-content:flex-end;gap:.5rem;margin:.25rem 0 .5rem 0;font-size:.9em;"> {{#ifexist: {{FULLPAGENAME}}/Body | <span style="display:inline-block;padding:.25em .55em;border:1px solid #e5e7eb;border-radius:.5rem;background:#fff;"> [{{fullurl:{{FULLPAGENAME}}/Body|veaction=edit}} Edit body (VE)] </span> <span style="display:inline-block;padding:.25em .55em;border:1px solid #e5e7eb;border-radius:.5rem;background:#fff;"> [{{fullurl:{{FULLPAGENAME}}/Body|action=edit}} Edit body (source)] </span> <span style="display:inline-block;padding:.25em .55em;border:1px solid #e5e7eb;border-radius:.5rem;background:#fff;"> [{{fullurl:{{FULLPAGENAME}}/Body|action=history}} History] </span> | <span style="display:inline-block;padding:.25em .55em;border:1px solid #e5e7eb;border-radius:.5rem;background:#fff;"> [{{fullurl:{{FULLPAGENAME}}/Body|action=edit}} Create body] </span> }} </div> |}}<nowiki/><!--trim--> {{#switch:{{{layout|auto}}} | stack = <div class="cpage" role="presentation" style="display:block;overflow:hidden;border-top:1px solid transparent;margin-top:-{{{pullup|0.8em}}};padding-top:{{{pullup|0.8em}}};"> <div class="cpage__left" style="margin-bottom:{{{gap|1rem}}};"> {{SectionTemplate|title={{{sections_title|Sections}}}|content={{{sections_content|}}}}} </div> <div class="cpage__main" role="main" style="margin-bottom:{{{gap|1rem}}};"> {{#if:{{{about_content|}}}|{{SectionTemplate|title={{{about_title|About}}}|content={{{about_content}}}}}|}}<nowiki/><!--trim--> <!-- Featured: explicit content or auto /Body if it exists --> {{#if:{{{featured_content|}}} | {{SectionTemplate|title={{{featured_title|Featured}}}|content={{{featured_content}}}}} | {{#ifexist:{{FULLPAGENAME}}/Body | {{SectionTemplate|title={{{featured_title|Featured}}}|content={{:{{FULLPAGENAME}}/Body}} }} }} }}<nowiki/><!--trim--> {{#if:{{{news_content|}}}|{{SectionTemplate|title={{{news_title|News}}}|content={{{news_content}}}}}|}}<nowiki/><!--trim--> </div> <!-- Tools panel is desktop-only by default; enable on stack explicitly if needed --> {{#ifeq:{{{show_tools_panel_stack|no}}}|yes| {{SectionTemplate | title = {{{tools_title|Tools}}} | content = {{#ifexist: {{FULLPAGENAME}}/Body | * [{{fullurl:{{FULLPAGENAME}}/Body|veaction=edit}} Edit body (VE)] * [{{fullurl:{{FULLPAGENAME}}/Body|action=edit}} Edit body (source)] * [{{fullurl:{{FULLPAGENAME}}/Body|action=history}} Body history] * Last body edit: {{REVISIONUSER:{{FULLPAGENAME}}/Body}} — {{#time:Y-m-d H:i \U\T\C|{{REVISIONTIMESTAMP:{{FULLPAGENAME}}/Body}}}} | * [{{fullurl:{{FULLPAGENAME}}/Body|action=edit}} Create body] }} * — * [{{fullurl:{{FULLPAGENAME}}|veaction=edit}} Edit wrapper (VE)] * [{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit wrapper (source)] * [{{fullurl:{{FULLPAGENAME}}|action=history}} Wrapper history] * [{{fullurl:Special:WhatLinksHere/{{FULLPAGENAME}}}} What links here] * [{{fullurl:Special:RecentChangesLinked/{{FULLPAGENAME}}}} Changes to linked pages] * [{{fullurl:{{FULLPAGENAME}}|action=purge}} Purge cache] }} |}}<nowiki/><!--trim--> {{#ifexpr: {{#ifeq:{{{two_col|no}}}|yes|1|0}} + {{#if:{{{image_content|}}}|1|0}} = 2 | | {{#if:{{{image_content|}}}|<div class="cpage__aside" role="complementary">{{{image_content}}}</div>|}} }} </div> | #default = <div class="cpage" role="presentation" style="display:flex;align-items:flex-start;gap:{{{gap|1rem}}};overflow:hidden;border-top:1px solid transparent;margin-top:-{{{pullup|0.8em}}};padding-top:{{{pullup|0.8em}}};"> <div class="cpage__left" style="flex:0 0 {{{left_width|320px}}};min-width:260px;"> {{SectionTemplate|title={{{sections_title|Sections}}}|content={{{sections_content|}}}}} </div> <div class="cpage__main" role="main" style="flex:1 1 auto;min-width:0;"> {{#if:{{{about_content|}}}|{{SectionTemplate|title={{{about_title|About}}}|content={{{about_content}}}}}|}}<nowiki/><!--trim--> <!-- Featured: explicit content or auto /Body if it exists --> {{#if:{{{featured_content|}}} | {{SectionTemplate|title={{{featured_title|Featured}}}|content={{{featured_content}}}}} | {{#ifexist:{{FULLPAGENAME}}/Body | {{SectionTemplate|title={{{featured_title|Featured}}}|content={{:{{FULLPAGENAME}}/Body}} }} }} }}<nowiki/><!--trim--> {{#if:{{{news_content|}}}|{{SectionTemplate|title={{{news_title|News}}}|content={{{news_content}}}}}|}}<nowiki/><!--trim--> </div> <!-- Optional image/right aside --> {{#ifexpr: {{#ifeq:{{{two_col|no}}}|yes|1|0}} + {{#if:{{{image_content|}}}|1|0}} = 2 | | {{#if:{{{image_content|}}}|<div class="cpage__aside" role="complementary" style="flex:0 0 {{{aside_width|320px}}};min-width:260px;">{{{image_content}}}</div>|}} }} <!-- Tools panel (third column on desktop) --> {{#ifeq:{{{show_tools_panel|yes}}}|yes|
    Everything is inline. Media queries aren't possible; use |layout=stack to force vertical layout. -->
+
<div class="cpage__tools" style="flex:0 0 {{{tools_width|260px}}};min-width:240px;">
 +
{{SectionTemplate
 +
| title = {{{tools_title|Tools}}}
 +
| content =
 +
<div class="plainlinks">
 +
<ul style="margin:0; padding-left:1.2em;">
 +
{{#ifexist:{{FULLPAGENAME}}/Body
 +
| <li>[{{fullurl:{{FULLPAGENAME}}/Body|veaction=edit}} Edit body (VE)]</li>
 +
<li>[{{fullurl:{{FULLPAGENAME}}/Body|action=edit}} Edit body (source)]</li>
 +
<li>[{{fullurl:{{FULLPAGENAME}}/Body|action=history}} Body history]</li>
 +
<li>Last body edit: [[User:{{REVISIONUSER:{{FULLPAGENAME}}/Body}}|{{REVISIONUSER:{{FULLPAGENAME}}/Body}}]] — {{#time:Y-m-d H:i \\U\\T\\C|{{REVISIONTIMESTAMP:{{FULLPAGENAME}}/Body}}}}</li>
 +
| <li>[{{fullurl:{{FULLPAGENAME}}/Body|action=edit}} Create body]</li>
 +
}}
 +
<li>—</li>
 +
<li>[{{fullurl:{{FULLPAGENAME}}|veaction=edit}} Edit wrapper (VE)]</li>
 +
<li>[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit wrapper (source)]</li>
 +
<li>[{{fullurl:{{FULLPAGENAME}}|action=history}} Wrapper history]</li>
 +
<li>[{{fullurl:Special:WhatLinksHere/{{FULLPAGENAME}}}} What links here]</li>
 +
<li>[{{fullurl:Special:RecentChangesLinked/{{FULLPAGENAME}}}} Changes to linked pages]</li>
 +
<li>[{{fullurl:{{FULLPAGENAME}}|action=purge}} Purge cache]</li>
 +
</ul>
 +
</div>
 +
}}
 +
</div>
 +
|}}
 +
</div>
  
{{HeaderTemplate|welcome={{{welcome|}}}|blurb={{{blurb|}}}}}
 
  
<!-- Defaults -->
 
{{#vardefine:gap|{{{gap|1rem}}} }}
 
{{#vardefine:left_width|{{{left_width|320px}}} }}
 
{{#vardefine:aside_width|{{{aside_width|320px}}} }}
 
{{#vardefine:show_toc|{{{show_toc|no}}} }}
 
{{#vardefine:show_section_edit|{{{show_section_edit|no}}} }}
 
{{#vardefine:layout|{{lc:{{{layout|auto}}}}} }} <!-- auto|stack -->
 
 
<!-- Wrapper (switch for layout) -->
 
{{#switch:{{#var:layout}}
 
| stack =
 
  <div class="cpage" role="presentation" style="display:block;">
 
    <!-- Left column -->
 
    <div class="cpage__left" style="margin-bottom:{{#var:gap}};">
 
      {{SectionTemplate
 
        |title  = {{{sections_title|Sections}}}
 
        |content = {{{sections_content|}}}
 
      }}
 
    </div>
 
 
    <!-- Main column -->
 
    <main class="cpage__main" role="main" style="margin-bottom:{{#var:gap}};">
 
      {{#if:{{{about_content|}}}|
 
        {{SectionTemplate|title={{{about_title|About}}}|content={{{about_content}}}}}
 
      |}}
 
      {{#if:{{{featured_content|}}}|
 
        {{SectionTemplate|title={{{featured_title|Featured}}}|content={{{featured_content}}}}}
 
      |}}
 
      {{#if:{{{news_content|}}}|
 
        {{SectionTemplate|title={{{news_title|News}}}|content={{{news_content}}}}}
 
      |}}
 
    </main>
 
 
    <!-- Optional aside -->
 
    {{#if:{{{image_content|}}}|
 
      <aside class="cpage__aside" role="complementary">
 
        {{{image_content}}}
 
      </aside>
 
    |}}
 
  </div>
 
| #default =
 
  <div class="cpage" role="presentation" style="display:flex;align-items:flex-start;gap:{{#var:gap}};">
 
    <!-- Left column -->
 
    <div class="cpage__left" style="flex:0 0 {{#var:left_width}};min-width:260px;">
 
      {{SectionTemplate
 
        |title  = {{{sections_title|Sections}}}
 
        |content = {{{sections_content|}}}
 
      }}
 
    </div>
 
 
    <!-- Main column -->
 
    <main class="cpage__main" role="main" style="flex:1 1 auto;min-width:0;">
 
      {{#if:{{{about_content|}}}|
 
        {{SectionTemplate|title={{{about_title|About}}}|content={{{about_content}}}}}
 
      |}}
 
      {{#if:{{{featured_content|}}}|
 
        {{SectionTemplate|title={{{featured_title|Featured}}}|content={{{featured_content}}}}}
 
      |}}
 
      {{#if:{{{news_content|}}}|
 
        {{SectionTemplate|title={{{news_title|News}}}|content={{{news_content}}}}}
 
      |}}
 
    </main>
 
 
    <!-- Optional aside -->
 
    {{#if:{{{image_content|}}}|
 
      <aside class="cpage__aside" role="complementary" style="flex:0 0 {{#var:aside_width}};min-width:260px;">
 
        {{{image_content}}}
 
      </aside>
 
    |}}
 
  </div>
 
 
}}
 
}}
 
<!-- TOC / edit link toggles -->
 
{{#ifeq:{{#var:show_toc}}|yes||__NOTOC__}}
 
{{#ifeq:{{#var:show_section_edit}}|yes||__NOEDITSECTION__}}
 
 
<noinclude>[[Category:Templates]]</noinclude>
 

Latest revision as of 20:38, 18 September 2025

Navigation menu