Difference between revisions of "Test calendar"
Line 71: | Line 71: | ||
To create a custom event, edit the template [[Event template]], and edit the above DPL. | To create a custom event, edit the template [[Event template]], and edit the above DPL. | ||
=== Customizing the event pages and event presentation=== | === Customizing the event pages and event presentation=== | ||
− | To customize the type of page the calendar application needs to look for, just modify the "titlematch" parameter in the [[Template:Calendar link]] template, as well as in the DPL in the above "[[#Create_a_page_for_each_month]]" section. | + | To customize the type of page the calendar application needs to look for, just modify the "titlematch" parameter in the [[Template:Calendar link]] template, as well as in the DPL in the above "[[#Create_a_page_for_each_month|Create a page for each month]]" section. |
− | To customize the list of events that are displayed below each calendar, take a close look in the DPL manual at the [[Manual_-_DPL_parameters:_Controlling_output_volume#include | + | To customize the list of events that are displayed below each calendar, take a close look in the DPL manual at the include parameter ([[Manual_-_DPL_parameters:_Controlling_output_volume#include|see here]]). In our example in section "[[#Create_a_page_for_each_month|Create a page for each month]]", we have: |
<pre> | <pre> | ||
#Summary,#Participants | #Summary,#Participants |
Revision as of 17:09, 1 May 2007
Contents
Installation
This is a calendaring application based on DPL functionality.
How to use it for your websites:
Download the following templates, and create them into your wiki
These templates are needed to know how to display properly the month calendar. Months are categorized by the day of the week of the first day:
- Template:Calendar/MonthStartMon // all months that start on a Monday
- Template:Calendar/MonthStartTue // etc...
- Template:Calendar/MonthStartWed
- Template:Calendar/MonthStartThu
- Template:Calendar/MonthStartFri
- Template:Calendar/MonthStartSat
- Template:Calendar/MonthStartSun
- Template:! //a template used for special for cell separation
This template calls the proper template above, with a parameter input for each day:
Finally this is the template that calculates the parameter for each day for above template (based on DPL):
This template is not mandatory, it is designed to ease the creation of an event, although it can be done by other means:
Download additional extensions
Download parserfunctions and "inputbox" extensions from the mediawiki website. Download DPL extension from this site.
Create a page for each month
Now, create the base page where the current month calendar will be created (like "Current events"), and insert below code in it:
__NOTOC__ {{:Test calendar {{#time: F Y}}}}
Finally, create one page per month with the format "base page Month year" (example: "Current events April 2007"), insert below code and make sure to replace:
- "2007/04" below by the month and year from the current page name
- replace the year and month parameters from CalendarSingle template call (here they are set at year=2007|month=04)
- also replace in the CalendarSingle template call the basepage parameter (example: "Current events")
__NOTOC__ {| |<inputbox> type=create buttonlabel=create new Event width=25 default=2007/04/05 my event name preload=Event template break=no </inputbox> |} {{CalendarSingle|year=2007|month=04|show_year=yes|basepage=Current events}} {{#dpl:category=Events |titlematch=2007/04% |include=#Summary,#Participants |mode=userformat |resultsheader=There are %PAGES% events planned this month. |noresultsheader=No events planned so far for this month. |listseparators=¶{¦ class="wikitable" ¶!Date / Event name ¶!Categories ¶!Event summary ¶!Participants,¶¦-¶¦<h5>[[%PAGE%]]</h5>¶¦ %CATLIST%,,¶¦} |secseparators=¶¦ |ordermethod=title |addcategories=true |order=descending }}
To create a custom event, edit the template Event template, and edit the above DPL.
Customizing the event pages and event presentation
To customize the type of page the calendar application needs to look for, just modify the "titlematch" parameter in the Template:Calendar link template, as well as in the DPL in the above "Create a page for each month" section.
To customize the list of events that are displayed below each calendar, take a close look in the DPL manual at the include parameter (see here). In our example in section "Create a page for each month", we have:
#Summary,#Participants
which means take the content of summary and participants sections.
We could modify the name of sections, the number of sections or even take the parameters of a template inside the event page. Again, see the DPL manual.