Template:EventTemplate: Difference between revisions

From Regenerate Willamette Valley
No edit summary
mNo edit summary
 
(8 intermediate revisions by the same user not shown)
Line 2: Line 2:
{{#template_params:event_date (label=Date)|event_time (label=Time)|event_location (label=Location)|event_description (label=Description)}}
{{#template_params:event_date (label=Date)|event_time (label=Time)|event_location (label=Location)|event_description (label=Description)}}
{{#cargo_declare:_table=events|event_date=List (,) of Date|event_time=List (,) of Text|event_location=List (,) of Text|event_description=Text}}
{{#cargo_declare:_table=events|event_date=List (,) of Date|event_time=List (,) of Text|event_location=List (,) of Text|event_description=Text}}
</noinclude><includeonly>{{#cargo_store:_table=events}}
</noinclude><includeonly>


{| class="wikitable"
<!-- Step 1: Retrieve event data from the Cargo table (correctly populate the fields) -->
|-
{{#cargo_query:
! 📅 Date
  table=events
| {{{event_date}}}
  |fields=event_date,event_time,event_location,event_description
|-
  |limit=1
! ⏰ Time
  |order by=event_date desc
| {{{event_time}}}
}}
|-
! 📍 Location
| {{{event_location}}}
|-
! 📝 Description
| {{{event_description}}}
|}


<div style="margin-top: 10px;">
<!-- Step 2: Create a Google Form pre-filled link -->
[https://calendar.google.com/calendar/render?action=TEMPLATE&text={{{event_description}}}&dates={{#time:Ymd\THis\Z|{{{event_date}}} {{{event_time}}}}}/{{#time:Ymd\THis\Z|{{{event_date}}} {{{event_time}}} +1 hour}}&details={{{event_description}}}&location={{{event_location}}}&sf=true&src=4bf57b4b257e6194276c26a5298aa113d1f303a886ba227b821eece2b03d3a98@group.calendar.google.com
{{#vardefine:event_date_encoded|{{#urlencode:{{#var:event_date}}}}}}
<span style="background-color:#4285F4; color:white; padding:8px 12px; border-radius:4px; text-decoration:none; font-weight:bold;">➕ Add to Google Calendar</span>]
{{#vardefine:event_time_encoded|{{#urlencode:{{#var:event_time}}}}}}
</div>
{{#vardefine:event_location_encoded|{{#urlencode:{{#var:event_location}}}}}}
{{#vardefine:event_description_encoded|{{#urlencode:{{#var:event_description}}}}}}
 
<!-- Step 3: Display the Google Form pre-fill link for submitting events -->
[https://docs.google.com/forms/d/e/1FAIpQLSf_OtfXtaGQ8kl9WrBz8UL7f2WjPI6WhmuoaeV-F3ZWKJbeUg/viewform?usp=pp_url&entry.26084320={{#var:event_date_encoded}}&entry.973803386={{#var:event_time_encoded}}&entry.792169663={{#var:event_location_encoded}}&entry.1604572264={{#var:event_description_encoded}} 📤 Submit this event to the Regenerate Willamette Valley Calendar]


[[Category:Events]]
[[Category:Events]]
</includeonly>
</includeonly>

Latest revision as of 21:23, 9 April 2025

This is the "EventTemplate" template.

It should be called in the following format:

{{EventTemplate
|event_date=
|event_time=
|event_location=
|event_description=
}}

Edit the page to see the template text.

This template defines the table "events". View table.