Template:EventList/docs
Editor Documentation: EventList Template
This documentation provides instructions for editors on how to use the `EventList` template to create and display event lists with custom styles.
Default Usage (Global Events)
To display the global list of events, simply use the `EventList` template without any parameters:
{{EventList}}
This will automatically pull and display events from the `GlobalEvents` page.
Custom Event Lists
To create custom event lists with custom styles, follow these steps:
1. Create a Custom Events Page
First, create a new page for your custom events. For example, `User:YourUsername/Events`. On this page, use the `EventSection` template to list your events.
<!-- User:YourUsername/Events -->
{{EventSection
| title = January Events
| dateHeader = Date
| titleHeader = Event
| descriptionHeader = Details
| tableStyle = border: none; width: 100%;
| tableClass = wikitable
| events =
{{EventRow
| date = 2024-01-01
| title = New Year's Day
| description = The first day of the year.
}}
{{EventRow
| date = 2024-01-15
| title = Martin Luther King Jr. Day
| description = Celebration of MLK's legacy.
}}
}}
{{EventSection
| title = February Events
| dateHeader = Day
| titleHeader = Occasion
| descriptionHeader = Info
| tableStyle = border: 2px dotted red; width: 80%;
| tableClass = wikitable another-custom-class
| events =
{{EventRow
| date = 2024-02-14
| title = Valentine's Day
| description = A day for celebrating love.
}}
{{EventRow
| date = 2024-02-19
| title = Presidents' Day
| description = Honoring all U.S. presidents.
}}
}}
{{EventSection
| title = March Events
| dateHeader = Date
| titleHeader = Event Name
| descriptionHeader = Description
| tableStyle = background-color: #f0f0f0; width: 90%;
| tableClass = wikitable march-events-table
| events =
{{EventRow
| date = 2024-03-17
| title = St. Patrick's Day
| description = Celebration of Irish culture.
}}
{{EventRow
| date = 2024-03-20
| title = Spring Equinox
| description = The first day of spring.
}}
}}
2. Use the `EventList` Template with Custom File
Next, use the `EventList` template on the desired page and specify your custom events file with the `file` parameter:
{{EventList|file=User:YourUsername/Events}}
This will display the events from your custom events page.
Example
Here is an example of how to use the `EventList` template:
{{EventList|file=User:YourUsername/Events}}
This will generate an event list table with the events you specified in `User:YourUsername/Events`.
Parameters
Below is a table explaining which parameters are optional and which are mandatory for each template:
Template | Parameter | Description | Mandatory/Optional | Default Value |
---|---|---|---|---|
EventList | file | The file where custom events are listed | Optional | GlobalEvents |
EventSection | title | The title of the event section | Optional | |
EventSection | dateHeader | Header text for the date column | Optional | Date |
EventSection | titleHeader | Header text for the title column | Optional | Title |
EventSection | descriptionHeader | Header text for the description column | Optional | Description |
EventSection | tableStyle | Custom CSS styles for the table | Optional | |
EventSection | tableClass | Custom CSS classes for the table | Optional | |
EventSection | events | Content for the event rows | Mandatory | |
EventRow | date | The date of the event | Mandatory | |
EventRow | title | The title of the event | Mandatory | |
EventRow | description | The description of the event | Mandatory |
Notes
- Ensure that each event is properly formatted using the `EventRow` template.
- You can mix global and custom events by including the global events within your custom events page if needed.
- For further assistance, please contact the site administrator.
Admin Documentation: EventList Template
This documentation provides instructions for MediaWiki administrators on how to set up and manage the `EventList` template.
1. Create the `EventListTable` Template
Go to `Template:EventListTable` and create the following template:
<!-- Template:EventListTable -->
{| class="wikitable {{{tableClass|}}}" style="{{{tableStyle|}}}"
! {{{dateHeader|Date}}} !! {{{titleHeader|Title}}} !! {{{descriptionHeader|Description}}}
|-
{{{content}}}
|}
2. Create the `EventRow` Template
Go to `Template:EventRow` and create the following template:
<!-- Template:EventRow -->
| {{{date}}} || {{{title}}} || {{{description}}}
|-
3. Create the Global Events File
Go to a new page called `GlobalEvents` and create the following content:
{{EventSection
| title = Global Events
| dateHeader = Date
| titleHeader = Event
| descriptionHeader = Description
| events =
{{EventRow
| date = 2024-01-01
| title = New Year's Day
| description = The first day of the year.
}}
{{EventRow
| date = 2024-12-25
| title = Christmas Day
| description = [[Christmas]] celebration.
}}
}}
4. Create the `EventList` Template
Go to `Template:EventList` and create the following template:
<!-- Template:EventList -->
{{#if: {{{file|}}}
| {{:{{{file}}}}}
| {{:GlobalEvents}}
}}