Difference between revisions of "Template:News"

From Funtoo
Jump to navigation Jump to search
m (ssl compliance)
 
(39 intermediate revisions by the same user not shown)
Line 9: Line 9:
|Publication Status=Draft
|Publication Status=Draft
|Publication Date=2014/10/16
|Publication Date=2014/10/16
|Deprecated By=News:NewsPageThatContainsNewerInfo
|Icon=File:foobar.jpg
|Icon=File:foobar.jpg
|News Format=Short (or Extended)
}}
}}
</pre>
</pre>
{{#cargo_declare:
_table=news
|Summary=Wikitext
|News_Category=Text
|Author=Page
|Publication_Status=Text
|Publication_Date=Date
|Deprecated_By=Page
|Icon=Page
|News_Format=Text
}}


</noinclude><includeonly>
</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}} =
<span style="font-size: 1.5em; color: #888; font-variant: small-caps;">News: {{{News Category}}}</span>
{{#vardefine:grav|{{#cargo_query:
{{#ifeq:{{{Publication Status|}}|Draft|{{NotYetPublished}}}}{{#set:Summary={{{Summary|}}}|News Category={{{News Category|}}}|Publication Status={{{Publication Status|}}}|Icon={{{Icon|}}}|Publication Date={{{Publication Date|}}}}}{{#arraymap:{{{Author|}}}|,|x|{{#set:Author=User:x|Gravatar MD5={{#show: User:x | ?Gravatar MD5}}}}}}
tables=people
__NOTITLE__
|fields=Gravatar_MD5
</div></div><div class="row"><div class="col-xs-12 col-sm-4 col-sm-push-8">
|where=_pageName="User:{{{Author}}}"}}}}
{{TableStart}}
{{#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}}}}
<tr><th colspan=2 class="active">Information</th></tr>
{{#ifeq:{{{News Format|}}}|Extended|
<tr><th class="active">Date</th><td>{{{Publication Date|}}}</td></tr>
{{#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}}}}}
<tr><th class="active">Category</th><td>{{{News Category|}}}</td></tr>
}}}}{{#cargo_store:
<tr><th class="active">Author Bio</th><td>{{{#show: {{{Author|}}} | ?Bio }}}</td></tr>
_table=news
{{TableEnd}}
|Summary={{{Summary|}}}
</div><div class="col-xs-12 col-sm-8 col-sm-pull-4">
|News_Category={{{News Category|}}}
</includeonly>
|Author={{#if:{{{Author|}}}|User:{{{Author|}}}}}
|Publication_Status={{{Publication Status|}}}
|Publication_Date={{{Publication Date|}}}
|Deprecated_By={{#if:{{Deprecated By|}}}|News:{{{Deprecated By|}}}}}
|Icon={{{Icon|}}}
|News_Format={{{News Format|}}}
}}</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)
}}

此模板定义表格“news”。 查看表格.