|
Cookbook /
PmCalendar-TalkSummary: Talk page for the PmCalendar recipe
Format: unless and until the content is refactored by topic, let's Add New Material At the Bottom - below previous entries.
Calendar on any page of any wikigroupIn-wiki adminI like to set up my wikis so that wherever possible, features can be added, configured and administered from within the wiki, without requiring any server-side work other than to add and enable a recipe. Default setupTo quote Chris Cox, author of this wonderful recipe: "The PmCalendar is designed assuming that it will be placed into its own group and the location of the [ Any page of any wikigroupI want my users to be able use the calendar in any wikigroup they like, without needing to have an administrator install the PmCal.css file. I find that Chris's default design for the appearance of the calendar is clean, simple, and more than adequate for most purposes. What's more, I've found that a calendar does not have to be installed in its own wikigroup. While the limitation of one calendar per wikigroup does remain, within a multi-purpose wikigroup one can display that wikigroup's calendar by placing the Tweaks to make it workRe-code four linksAs downloaded, there are four links that appear above each calendar that will not operate properly unless the calendar is displayed on the wikigroup's default page Group.Group or Group.HomePage: The "Today" link and the navigation links to the previous, currently displayed and next months' views. I customized the code for these links in my installed version of the recipe, and don't see any drawback to using this altered version in any application of the recipe - i.e., I think you can do this, too, without any adverse results (But I'm not positive, which is one reason I created this "Talk" page). Here's the tweak. Replace $out.="[[$group?month=$prevmonth&day=1&year=$prevyear$urladd|$navprevout]] %%"; $out.="[[$group?month=$month&day=$day&year=$year$urladd|$mt]]"; $out.="%class='pmcalnavlinks pmcalnavlinksnext'%"; $out.=" [[$group?month=$nextmonth&day=1&year=$nextyear$urladd|$navnextout]]%%\n"; To:
$out.="[[$name?month=$prevmonth&day=1&year=$prevyear$urladd|$navprevout]] %%"; $out.="[[$name?month=$month&day=$day&year=$year$urladd|$mt]]"; $out.="%class='pmcalnavlinks pmcalnavlinksnext'%"; $out.=" [[$name?month=$nextmonth&day=1&year=$nextyear$urladd|$navnextout]]%%\n"; And change this one: To:
$out.="[[$name?year=$tyear&month=$tmonth&day=$tday$urladd|";Navigation helpHere's a usability tweak. Since it seems likely that someone reading a date-page will want to return to the calendar's display page (and since in this type of implementation, the To approach
I welcome questions or suggestions for any part of this variant. -- TeganDowling More than one entry per day plus use of form?I would like come up with a way to turn the entering of information for each day into a more "appointment like" process that includes a form with required entries. Three entries that could be used for the entry on the main calendar page might be start time, end time and name of the event. Then you could have additional entries for that event/appointment with various validation criteria. Each individual event could have its own "clickable" link. Any pointers for where to start (I may ask you this in person on Saturday...)? -- Rick Cook ccox Creating a wiki page is pretty simple... and it would be possible using PmWiki's forms to gather info and create the page. The level on exact integration into PmCalendar... unknown. Might not be terribly hard to do. Certainly things on the plate for PmCalendar 2.0... at least I'm looking into it (no promises). The iCal Export recipe could be used to extract entries of a particular format for easy importing into whatever iCal capable tool you might have. Might want to look at that for some ideas of how the data might be formatted inside the created page. Event categories / multiple calendarsI have a wiki which is used by multiple groups of people. I wonder if it is possible to have a calender which is used by group A, a calender used by group B, and a calendar for common events. Ideally, each calendar would be placed in his/her own group, and you can easily select (:pmcal groups="CalendarA,Common":) to select events from multiple categories. Birthdays, etc. from page text variables?I have been wanting to use my wiki to store contact information, including information like birthdays, and somehow have that appear on a calendar. The FoxContacts recipe could easily be adapted to include birthdays, anniversaries, etc., but these are stored as page text variables in pages organized by person. Not quite what this recipe wants as input. Of course we could probably modify FoxContacts to add birthdays directly to the appropriate calendar page -- but then when we discover we have to correct some dates, we end up with our contact pages and calendar pages out of sync. Looking over the PmCal code, I see it loops over cals and acals -- how difficult would it be to also check an array that some escape function might have preloaded with calendar information? The escape might be able to loop over a group, checking page text variables and loading the array. This escape should be called once -- you don't want to loop over perhaps hundreds of contact for each date displayed. (You could probably have other escape functions that look at ical information, event databases, etc.) Sorry that I am not a PHP hacker, or I'd attempt this myself. -- rlt Displaying calendar from todays dateI may have missed this, but how do you display calendar events from todays date onwards? I have a sidebar which displays upcoming events. When I view or edit a calendar page from a month in the future, the sidebar also displays from that month onwards. I want it to display from the current (real world) date. I'm currently using: Is there a call along the lines of ccox Try alwaystoday=true in the sidebar calendar markup. Holiday button/link appearing in wrong colorThere appears to be a small bug in PmCal.php causing this link to not use its proper class. I fixed it by changing: // Output Extra Included Calendars links
//
$cl=sprintf("${PmCalPrefix}include%slink pmcalincludelink",$cal);
foreach ($cals as $cal) {
if ($cal != '') {
$out.="%class='$cl'%";
$out.=sprintf("[[%s|%s]]\n",$cal,$cal);
}
}
To this: // Output Extra Included Calendars links
//
foreach ($cals as $cal) {
$cl=sprintf("${PmCalPrefix}include%slink pmcalincludelink",$cal);
if ($cal != '') {
$out.="%class='$cl'%";
$out.=sprintf("[[%s|%s]]\n",$cal,$cal);
}
}
...which makes sense, since Hi, Is it possible to make new pages from pmcalendar to open generated and saved? Using template? Simppa |