Template: Blog post

No edit summary
No edit summary
 
(32 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
<!--
This template uses Extension:Cargo.
Make sure Cargo is installed and enabled before using this template.
-->
{{#cargo_declare:
{{#cargo_declare:
  _table=blog_posts
_table=blog_posts
  | title=String
| title=String
  | date=Date
| date=Date
  | authors=List (;) of Page
| authors=List (;) of Page
  | image=File
| image=File
  | image_alt=String
| image_alt=String
  | description=Wikitext string
| description=Wikitext string
  | keywords=List (;) of Page
| keywords=List (;) of String
  | mode=String (allowed values=draft,featured,hidden)
| mode=String (allowed values=draft,featured,hidden)
}}
}}
<!-- Optional: link to documentation subpage if you make one -->
{{documentation}}
{{documentation}}
</noinclude><includeonly>
</noinclude><includeonly>{{#cargo_store:
{{#cargo_store:
_table=blog_posts
  _table=blog_posts
| title={{{title|{{PAGENAME}}}}}
  | title={{{title|{{PAGENAME}}}}}
| date={{{date|}}}
  | date={{{date|}}}
| authors={{{authors|{{{author|}}}}}}
  | authors={{{authors|{{{author|}}}}}}
| image={{{image|}}}
  | image={{{image|}}}
| image_alt={{{image_alt|{{{description|}}}}}}
  | image_alt={{{image_alt|}}}
| description={{{description|}}}
  | description={{{description|}}}
| keywords={{{keywords|}}}
  | keywords={{{keywords|}}}
| mode={{{mode|}}}
  | mode={{{mode|}}}
}}<templatestyles src="Template:Blog_post/styles.css" />
}}
{{DISPLAYTITLE:{{{title|{{PAGENAME}}}}}}}<div class="blog-article"><div class="blog-byline">{{#if:{{{date|}}}|<span class="blog-date">{{#time:j F Y|{{{date}}}}}</span>}}{{#if:{{{authors|{{{author|}}}}}}|{{#if:{{{date|}}}| }}<span class="blog-authors"> by {{{authors|{{{author|}}}}}}</span>}}
 
</div>{{#if:{{{image|}}}|<div class="blog-hero">
<!-- Optional: TemplateStyles (create the stylesheet page shown below) -->
[[File:{{{image}}}|frameless|class=blog-hero-img|link=|alt={{{image_alt|}}}]]
<templatestyles src="Template:Blog_post/styles.css" />
</div>}}{{#if:{{{image_alt|}}}|<div class="blog-hero-cap" style="padding-bottom:10px;">{{{image_alt}}}</div>}}{{#if:{{{description|}}}|<!--<p class="blog-standfirst">--><h3 style="text-align:center;padding-bottom:0px;margin-bottom:30px;">{{{description}}}</h3><!--</p>-->}}
 
<div class="blogpost">
 
  <!-- Banner image (hidden if hide_banner=yes or image not set) -->
  {{#if:{{{hide_banner|}}}||
    {{#if:{{{image|}}}|
      [[File:{{{image}}}|class=blogpost-banner|alt={{{image_alt|{{{description|}}}}}}]]
    }}
  }}
 
  <!-- Title -->
  <h1 class="blogpost-title">{{{title|{{PAGENAME}}}}}</h1>
 
  <!-- Meta line -->
  <div class="blogpost-meta">
    {{#if:{{{date|}}}|<span class="blogpost-date">{{{date}}}</span>}}
    {{#if:{{{authors|{{{author|}}}}}}|
      {{#if:{{{date|}}}| }}<span class="blogpost-authors">{{{authors|{{{author|}}}}}}</span>
    }}
    {{#if:{{{mode|}}}| <span class="blogpost-mode">{{{mode}}}</span>}}
  </div>
 
  <!-- Description / standfirst -->
  {{#if:{{{description|}}}|
    <div class="blogpost-desc">{{{description}}}</div>
  }}
 
  <!-- Keywords display (optional, semicolon-separated if you want Cargo to parse to pages) -->
  {{#if:{{{keywords|}}}|
    <div class="blogpost-keywords"><b>Keywords:</b> {{{keywords}}}</div>
  }}
 
</div>
</div>
<!-- Auto-categorize -->
[[Category:Blog posts]]
[[Category:Blog posts]]
</includeonly>
</includeonly>

Latest revision as of 23:15, 1 October 2025

This template defines the table "blog_posts". View table. Template:Documentation

Discuss this page