Toggle menu
17
24
14
1.7K
Landrace.Wiki - The Landrace Cannabis Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:NewsItemCard: Difference between revisions

Template page
Created page with "<includeonly> {{#vardefine:page | {{{page|{{PAGENAME}}}}} }} {{#vardefine:type_raw | {{{event_type|{{#show:{{#var:page}}|?Has event type}}}}} }} {{#vardefine:type | {{lc:{{#var:type_raw}}}} }} {{#vardefine:date_raw | {{{event_date|{{#show:{{#var:page}}|?Has event date}}}}} }} {{#vardefine:date_fmt | {{#time:F j, Y|{{#var:date_raw}}}} }} {{#vardefine:region_gr | {{{growing_region|{{#show:{{#var:page}}|?Has growing region}}}}} }} {{#vardefine:region_app | {{{appellation|..."
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
{{#vardefine:page | {{{page|{{PAGENAME}}}}} }}
<div class="news-card news-card--{{lc:{{{Has event type|community}}}}}">
{{#vardefine:type_raw | {{{event_type|{{#show:{{#var:page}}|?Has event type}}}}} }}
{{#vardefine:type | {{lc:{{#var:type_raw}}}} }}
 
{{#vardefine:date_raw | {{{event_date|{{#show:{{#var:page}}|?Has event date}}}}} }}
{{#vardefine:date_fmt | {{#time:F j, Y|{{#var:date_raw}}}} }}
 
{{#vardefine:region_gr | {{{growing_region|{{#show:{{#var:page}}|?Has growing region}}}}} }}
{{#vardefine:region_app | {{{appellation|{{#show:{{#var:page}}|?Has appellation}}}}} }}
{{#vardefine:region_gp | {{{gene_pool|{{#show:{{#var:page}}|?Has gene pool}}}}} }}
 
{{#vardefine:summary_raw | {{{summary|{{#show:{{#var:page}}|?Has event summary}}}}} }}
 
<div class="news-card news-card--{{#switch: {{#var:type}}
| policy = policy
| enforcement = enforcement
| fieldwork = fieldwork
| research = research
| community = community
| meta = meta
| #default = policy
}}">
 
   <div class="news-card__header">
   <div class="news-card__header">
     <div class="news-card__date">{{#var:date_fmt}}</div>
     <div class="news-card__date">
     <div class="news-card__category-badge news-card__category-badge--{{#switch: {{#var:type}}
      {{{Has event date|}}}
      | policy = policy
    </div>
      | enforcement = enforcement
     <div class="news-card__category-badge news-card__category-badge--{{lc:{{{Has event type|community}}}}}">
      | fieldwork = fieldwork
       {{{Has event type|Community}}}
      | research = research
      | community = community
      | meta = community
      | #default = policy
    }}">
       {{#switch: {{#var:type}}
        | policy = Policy
        | enforcement = Enforcement
        | fieldwork = Fieldwork
        | research = Research
        | community = Community
        | meta = Update
        | #default = Policy
      }}
     </div>
     </div>
   </div>
   </div>


   {{#if:{{#var:region_app}}{{#var:region_gr}}{{#var:region_gp}}|
   {{#if:{{{Has growing region|}}}{{{Has country|}}}|
   <div class="news-card__region">
   <div class="news-card__region">
     {{#if:{{#var:region_gp}}|[[{{#var:region_gp}}]]{{#if:{{#var:region_gr}}{{#var:region_app}}| • |}}}}
     {{#if:{{{Has growing region|}}}|[[{{{Has growing region}}}]]}}
     {{#if:{{#var:region_gr}}|[[{{#var:region_gr}}]]{{#if:{{#var:region_app}}| • |}}}}
     {{#if:{{{Has country|}}}|{{#if:{{{Has growing region|}}}| · }}[[{{{Has country}}}]]}}
    {{#if:{{#var:region_app}}|[[{{#var:region_app}}]]}}
   </div>
   </div>
   }}
   }}


   <h3 class="news-card__title">[[{{#var:page}}|{{{title|{{#show:{{#var:page}}|?Has event title}}|{{#var:page}}}}}]]</h3>
   <h3 class="news-card__title">
    [[{{{fullpage name}}}|{{{Has event headline|{{PAGENAME}}}}}]]
  </h3>


   {{#if:{{#var:summary_raw}}|
   {{#if:{{{Has event summary|}}}|
   <div class="news-card__summary">
   <div class="news-card__summary">
     {{#var:summary_raw}}
     {{{Has event summary}}}
   </div>
   </div>
   }}
   }}


  {{#if:{{{Has source URL|}}}|
   <div class="news-card__footer">
   <div class="news-card__footer">
     <div class="news-card__links">
     <div class="news-card__links">
       [[{{#var:page}}|Read full story →]]
       [{{{Has source URL}}} Source]
       {{#if:{{{source_url|}}}|
       {{#if:{{{Has event page|}}}| • [[{{{Has event page}}}|Full story]]}}
        &nbsp;&nbsp;[{{{source_url}}} Source]
      }}
     </div>
     </div>
   </div>
   </div>
 
  }}
</div>
</div>
</includeonly>
</includeonly>
<noinclude>
Template for rendering a News Item as a feed card. 
Expected args from SMW ask (named args):
* page
* event_date
* event_type

Latest revision as of 03:40, 23 November 2025