Current events

From FollowTheScore
Revision as of 21:15, 30 September 2007 by Gero (talk | contribs) (New page: {{subst::Test calendar}})
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Installation

This is a calendaring application based on DPL functionality. It is very flexible because it is based on templates which you can modify and adapt to your needs.

Architecture

{{#wgraph: svg| thumb=90 |

node Current_events {type cal}
node Current_events_September_2007 {type cal}
node Current_events_October_2007 {type cal}
node 2007-September-Event_A {}
node 2007-October-Event_B   {}
node 2007-October-Event_C   {}
node Event            {type tpl}
node Event_template   {type editsample}
edge 2007-September-Event_A Event {type incl}
edge 2007-October-Event_B   Event {type incl}
edge 2007-October-Event_C   Event {type incl}
edge Event_template 2007-September-Event_A {type edit}
edge Event_template 2007-October-Event_B   {type edit}
edge Event_template 2007-October-Event_C   {type edit}
edge Event_template Event                  {type incl}
edge Current_events Current_events_September_2007 {type incl}
edge Current_events_September_2007 Calendar_month {type incl}
edge Current_events Current_events_October_2007   {type incl}
edge Current_events_October_2007   Calendar_month {type incl}
node CalendarSingle {type tpl}
node Calendar_month {type tpl}
node Calendar_link  {type tpl}
edge CalendarSingle Calendar_link    {type incl}
edge Calendar_month CalendarSingle   {type incl}
edge Calendar_month 2007-September-Event_A {type dpl}
edge Calendar_month 2007-October-Event_B   {type dpl}
edge Calendar_month 2007-October-Event_C   {type dpl}
node Calendar/MonthStartMon {type tpl}
node Calendar/MonthStartTue {type tpl}
nodetype tpl        {color yellow    }
nodetype cal        {color lightblue }
nodetype editsample {color #ffeeee   }
nodetype *          {color #ffdddd bordercolor darkgray}
edge CalendarSingle Calendar/MonthStartMon {type incl}
edge CalendarSingle Calendar/MonthStartTue {type incl}
edgetype incl {color darkgray}
edgetype dpl  {color red thickness 4}
edgetype edit {linestyle dotted color blue}

}}

  • Templates are in yellow.
  • The pages describing an event are in red
  • We use an edit template (in lightred) when event pages are created
  • The pages which provide access to the calendar are in blue. You must adapt them to your needs.

The design is as follows:

  1. The user calls the entry page (e.g. "Current events"). We call this page the basepage and you can choose its name freely. But be careful:
    • The basepage name appears inside the calendar pages.
    • In this dpldemo wiki the basepage is called "Test calendar" (and not "Current events").
    • So, if you copy the blue pages from this wiki, you must adapt the basepage name.
  2. The basepage uses a date function to calculate the current month and then calls the calendar page for that month.
  3. The calendar page for the current month calls a standard template ("Calendar month") which
    • shows the calendar box
    • finds all events of the current month and shows them
    • offers an edit box to create a new event (using the edit template "Event template")

The calendar box contains links to its neighboring months. Days link to their event in the list. You could easily change that to make the links point directrly to the event definitions.


Steps needed to install the DPL calendar

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:

This template calls the proper template above, with a parameter input for each day:

Download the following templates, and customize them

This is the template that needs to be called to create each month's page: Template:calendar month. Call it this way:

{{calendar month|year=YYYY|month=MM|basepage=your base page name}}

This is the template that calculates the parameter for each day for above template (based on DPL):

The next templates are not mandatory, they were designed to ease the creation of an event, although this can be done by other means:

Download additional extensions

Download the following extensions:

  1. parserfunctions from MW
  2. inputbox from MW
  3. DPL extension from this site.

Create the base page

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}}}}

The name of your basepage is important as it must be used as aprefix for each month´s calendar page later. Our base page is named "Test calendar" and as you see its only purpose is to call the specific page for the current month. If you call your basepage 'Current events' then the above example has to changed to

__NOTOC__
{{:Current events {{#time: F Y}}}}

Create a page for each month

Finally, create one page per month with the format "basepage Month year" (example: "Current events April 2007"), insert below code and make sure to replace:

  1. YYYY by the year (ex: 2007)
  2. mm by the month (ex:06)
  3. pageXYZ by the base page name (example: "Current events")
{{calendar month|year=YYYY|month=mm|basepage=pageXYZ}}

Note: In this wiki we use "Test calendar" as basepage, so the articles are called "Test calendar September 2007" and so on.


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 Template:calendar month template.


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 template Template:calendar 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.

Demo

Test calendar May 2024