Template: Blog post

(copied from https://en.wikiversity.org/w/index.php?title=Template:Blog_post&oldid=1590720)
 
(Fix 'date displayed' param, to ignore empty string.)
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><!--
<noinclude>
-->'''<time datetime="{{#time: c | {{{date|{{REVISIONTIMESTAMP}}}}} }}"><!--
{{#cargo_declare: _table = blog_posts
  -->{{{date displayed | {{#time: g:i a l, j F Y | {{{date|{{REVISIONTIMESTAMP}}}}} }}}}}<!--
| date        = Date
--></time>{{{p|.}}}'''<!--
| authors    = List (;) of Page
| image      = File
| keywords    = List (;) of Page
| description = Wikitext string
| mode        = String (allowed values=draft,featured,hidden)
}}
</noinclude><includeonly>
{{#cargo_store: _table = blog_posts
| date        = {{{date|}}}
| authors    = {{#if: {{{authors|}}} | {{{authors|}}} | {{{author|}}} }}
| image      = {{{image|}}}
| keywords    = {{{keywords|}}}
| description = {{{description|}}}
| mode        = {{{mode|}}}
}}<!--


# Categorise if this isn't a draft:
Image:
-->{{#if: {{{draft|}}} <!--
-->{{#if: {{{hide_banner|}}} | <!-- no banner --> |<!--
     --> | {{draft|text=This post is a draft and is subject to change without notice.}} [[Category:Draft blog posts]]<!--
    -->{{#if: {{{image|}}}
    --> | [[Category:Blog posts by {{#titleparts:{{PAGENAME}}|1}}]]<!--
        | {{PAGEBANNER:{{{image|}}}|link=|origin={{{image_origin|0,0}}}}}
-->}}</includeonly><noinclude>
    }}<!--
-->}}<!--
 
Description:
-->{{#if: {{{description|}}}
  | <div style="font-size:larger; margin:1em 0">{{{description}}}</div>
}}<!--
 
Start meta line:
--><div style="color:#444; font-size:smaller; margin-bottom:2em;"><!--
 
Date:
--><time datetime="{{#time: c | {{{date|{{REVISIONTIMESTAMP}}}}} }}"><!--
  -->{{#if: {{{date displayed|}}}<!--
     -->| {{{date displayed}}}
    -->| {{#time: j F Y | {{{date| {{REVISIONTIMESTAMP}} }}} }}<!--
  -->}}<!--
--></time><!--
 
Authors:
-->{{#invoke: blog_post | authorList |format=linked |author={{{author|}}} |authors={{{authors|}}} }}<!--
 
Ending punctuation:
-->{{{p|.}}}&#32;<!--
 
Keywords:
-->{{#if: {{{keywords|}}} | <span style="font-variant:small-caps; font-size:smaller">Keywords: {{#arraymap:{{{keywords|}}}|;|QQQ|[[QQQ]][[Category:QQQ]]|&#32;&middot;&#32;}}</span> }}<!--
 
End meta line.
--></div><!--
 
SEO:
-->{{#seo:
| type        = article
| description = {{{description|A blog post from Wikimedia Australia.}}}
| author      = {{#invoke: blog_post | authorList |format=plain |author={{{author|}}} |authors={{{authors|}}} }}
| keywords    = {{{keywords|}}}
| image      = {{filepath:{{{image}}}|800}}
}}<!--
 
# Modes.
-->{{#switch: {{{mode|}}} <!--
  -->| draft = {{draft|text=This post is a draft and is subject to change without notice.}} <!--
  -->| featured = <!--
  -->| hidden = <!--
-->}}
</includeonly><noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Latest revision as of 02:20, 20 September 2023

This template defines the table "blog_posts". View table.

[edit] Template documentation

This template is used on blog posts that are shown on the news page and elsewhere.

To create a new post, enter its title in the box below:

A news feed is available for the most recent blog posts: https://wikimedia.org.au/news.rss

TemplateData

Template used to create the header on news posts.

[Edit template data]

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Datedate

The publication date of this post in YYYY-MM-DD format.

Daterequired
Descriptiondescription

Short sentence describing the post, shown on the news page and in social media previews etc.

Contentsuggested
Authorsauthors

Semicolon-separated list of author names. Each will be linked to their page on this wiki.

Stringoptional
Keywordskeywords

Comma-separated list of keywords (each keyword should be a wiki page).

Stringsuggested
Modemode

Either 'draft', 'featured', or 'hidden'.

Stringoptional
Image filenameimage

The filename (without 'File:') of an image to use for the page banner and to share on social media.

Fileoptional
Hide banner?hide_banner

Do not show the image as a banner. Can be useful for portrait-orientation images that should be shown on the news list page but not on the article itself.

Booleanoptional
Banner image originimage_origin

Focal point for the banner image, used to move the image up or down as required. See https://www.mediawiki.org/wiki/Extension:WikidataPageBanner#'origin'_parameter for more details.

Example
"0,1" for the top centre.
Stringoptional

See also

Discuss this page