Difference between revisions of "Template:News"

From Earth Science Information Partners (ESIP)
Line 5: Line 5:
 
[[News feed::{{{News feed|}}}]]
 
[[News feed::{{{News feed|}}}]]
  
{{#switch: {{{Repeat every year|}}}
+
{{#vardefine: announce_length
   |Yes = [[Repeat every year::true]]
+
  |200
 +
}}
 +
 
 +
{{#switch: {{{News repeat every year|}}}
 +
   |Yes = [[News repeat every year::true]]
 
         [[Category:Recurring news]]
 
         [[Category:Recurring news]]
 
         [[Year::{{CURRENTYEAR}}]]
 
         [[Year::{{CURRENTYEAR}}]]
Line 21: Line 25:
 
}}
 
}}
 
{{#vardefine: year
 
{{#vardefine: year
   |{{#switch: {{{Repeat every year|}}}
+
   |{{#switch: {{{News repeat every year|}}}
 
       |Yes = {{CURRENTYEAR}}
 
       |Yes = {{CURRENTYEAR}}
 
       |#default = {{#time: Y|{{{Start date|}}}}}
 
       |#default = {{#time: Y|{{{Start date|}}}}}
Line 27: Line 31:
 
}}
 
}}
 
{{#vardefine: status
 
{{#vardefine: status
   |{{#switch:{{{Suppress|}}}
+
   |{{#switch:{{{News suppress|}}}
     |No  = {{#switch: {{{Repeat every year|}}}
+
     |No  = {{#switch: {{{News repeat every year|}}}
 
               |Yes = {{#ifexpr: {{#timel: Ymd}} >= {{#timel: Ymd|{{{Start date|}}}}} and {{#timel: Ymd}} < {{#timel: Ymd|{{{End date|}}}}}
 
               |Yes = {{#ifexpr: {{#timel: Ymd}} >= {{#timel: Ymd|{{{Start date|}}}}} and {{#timel: Ymd}} < {{#timel: Ymd|{{{End date|}}}}}
 
                 |{{#ifexpr: {{#timel:U}} > {{#timel:U|{{{Start date|}}} }} and {{#timel:U}} < {{#timel:U|{{{End date|}}} }}
 
                 |{{#ifexpr: {{#timel:U}} > {{#timel:U|{{{Start date|}}} }} and {{#timel:U}} < {{#timel:U|{{{End date|}}} }}
Line 68: Line 72:
 
####### REPEAT #######
 
####### REPEAT #######
  
-->{{#switch: {{{Repeat every year|}}}
+
-->{{#switch: {{{News repeat every year|}}}
 
     |Yes = <i class="mr-2 fas fa-calendar-day"></i>
 
     |Yes = <i class="mr-2 fas fa-calendar-day"></i>
 
     |#default =  
 
     |#default =  
Line 86: Line 90:
 
     |News filter[News status]={{#urlget:News filter[News status]}}
 
     |News filter[News status]={{#urlget:News filter[News status]}}
 
     |News filter[News is sticky]={{#urlget:News filter[News is sticky]}}
 
     |News filter[News is sticky]={{#urlget:News filter[News is sticky]}}
     |News filter[Repeat every year]={{#urlget:News filter[Repeat every year]}}
+
     |News filter[News repeat every year]={{#urlget:News filter[News repeat every year]}}
 
     |_run=1
 
     |_run=1
 
   }} <!--  
 
   }} <!--  
Line 103: Line 107:
 
           |News filter[News status]={{#urlget:News filter[News status]}}
 
           |News filter[News status]={{#urlget:News filter[News status]}}
 
           |News filter[News is sticky]={{#urlget:News filter[News is sticky]}}
 
           |News filter[News is sticky]={{#urlget:News filter[News is sticky]}}
           |News filter[Repeat every year]={{#urlget:News filter[Repeat every year]}}
+
           |News filter[News repeat every year]={{#urlget:News filter[News repeat every year]}}
 
           |_run=1
 
           |_run=1
 
         }}
 
         }}
Line 123: Line 127:
 
     |News filter[News status]={{#urlget:News filter[News status]}}
 
     |News filter[News status]={{#urlget:News filter[News status]}}
 
     |News filter[News is sticky]={{#urlget:News filter[News is sticky]}}
 
     |News filter[News is sticky]={{#urlget:News filter[News is sticky]}}
     |News filter[Repeat every year]={{#urlget:News filter[Repeat every year]}}
+
     |News filter[News repeat every year]={{#urlget:News filter[News repeat every year]}}
 
     |_run=1
 
     |_run=1
 
   }} </p>
 
   }} </p>
Line 131: Line 135:
  
 
-->
 
-->
{{{News body|}}}{{#set: News announce={{#sub: {{{News body|}}}|0|200}} }}
+
{{{News body|}}}{{#set: News announce={{#sub: {{{News body|}}}|0|{{#var: announce_length}}}} }}
 
<!--
 
<!--
  

Revision as of 03:18, July 17, 2020