Difference between revisions of "Template:News"

From Funtoo
Jump to navigation Jump to search
(cargo-ify news, except for a small query for User data that is still in SMW)
m (ssl compliance)
 
(16 intermediate revisions by the same user not shown)
Line 13: Line 13:
|News Format=Short (or Extended)
|News Format=Short (or Extended)
}}
}}
 
</pre>
{{#cargo_declare:
{{#cargo_declare:
table=_news
_table=news
|Summary=Text
|Summary=Wikitext
|News_Category=Text
|News_Category=Text
|Author=Page
|Author=Page
|Gravatar_MD5=Text
|Publication_Status=Text
|Publication_Status=Text
|Publication_Date=Date
|Publication_Date=Date
Line 26: Line 25:
|News_Format=Text
|News_Format=Text
}}
}}
</pre>
 


</noinclude><includeonly>{{#widget:AddThis}}
</noinclude><includeonly>{{#widget:AddThis}}
<div class="container" style="margin-top: 20px;"><div class="row"><div class="col-xs-12">
<div class="container" style="margin-top: 20px;"><div class="row"><div class="col-xs-12">
= {{PAGENAME}} =
= {{PAGENAME}} =
{{#if:{{{Deprecated By|}}}|{{Important|This news item is not current. You can find updated information on this topic at [[Deprecated By::News:{{{Deprecated By}}}|{{{Deprecated By}}}]].}}}}{{#ifeq:{{{Publication Status|}}|Draft|{{NotYetPublished}}}}{{#set:Summary={{{Summary|}}}|News Category={{{News Category|}}}|Publication Status={{{Publication Status|}}}|Icon={{{Icon|}}}|Publication Date={{{Publication Date|}}}|News Format={{{News Format}}}}}{{#set:Author=User:{{{Author|}}}|Gravatar MD5={{#show: User:{{{Author}}} | ?Gravatar MD5}}}}
{{#vardefine:grav|{{#cargo_query:
tables=people
|fields=Gravatar_MD5
|where=_pageName="User:{{{Author}}}"}}}}
{{#if:{{{Deprecated By|}}}|{{Important|This news item is not current. You can find updated information on this topic at [[:News:{{{Deprecated By}}}|{{{Deprecated By}}}]].}}}}{{#ifeq:{{{Publication Status|}}|Draft|{{NotYetPublished}}}}
{{#ifeq:{{{News Format|}}}|Extended|
{{#ifeq:{{{News Format|}}}|Extended|
{{#widget:NewsInfo|body={{{Summary|}}}|user={{{Author|}}}|icon_url={{#if:{{{Icon|}}}|{{filepath:{{#sub:{{{Icon}}}|5}}|80}}|http://www.gravatar.com/avatar/{{#show: User:{{{Author}}} | ?Gravatar MD5}}/?s=80&d=retro&r=g}}|date={{#time:F j, Y|{{{Publication Date}}}}}
{{#widget:NewsInfo|body={{{Summary|}}}|user={{{Author|}}}|icon_url={{#if:{{{Icon|}}}|{{filepath:{{#sub:{{{Icon}}}|5}}|80}}|//www.gravatar.com/avatar/{{#var:grav}}/?s=80&d=retro&r=g}}|date={{#time:F j, Y|{{{Publication Date}}}}}
}}}}{{#cargo_store:
}}}}{{#cargo_store:
_table=news
_table=news
|Summary={{{Summary|}}}
|Summary={{{Summary|}}}
|News_Category={{{News_Category|}}}
|News_Category={{{News Category|}}}
|Author={{{#if:{{{Author|}}}|User:{{{Author|}}}}}
|Author={{#if:{{{Author|}}}|User:{{{Author|}}}}}
|Gravatar_MD5={{#show: User:{{{Author}}} | ?Gravatar MD5}}
|Publication_Status={{{Publication Status|}}}
|Publication_Status={{{Publication_Status|}}}
|Publication_Date={{{Publication Date|}}}
|Publication_Date={{{Publication_Date|}}}
|Deprecated_By={{#if:{{Deprecated By|}}}|News:{{{Deprecated By|}}}}}
|Deprecated_By={{#if:{{Deprecated By|}}}|{{{Deprecated By}}}}}
|Icon={{{Icon|}}}
|Icon={{{Icon|}}}
|News_Format={{{News Format|}}}
|News_Format={{{News Format|}}}
}}</div></div><div class="row"><div class="col-xs-12"></includeonly>
}}</div></div><div class="row"><div class="col-xs-12"></includeonly>

Latest revision as of 18:19, October 15, 2017

Use like so:

{{News
|Summary=Test News Item
|News Category=General
|Author=Drobbins
|Publication Status=Draft
|Publication Date=2014/10/16
|Deprecated By=News:NewsPageThatContainsNewerInfo
|Icon=File:foobar.jpg
|News Format=Short (or Extended)
}}

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