I am having a bit of trouble figuring out a thing with Drupal Calendar.

I have created a custom content type , with a date field. I display the dates as events in a Calendar style view.

I want to add custom "event" on the day(s) after this event,based on some PHP logic. What would be a starting place to start modfitying it ?

For example: I insert 26th of May as a date (in a node of my custom content type). If the day is Saturday, I want the next day to be also marked in the calendar.

1 Answer 1


Since the event is a content type. You could use hook_cron to find expired events and add new event node.

Add node programmatically.

  $body_text = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.';

  $node = new stdClass();
  $node->type = 'article';

  $node->title    = 'Node Created Programmatically on ' . date('c');
  $node->language = LANGUAGE_NONE;

  $node->body[$node->language][0]['value']   = $body_text;
  $node->body[$node->language][0]['summary'] = text_summary($body_text);
  $node->body[$node->language][0]['format']  = 'filtered_html';

  $path = 'content/my-lipsum-' . date('YmdHis');
  $node->path = array('alias' => $path);


How to programmatically create node in drupal 7

  • This might help me continuing my progress. I just have to create the back-end logic so it suit my needs. Thank you ! Commented May 19, 2013 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.