create event from calendar clicking on date
I`m trying to make a calendar block with clickable dates. this is for a guest house to make reservations.Clicking on date would take to /node/add/my_event/2009-06-05 or /node/add/my_event/?date=05-05-2009 or similar. I want to pass the date as argument to "create content" form. any guest has access to create this type of node, but the default state is "unpublished" so that only administrator can approve (publish) the node. after that the created event would appear in calendar block and have CSS "has-event" definition (e.g. red color).
the problem is i have no idea how to pass date as argument. i can achieve this if i set the date field as simple text field by outputting the value with PHP (checking the $_GET['date']), but then it would not work as an event and wouldnt be displayed in calendar, since its just a textfield.
the date field allows only 3 default values - BLANK, NOW, and RELATIVE. it does not accept tokkens or php given arguments.
Can somebody help me out with this?
i need it in three simple steps:
1) guest visitor clicks on date
2) guest visitor has already filled date, fills out other fields and creates node (does not publish it)
3) admin checks and approves reservation node, publishes (doesnt show public), and the date appears in red color on the calendar block.
Thanks.
Valters

did it with javascript
since i got no answer, had to continue on my own. so basically i edited calendar-mini.tpl.php to show different links, e.g. domain.com/go_reserve/?10.06.2009 . with .htaccess i created redirect from /go_reserve/* to /node/add/reservation?* so the link looks like domain.com/node/add/reservation?10.06.2009 or similar. in the end i edited page.tpl.php and added some javascript something like: if substring(0,45,document.location.href) = domain.com/node/add/reservation, then document.getElementById(some_datefield_id).value = substring(45,55,document.location.href);
that is the best i could do. but it works.
I would have said use the
I would have said use the default value setting for the CCK date field, and theme your calendar view to put an add node link into each date.
Then your link is /node/add/event/2009-06-19
Same sort of approach :)
this info is exactly what I need
this info is exactly what I need - however the info is very condensed. I have a few questions joachim if you don't mind. Does you answer mean (und theme your calendar view to put an add node link ino each date.) that one has to do that with script in the templete? I was looking all over the internet to work out views and how to do that without scripting. I am a newbie to drupal but very excited about it. I think I could manage to insert some script somewhere if you would point out where to.
What I would like to achieve is that I have a link in each date and with this link a certain content type opens up-ready for content to be entered.
Thanks -
theme your calendar view to
You're best off starting with the Drupal 6 theme guide.
Theming does involve coding in PHP, but this particular change should be simple. Just a question of finding the right template.
As for the URL prepopulating the new node form, I'm not sure what I mean....
There's prepopulate module for one; the other thing you can do is write default code for the CCK field that reads from arg(). Again, that's coding.
Thanks for pointing out the
Thanks for pointing out the right direction - I should be able to take it from here. And also I am impressed by the drupal community.
cheers !