Dear all,

in calendar view -> Tab; Calendar page -> Section: Calendar settings

One can choose a content type for an "Add new date link". It would be really convenient if the date in the destination content type would be prepopulated in the date field.

Maybe some code can be taken from the prepopulate module?

What do you think? Thanks,
nhck

Comments

curtaindog’s picture

With the aid of the http://drupal.org/project/prepopulate module I used a bit of javascript in the view footer to allow users to click on empty areas in the monthly calendar to add events on that day. It's pretty rough and should be run through the php filter so that I can weed out the unauthorised (they'll get 403'd anyway so I'm not that concerned) but works well enough as a proof of concept.

<script type="text/javascript">
$(function() {
$("div.month-view div.inner").css("cursor", "pointer").click(function() {
var date = $(this).parent().attr('id').substr(9);
var year = date.substring(2, 4);
var month = date.substring(5, 7);
var day = date.substring(8, 10);
window.location = '/node/add/event&edit[field_date][0][value][date]=' + day + '.' + month + '.' + year;
});
});
</script>

Hope this helps.

developer-x’s picture

I do a similar approach with the prepopulate module. I've documented this approach in the following issue http://drupal.org/node/916448#comment-3566032

curtaindog’s picture

Nice one, developer-x. A template-based solution such as yours would be better than the one I posted, but I must admit that theming calendars has caused me grief in the past so I steered clear.

Artusamak’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

6.x is entirely unmaintained.