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: {{{ | + | {{#vardefine: announce_length |
− | |Yes = [[ | + | |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: {{{ | + | |{{#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:{{{ | + | |{{#switch:{{{News suppress|}}} |
− | |No = {{#switch: {{{ | + | |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: {{{ | + | -->{{#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[ | + | |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[ | + | |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[ | + | |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| | + | {{{News body|}}}{{#set: News announce={{#sub: {{{News body|}}}|0|{{#var: announce_length}}}} }} |
<!-- | <!-- | ||