Closed (fixed)
Project:
Calendar
Version:
6.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Dec 2007 at 01:15 UTC
Updated:
2 Mar 2009 at 16:20 UTC
Jump to comment: Most recent
Comments
Comment #1
Danai-1 commentedI agree. I'm using Drupal 5.3 with Calendar 5.x-1.7.
Each calendar entry has an entry, like d650ca85-48cd-4123-9587-ac7c6e562eda .
What I would suggest, is that this button automatically creates a node, and if the Path module is enabled, that it would also create the pathname http://www.website.ac/d650ca85-48cd-4123-9587-ac7c6e562eda .
Best regards
/Danai
Comment #2
karens commentedThe problem is that we don't know what to link to -- you might have several different date fields that were generated in different ways and they might be coming from different content types. So you need a way to indicate exactly what type of node to create from that link, since there isn't any way for the Calendar module to know what you want to do otherwise.
It could maybe be another setting in the calendar settings where you select the url to go to for that link.
This would take a patch to create a form element on the calendar settings where the user can set this url up, and add the link to the theme. If someone wants to create such a patch, it should be against the 5.2 version.
Comment #3
pelicani commentedThere is a convenient theme function which you could use to display link for each day in the calendar.
Check out this function theme_calendar_date_box($date, $view, $params, $selected = FALSE)
Depending on the version of calendar, this function is constructed in different ways, but can achieve the same results.
For example...
The above code displays the day for each view.
You can add an additional link (i.e. l('+', 'node/add/event/node/add/yourcontenttype/'.$year.'/'.$month.'/'.$day))
which will pass this day to the node add form for your content type.
Or get fancy and modify the link to display a popup of several options, i.e. insert different types of content for that day.
Comment #4
pelicani commentedThat isn't all that is needed, you also need to alter the node/add form to use the date you are passing.
function custommodule_form_alter($form_id, &$form) {
if ($form_id == "event_node_form" && arg(1) == "add") {
If you are using the JS popup date, alter your form and modify this field ... $form['field_date'][0]['#default_value']['value']
There may be special form formatting for each type of date input.
In the past, I recall they were setup differently.
i.e. $form['field_date'][0]['value']['year']['#default_value']
Comment #5
scottrigbyThis is a great feature :)
I'm also considering that it might be good to remove the link from the day, if there is no event (and just show the date grayed out).
I'm asking about it here because this is the only place I've seen so far where the day link function is discussed... is there an 'easy' way to make an if statement (if date contains an event, then show the link - if not, then not)?
Thanks for your advice!
:)
Scott
Comment #6
karens commentedMoving D5 feature requests that aren't going to get into the initial official 5.2 release to be D6 feature requests that could potentially be backported to D5.2.
Comment #7
karens commentedThe latest code has a setting in the calendar page where you can identify the content type that should be linked to this calendar. If you fill that out you will get a '+' link at the top of the calendar to add a new event. It's at the top of every page, not in every date, but I think showing it on every date would create a lot of clutter.
Comment #8
Anonymous (not verified) commentedhi karen,
just switched to the latest dev-code, but have no clue where this calender setting is supposed to appear.
would be are real usability boost!
thanx
bernd
edit: uups, sorry, found it in the views calendar page settings myself.
great work!
Comment #9
vito_a commentedI've tried it already at the http://drupal.org/node/145205#comment-1253868 ( the original post was http://drupal.org/node/22741#comment-1212444 ), seems that adding a '+' to every date, just below the day's number, doesn't makes much clutter, if there isn't many issues on that date however.
@KarenS: I was handling that with URLs like /node/add/event/2009/02/16 and some code at the 'date_all_day' module ( http://drupal.org/node/145205#comment-1253868 ). Would it be useful for someone, should I create a patch for it, or this is already in the latest release's code?
Comment #10
karens commentedIt would be useful to have the date module check the URL for a date value and use it if there. But please start another issue for that to avoid confusion.
And I would provide the date in the ISO format, like YYYY-MM-DDTHH:MM:SS rather than splitting the date parts into different arguments. If the input is an ISO date, you can easily create a date object directly from that value to populate the form. So go ahead and work on a patch if you like. Thanks!