Extension:DPL Calendar

From MediaWiki.org

Jump to: navigation, search

           

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
DPL Calendar

Release status: stable

DPL calendar-1.png
Implementation  wiki templates (invalid type)
Description A parser-function calendar based on DPL and other extensions.
Author(s)  User:Algorithmix
Last Version  1.0
MediaWiki  1.6.x and above
License No license specified
Download see Download

check usage (experimental)

DPL Calendar is a set of wiki templates which implements a flexible calendar. Its charm is that the source code is in wiki syntax, so you can easily modify and adapt it to your needs.

Basically you only need the set of templates: Export them from the Demo wiki and import them into your wiki. But as these templates use some extensions you should check if you have these extensions alread installed:

Contents

[edit] Features

  • The calendar shows one month. It is easy to create a page where calendars for more than one month are shown, e.g. in a 4x3 grid a complete calendar for a year.
  • The monthly calendar contains links to the previous(or next) month.
  • Easy to do localization by yourself, there is already a Chinese version ...
  • You can handle multiple calendars in parallel. They are separated by one or more 'purposes' which you assign to each event; when calling the calendar you decide which purposes it shall show. So you can watch calendars of other users if you want, have private calendars etc.
  • You decide into which namespace you want to put your event descriptions. Several namespaces for several purposes are possible.
  • The calendar may or may not contain a link which allows the user to define new events.
  • There are multiple layouts: short/long calendar with/without separate event list. I.e. the calendar does not only show the events on the calendar but can also display a separate event list (sortable table of events)
  • The event list is completely configurable; you can show arbitrary chapters from your event definitions.
  • More: See English version and Chinese version
  • Everyone can give more ideas to the author improve the powerful calendar.
DPL calendar-2.png


[edit] Calendar kit evaluating table

ID Items\ Calendar kits Simple Calendar Calendar (Kenyu73) DPL Calendar
1 i18n Uses files in the ..\wiki\languages\messages Yes Easy to do by users.
2 Easy to install O O X
3 Custom event titles O O O
4 Watching events made by other person's or group's calendars X Yes Using parameter of "purpose" and Category to deal with this item.
5 Events can be specified with a namespace O Yes O
6 Calendar GUI Good Better Good
7 Switching events to show on the GUI or not X (It's can not show events on the GUI.) O O
8 Easy to switch to previous or next month Using Call extension with the parser function O (Using a Javascript solution) Using Call extension with the switch on the GUI.
9 Switching to show the days of all year or month in the GUI O O X
10 Having another sortable table to show the events Using DPL solution As the calendar does not use the YYYY-MM-DD format, it is difficult to accomplish Default switching by the parameter of "eventList"
11 Having form Solution Using Semantic_Forms to create a red link page with specific namespace X Using Semantic_Forms to create a red link page with specific namespace
12 Emailing a event to specific someone Using Extension:Todo Tasks solution. Using Extension:Todo Tasks solution. Using Extension:Todo Tasks solution.
13 Colors the current day O O X
14 Uses Parser or tag Parser tag Parser
15 Easy to sort the events with DPL or SMW solution (Date format) O (YYYY-MM-DD or others) X O (YYYY-MM-DD)
16 Setting to show a specific year or month. O O O
17 How to make a calendar for a user using By setting events' title By setting events' title By setting events' category

[edit] Usage

[edit] Installation

Installation

[edit] Special issue 1: Combining the use of DPL Calendar with Semantic Forms

  • DPL and SMW(Semantic MediaWiki) are the most powerful extensions for MediaWiki and SF (Semantic Forms) makes every thing better (maybe someday we can also use Simple Forms to do the same thing).
  • If you want to combine the use of DPL Calendar with Semantic Forms, take the following steps:

[edit] Necessary extensions

  1. DPL Calendar
  2. Semantic MediaWiki
  3. Semantic Forms
  4. Extension:Variables - install this extension if you want users to be able to add events belonging to them to the calendar

[edit] Create some pages

  • Create a Calendar page (you can use the DPL Calendar code generater to create the code.)
    • You may want to let every logged-in user add their personal events to the calendar. If so, you should add the following code to the calendar. (This step requires the Variables extension.)
{{:Current events
|purpose={{CURRENTUSER}}¦DPL user group¦SF user group  <!--This calendar can generate events for every logged-in user, and watch all events belonging to "DPL user group" and "SF user group" -->
|namespace=Calendar <!--This calendar is specified to show only the events belonging to the namespace "Calendar" -->
|width=500px
}}
  • Create properties to be used for events.
  • Create a template to represent an event.
    • Note: DPL calendar uses categories to define the owner of events. The most convenient way to do this is within the event template. For example, your template can contain the following.
    |-
    ! owner
    | [[owner::{{{owner|}}}]][[Category:{{{owner|}}}]]
    |-
  • Create a form to add and edit events.
    • You may want to specify that every event, by default, belongs to the user who created that event's page. You should then have a line in your form definition that looks like the following. (This step requires the Variables extension.)
<tr><th>Owner:</th> <td>{{{field|owner|hidden|default={{subst&#58;CURRENTUSER}}  }}}</td></tr>

[edit] Modification

After you install all extensions above, you should edit the page Template:Create Event. Change the following code

{{#inputbox:
  |type=create
  |buttonlabel=create
  |width=25
  |default={{{prefix}}} ...
  |preload=Event template
  |{{#if:{{{namespace|}}}|titleprefix={{{namespace}}}:}}
  |editintro=Event intro
  |break=no
}}
to
 {{#forminput: Your form's name |20|{{{prefix}}}...|Create|namespace={{{namespace|}}}}} 
Note: In the above, "Your form's name" should be changed to the name of the form used to deal with your events.

[edit] Special issue 2:Combining DPL calendar with email function

[edit] See also