I've been trying like mad to create a CiviEvent calendar; the FeedAPI method has not been working (which I'll detail in a separate post), so I've been trying to use the new CiviCRM Views2 integration.
Here is what I posted on the CiviCRM site:
I have managed to create a View from the exposed Civi Events consisting of:
• The Event Title that links to the event - good!
• Start and End times in the correct format by using Custom Date Format (g:i A) to the end of creating something like "12:00 PM - 3:00 PM." - excellent!So far so good. But when I try to create a Calendar view by entering CiviCRM Event Start Date into the Arguments section of Views, I get "The calendar_style style requires a Date argument." I've tried a variety of settings here, to no avail. I'm simply trying to reproduce the functionality of pasting the CiviEvent iCal feed into the Drupal 5 calendar, which worked brilliantly.
For whatever reason, that functionality is no longer implemented in D6 and I'm having a horrific time just trying to create a CiviEvent calendar.
I realize this is more of a Calendar/Views question than a Civi issue; I'm hoping that someone over here can shed some light on the issue - thanks much!
Calendar is recognizing the Date fields as fields, but it's not recognizing the "Date From" as a valid Date field and thus, the calendar cannot be constructed. Any ideas here? Thanks in advance!
Comments
Comment #1
marqpdx commentedI read over here:
http://forum.civicrm.org/index.php?topic=6320.0
that this Calendar module is not built to recognize CiviEvents as Dates, hence your issue above. I ran into the same thing.
I"m going to investigate some patching....
in the meantime, did you post about your experiments with the happy ICal Feed route??
m
Comment #2
bcobin commentedNo, I did not, so here goes... this is not as detailed as I would like, but I will do my best in the time I have. I make no guarantee this will work - I was in kind of a "fugue" state for days over this but I did finally manage to get it to happen - hopefully this will at least save somebody some grief.
Ok - here goes...
Install parser_ical and updated Date and CCK to the latest dev versions. There are several patches and I'm not sure of the current state of things; you'll just need to experiment. Make sure Link and feedapi_mapper are installed.
You'll need to create two new content types: I called mine iCal Feed and iCal Feed item.
Create the iCal Feed item content type first - create a date field with To Date: optional, granularity: minute and custom display of "g:i A -" - this will format your date (when you get there) as, say, 6:30 PM - 8:30 PM. Also create a link field to hold the link to the Event. Save the content type.
Next, create the iCal feed content type - under Feed API, check "is a feed content type," update existing feed items, enable iCal parser and create node from feed items - choose your newly-created iCal Feed Item as the target node type. Created date of item nodes should be retrieve from feed, but I don't know if this makes a difference.
Now, create your Civi iCal feed, using the the Civi URL - use only the parser_ical processor. Do not choose update items on node creation. Save the feed.
Go to the Map tab. You should see a feed item example with your feed information - if you see that, so far, so good!
Now, under mapping, I did as follows (these are field names I created; yours may differ):
Title => Map to title (node)
options->original_url => Map to field_ical_event_link (link)
options->DSTART => Map to field ical_event_start (date): From date
options->DTEND => Map to field ical_event_start (date): To date
(Note: both DSTART and DTEND go to the one date field you created!)
I mapped raw->summary and raw->description to body (node) and used no mapping for the other fields. Now, save the mapping. Refresh the feed, and you should see a feed item appear. If you do, you're halfway there.
Next, Calendar...
Clone the existing Calendar and rename it. Set the filter to the node type you've defined for your iCal feed items.
Under Argument, provide default argument, option current date. Granularity: month. Under Date field, choose Content: From (field_ical_your_event_start). You only need to choose the first one.
Now choose Method: OR and save.
Now create two fields - one for the Event link and another for the Date. You should now start seeing something in your newly-created calendar and you can tweak from there.
I created blocks for upcoming Civi events by using the exposed Views in Civi 2.2 - a totally different method for the same data.
Easy, right? So much more fun than just pasting the Civi feed into the calendar like we used to, eh?
Seriously, I am grateful that so may people spend so much time creating this terrific stuff - just trying to give back a little bit- good luck!
Comment #3
karens commentedThere are several ways to make this easier. Some of it is documented in the Advanced Help included with Date and some of it is new and I need to update the documentation:
Also there is only one patch still needed, everything else is committed to the latest -dev version of the related module. You still need the latest patch for the Date feed mapper, but hopefully that is just about ready to commit, too.
1) Create a content type for the iCal feed and set it up as a feed type as noted above.
2) Use the new Date Tools wizard to auto-create a content type and matching calendar for the feed items. That will do a whole bunch of things in one step -- create the content type, create a date field and add it to the content type, and create a calendar for that type.
3) Create a new ical feed node, as noted above, but when mapping just map the top-level VEVENT to the top-level Date VEVENT -- one mapping, not two or three.
4) After mapping the feed, remove the items and then refresh to pick up items that are mapped correctly and you're all done.
The new method *is* more complicated. Once all the patches are committed I plan to add this to the Date Tools wizard to make this more automatic. The big advantage of the new method over the old is that the imported dates are now nodes and you can do anything with them you can do with any node, plus they can now be used as filters and arguments to display specific items, something you could never do using the old method.
Comment #4
arlinsandbulte commentedLooks like Karen supplied a method to do this (although she hints at a better method yet to come).
So, I am going to mark this as fixed now.
If someone desires more details (especially regarding the yet to come method) open it back up.
Maybe, Karen, you WANT to open this issue as a place holder for your more automatic method...
In any case, if you want to squeak about this, just re-open.