Difference between revisions of "Template:EventsForThisPage"

From Culture.si
Line 2: Line 2:
 
|{{#data:select
 
|{{#data:select
 
  | Event.#
 
  | Event.#
  | #where = ({{{fld}}}={{#cast:ref|{{{1|{{{page|{{PAGENAME}}}}}}}}|db}} or {{{fld}}} in (select page_title from redirect join page on rd_from=page_id where rd_title={{#cast:ref|{{{1|{{{page|{{PAGENAME}}}}}}}}|db}})) and Event.Country!='Slovenia'
+
  | #where = {{{fld}}}={{#cast:ref|{{{1|{{{page|{{PAGENAME}}}}}}}}|db}} and Event.Country!='Slovenia'
 
  | #limit = 1}}
 
  | #limit = 1}}
 
| first = <div class="contact-info-title">{{#if:{{{1|}}}|<h2>{{{1}}}</h2>|
 
| first = <div class="contact-info-title">{{#if:{{{1|}}}|<h2>{{{1}}}</h2>|
Line 26: Line 26:
 
   | #limit = 150
 
   | #limit = 150
 
   | #groupby = 1,2,3,4,5,6,7,8,9
 
   | #groupby = 1,2,3,4,5,6,7,8,9
   | #where = ({{{fld}}}={{#cast:ref|{{{1|{{{page|{{PAGENAME}}}}}}}}|db}} or {{{fld}}} in (select page_title from redirect join page on rd_from=page_id where rd_title={{#cast:ref|{{{1|{{{page|{{PAGENAME}}}}}}}}|db}})) and (Event.Country!='Slovenia') and to_char(coalesce(Event.End,Event.Start),'YYYYMMDD') >= '{{#timel:Ymd|{{CURRENTDATE}}}}'
+
   | #where = {{{fld}}}={{#cast:ref|{{{1|{{{page|{{PAGENAME}}}}}}}}|db}} and (Event.Country!='Slovenia') and to_char(coalesce(Event.End,Event.Start),'YYYYMMDD') >= '{{#timel:Ymd|{{CURRENTDATE}}}}'
 
   | #orderby = Event.Start ASC
 
   | #orderby = Event.Start ASC
 
}}
 
}}
Line 47: Line 47:
 
  | Country = {{groupLinks|Event.Country}}
 
  | Country = {{groupLinks|Event.Country}}
 
  | #groupby = 1,2,3,4,5,6,7,8,9
 
  | #groupby = 1,2,3,4,5,6,7,8,9
  | #where = ({{{fld}}}={{#cast:ref|{{{1|{{{page|{{PAGENAME}}}}}}}}|db}} or {{{fld}}} in (select page_title from redirect join page on rd_from=page_id where rd_title={{#cast:ref|{{{1|{{{page|{{PAGENAME}}}}}}}}|db}})) and (Event.Country!='Slovenia') and to_char(coalesce(Event.End,Event.Start),'YYYYMMDD') < '{{#timel:Ymd|{{CURRENTDATE}}}}'
+
  | #where = {{{fld}}}={{#cast:ref|{{{1|{{{page|{{PAGENAME}}}}}}}}|db}} and (Event.Country!='Slovenia') and to_char(coalesce(Event.End,Event.Start),'YYYYMMDD') < '{{#timel:Ymd|{{CURRENTDATE}}}}'
 
  | #limit = 150
 
  | #limit = 150
 
  | #orderby = Event.Start DESC}}
 
  | #orderby = Event.Start DESC}}

Revision as of 21:14, 11 December 2024