Difference between revisions of "Template:EventsForThisPage"

From Culture.si
 
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{{fld=Event.{{ucfirst:{{{field|Related}}}}}}}}
+
{{{fld=Event.{{ucfirst:{{{field|Related}}}}}}}}{{{pg={{{page|}}}}}}{{#arr:dataloop
{{{pg={{{page|}}}}}}
+
|{{#data:select
{{#arr:dataloop
+
  | Event.#
|{{#data:select
+
  | #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'
  | Event.#
+
  | #limit = 1}}
  | #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'
+
| first = <div class="contact-info-title">{{#if:{{{1|}}}|<h2>{{{1}}}</h2>|
  | #limit = 1
+
{{#ifeq:{{{field}}}|country
}}
+
|{{#title:link|Search_Events?country={{{pg}}}||Events in {{{pg|}}}}}
| first = <div class="contact-info-title">{{#if:{{{1|}}}|<h2>{{{1}}}</h2>|
+
|[[Search_Events|Events {{#if:{{{pg|}}}| {{{pg|}}}|abroad}}]]
{{#ifeq:{{{field}}}|country
+
}}}}
|{{#title:link|:Culture.si:Events/all/all/{{{pg}}}||Events in {{{pg|}}}}}
+
</div>}}<div>
|[[:Culture.si:Events|Events {{#if:{{{pg|}}}| {{{pg|}}}|abroad}}]]
 
}}}}
 
</div>
 
}}
 
<div>
 
 
{{#arr:dataloop
 
{{#arr:dataloop
 
|{{#data:select
 
|{{#data:select
Line 36: Line 31:
 
| first = <ul class="events">
 
| first = <ul class="events">
 
| each = {{#eval:wrap|{{{template|ListEvent}}}}}
 
| each = {{#eval:wrap|{{{template|ListEvent}}}}}
| last = </ul>
+
| last = </ul>{{#eval:html|<a class="show-more-events more_go">Show more</a>}}
}}
+
}}{{#arr:dataloop
 
+
|{{#data:select
{{#arr:dataloop
+
  | Description=Event.Description
|{{#data:select
+
  | Start = Event.Start
  | Description=Event.Description
+
  | End = Event.End
  | Start = Event.Start
+
  | Url = Event.Url
  | End = Event.End
+
  | Editcall = Event.Editcall
  | Url = Event.Url
+
  | Organizer_url = Event.Organizer_url
  | Editcall = Event.Editcall
+
  | More_url = Event.More_url
  | Organizer_url = Event.Organizer_url
+
  | Work_url = Event.Work_url
  | More_url = Event.More_url
+
  | Festival = Event.Festival
  | Work_url = Event.Work_url
+
  | City = {{groupLinks|Event.City}}
  | Festival = Event.Festival
+
  | Venue = {{groupLinks|Event.Venue}}
  | City = {{groupLinks|Event.City}}
+
  | Country = {{groupLinks|Event.Country}}
  | Venue = {{groupLinks|Event.Venue}}
+
  | #groupby = 1,2,3,4,5,6,7,8,9
  | Country = {{groupLinks|Event.Country}}
+
  | #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}}}}'
  | #groupby = 1,2,3,4,5,6,7,8,9
+
  | #limit = 150
  | #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}}}}'
+
  | #orderby = Event.Start DESC}}
  | #limit = 150
+
| first = <div class="events-title">Past Events</div><ul class="events">
  | #orderby = Event.Start DESC
+
| each = {{#eval:wrap|{{{template|ListEvent}}}}}
}}
+
| last = </ul>{{#eval:html|<a class="show-more-events more_go">Show more</a>}}}}</div>
| first = <div class="events-title">Past Events</div><ul class="events">
 
| each = {{#eval:wrap|{{{template|ListEvent}}}}}
 
| last = </ul>
 
}}
 
 
</div>
 

Latest revision as of 20:12, 27 February 2023