I was just looking at a demo of Datenator, a SourceForge calendar project, and one cool feature they have is that every calendar day has a plus (+) icon in the corner. Clicking it leads to the "new event" form. The date information, of course, is already populated in the form. This is a nice useability feature.

http://www.juhoz.net/datenator/demo/

Comments

shark’s picture

Perhaps at the bottom of the calendar a link could be added for "Add Event". I assume this would be almost the same code as the add-event icon for each day, just put in a different place.

Perhaps the "Add Event" below the calendar or the icons in the days would only show up if the user was logged in and had permission to add events.

shark’s picture

I realize now that we can't just say "Add Event" since, using flexinode, there may not even be a user defined content type called "Event". Options:

1) Calendar comes with a generic Event content type and calendar views display "Add Event" to link to that. The user could optionally change it so it is "Add [user specified user defined content type]".

2) If there is one flexinode item capable of being on a calendar, the calendar says "Add [whatever]" where "whatever" is the name of that one content type. If there are two or more, the calendar view shows "Add [menu]" where [menu] is a drop down menu of all possible content types.

robertdouglass’s picture

Good point. IMO this is more evidence that not having a generic event node type is a restrictive constraint. It would be very easy for the event.module to offer an event node without losing any of the flexibility that it currently has in assigning event-awareness to arbitrary node types. Then the "add event" icon would create one of these default nodes.

Marking events into the calendar is much more intuitive and user friendly than starting with a node-creation form, especially as long as we use selects for the dates instead of a date-picker widget. I therefore still feel that a small little plus sign in each day would be a great useability gain.

pieterdt’s picture

I think the flexinode approach allows for more flexibility. This way you can easily have several calenders which can be combined if wanted.
Perhaps a combination of both approaches is better: show a plus sign, and when clicked, in creating the event, the user has to select the type of event. This, however, will make creating an event a two step process, because the node creation cannot be done until the type is selected.

I don't think that a generic event type is desirable. Not having it allows for more flexibilty.

robertdouglass’s picture

The generic event discussion is off topic here, but I don't see how having a node type that is "always on" when it comes to event-awareness makes it less flexible. I wasn't proposing removing the flexinode-events.

I think having the user select what node type the event should be is fine - they have to do that at some point anyway. The important thing is, you start from the calendar and choose the starting date using the visual aid of the calendar. This can't be replaced with the date-picker widget either, by the way, as only the calendar view shows what days have existing events in them. If I'm scheduling a meeting, I can't even begin to know what date and time until I consult my calendar. That's why I think this would be useful functionality.

shark’s picture

I see what you're saying Robert. While not so much related to the original feature request, I'd like to say that for those people who do start with Create Content > Node, having a date picker widget thing would be desireable. This is especially true when you're adding an event that is already happening, like a football game, TV show, etc and you just want to get it inputted correctly.

Back on the original subject, if there was to be an Event node that comes with the calendar, one advantage of that is that if this generic Event is sufficient for people to use, they may not need to install flexinode.

Freso_deprecated’s picture

Perhaps put this into settings -> event and let the site admin decide what content type "Add new event" would add a new node of, and whether he wants it shown at all?

bkudrle’s picture

Or how about have a drop-down/combo box on the form where the user is creating the event. The drop-down box would list all of the event types that are available (e.g., different flexinode event types or a default event type if that gets added to the events module), and could be set to some default as set by the administrator settings for the event module. In this way, there would be no extra step when the user clicks on a + icon in a certain day. All of the decisions would be in the event details form itself.

shark’s picture

Just a note - this feature request appears to be essentially the same as http://drupal.org/node/6922 ("Create events from calendar").

killes@www.drop.org’s picture

Status: Active » Closed (duplicate)
vito_a’s picture

Unfortunately got no solution for Event, so tried the Calendar and found a solution for it. This post probably needs to be moved to some Calendar-related topic.

So just added the module for event creation from Calendar. The original comment is at the http://drupal.org/node/235662#comment-1212417 .

The following code is needed in the theme to add a create event link to the month and day view:

/**
 * Format an date's day box in a calendar
 *
 * @param date
 *   The day to display in YYYY-MM-DD format.
 * @param view
 *   The view being displayed.
 * @param items
 *   The list of all items in the current view.
 * @param params
 *   An array of paramters.
 * @param selected
 *   Whether the current date has nodes.
 * @return
 *   A themed day.
 */
function themename_calendar_date_box($date, $view, $items, $params, $selected = FALSE) {
  $add_link = '';
  if($view->calendar_type != 'year') {
    $add_link = '<div class="day addevent">'. l('+', 'node/add/event/'. str_replace('-', '/', $date)) .'</div>'."\n";
  }
  return theme_calendar_date_box($date, $view, $items, $params, $selected). $add_link;
}

Also you may add the addevent CSS class to the site's stylesheet and theme it to look similar to the rest of date parts:

.addevent {
border-style: solid none solid solid !important;
border-width: 1px !important;
border-color: #CCCCCC !important;
}

felipe’s picture

Hi Vito, I'm new to drupal.

Can you tell me roughly what steps should I take to implement this? I'm using drupal 6 latest version of date and calendar.

Thank you.