Difference between revisions of "Template:News"

From Funtoo
Jump to: navigation, search
(cargo-ify news, except for a small query for User data that is still in SMW)
Line 12: Line 12:
 
|Icon=File:foobar.jpg
 
|Icon=File:foobar.jpg
 
|News Format=Short (or Extended)
 
|News Format=Short (or Extended)
 +
}}
 +
 +
{{#cargo_declare:
 +
table=_news
 +
|Summary=Text
 +
|News_Category=Text
 +
|Author=Page
 +
|Gravatar_MD5=Text
 +
|Publication_Status=Text
 +
|Publication_Date=Date
 +
|Deprecated_By=Page
 +
|Icon=Page
 +
|News_Format=Text
 
}}
 
}}
 
</pre>
 
</pre>
Line 21: Line 34:
 
{{#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}}|http://www.gravatar.com/avatar/{{#show: User:{{{Author}}} | ?Gravatar MD5}}/?s=80&d=retro&r=g}}|date={{#time:F j, Y|{{{Publication Date}}}}}
}}}}
+
}}}}{{#cargo_store:
</div></div><div class="row"><div class="col-xs-12"></includeonly>
+
_table=news
 +
|Summary={{{Summary|}}}
 +
|News_Category={{{News_Category|}}}
 +
|Author={{{#if:{{{Author|}}}|User:{{{Author|}}}}}
 +
|Gravatar_MD5={{#show: User:{{{Author}}} | ?Gravatar MD5}}
 +
|Publication_Status={{{Publication_Status|}}}
 +
|Publication_Date={{{Publication_Date|}}}
 +
|Deprecated_By={{#if:{{Deprecated By|}}}|{{{Deprecated By}}}}}
 +
|Icon={{{Icon|}}}
 +
|News_Format={{{News Format|}}}
 +
}}</div></div><div class="row"><div class="col-xs-12"></includeonly>

Revision as of 06:57, June 23, 2015

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)
}}

{{#cargo_declare:
table=_news
|Summary=Text
|News_Category=Text
|Author=Page
|Gravatar_MD5=Text
|Publication_Status=Text
|Publication_Date=Date
|Deprecated_By=Page
|Icon=Page
|News_Format=Text
}}