Template: Blog post
(new design) |
(Fix 'date displayed' param, to ignore empty string.) |
||
(15 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
{{#cargo_declare: _table = blog_posts | {{#cargo_declare: _table = blog_posts | ||
| date = Date | | date = Date | ||
| | | authors = List (;) of Page | ||
| image = File | | image = File | ||
| keywords = List (;) of Page | | keywords = List (;) of Page | ||
| description = Wikitext string | | description = Wikitext string | ||
| mode = String (allowed values=draft,featured,hidden) | |||
}} | }} | ||
</noinclude><includeonly> | </noinclude><includeonly> | ||
{{#cargo_store: _table = blog_posts | {{#cargo_store: _table = blog_posts | ||
| date = {{{date|}}} | | date = {{{date|}}} | ||
| | | authors = {{#if: {{{authors|}}} | {{{authors|}}} | {{{author|}}} }} | ||
| image = {{{image|}}} | | image = {{{image|}}} | ||
| keywords = {{{keywords|}}} | | keywords = {{{keywords|}}} | ||
| description = {{{description|}}} | | description = {{{description|}}} | ||
| mode = {{{mode|}}} | |||
}}<!-- | }}<!-- | ||
Image: | Image: | ||
-->{{#if: {{{image|}}} | -->{{#if: {{{hide_banner|}}} | <!-- no banner --> |<!-- | ||
-->{{#if: {{{image|}}} | |||
}}<!-- | | {{PAGEBANNER:{{{image|}}}|link=|origin={{{image_origin|0,0}}}}} | ||
}}<!-- | |||
-->}}<!-- | |||
Description: | Description: | ||
Line 31: | Line 35: | ||
Date: | Date: | ||
--><time datetime="{{#time: c | {{{date|{{REVISIONTIMESTAMP}}}}} }}"><!-- | --><time datetime="{{#time: c | {{{date|{{REVISIONTIMESTAMP}}}}} }}"><!-- | ||
-->{{{date displayed | {{#time: j F Y | {{{date|{{REVISIONTIMESTAMP}}}}} }} | -->{{#if: {{{date displayed|}}}<!-- | ||
-->| {{{date displayed}}} | |||
-->| {{#time: j F Y | {{{date| {{REVISIONTIMESTAMP}} }}} }}<!-- | |||
-->}}<!-- | |||
--></time><!-- | --></time><!-- | ||
Authors: | |||
-->{{# | -->{{#invoke: blog_post | authorList |format=linked |author={{{author|}}} |authors={{{authors|}}} }}<!-- | ||
Ending punctuation: | Ending punctuation: | ||
-->{{{p|.}}}</div><!-- | -->{{{p|.}}} <!-- | ||
Keywords: | |||
-->{{#if: {{{keywords|}}} | <span style="font-variant:small-caps; font-size:smaller">Keywords: {{#arraymap:{{{keywords|}}}|;|QQQ|[[QQQ]][[Category:QQQ]]| · }}</span> }}<!-- | |||
End meta line. | |||
--></div><!-- | |||
SEO: | SEO: | ||
Line 44: | Line 57: | ||
| type = article | | type = article | ||
| description = {{{description|A blog post from Wikimedia Australia.}}} | | description = {{{description|A blog post from Wikimedia Australia.}}} | ||
| author = {{{author|}}} | | author = {{#invoke: blog_post | authorList |format=plain |author={{{author|}}} |authors={{{authors|}}} }} | ||
| keywords = {{{keywords|}}} | | keywords = {{{keywords|}}} | ||
| image = {{filepath:{{{image}}}|800}} | | 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.
This template has a sandbox (edit) for editors to experiment.
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.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Date | date | The publication date of this post in YYYY-MM-DD format. | Date | required |
Description | description | Short sentence describing the post, shown on the news page and in social media previews etc. | Content | suggested |
Authors | authors | Semicolon-separated list of author names. Each will be linked to their page on this wiki. | String | optional |
Keywords | keywords | Comma-separated list of keywords (each keyword should be a wiki page). | String | suggested |
Mode | mode | Either 'draft', 'featured', or 'hidden'. | String | optional |
Image filename | image | The filename (without 'File:') of an image to use for the page banner and to share on social media. | File | optional |
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. | Boolean | optional |
Banner image origin | image_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.
| String | optional |