I would like my calendar module to link outside of the site. As example, when I press on the date Jan 01, 2010 it links on a different page.
Doesn anybody have any suggestions?

Comments

skilip’s picture

This is possible by creating links in hook_calendar_block(). There's an example on how to use this at the help page.

oduvanchik’s picture

Thank you!

I created a module, copied an example there and changed the name, dates that I need.
I have a question about this part:
case 'alter':
if ($date->date == '10-19-1978') {
$date->content = l($date->day, "node");
}

can I use just a regular link? as example: $date->content = l("http://mysite.com/index.html");
And when should I call this function after? My module consists from this function only.

Thank you..

skilip’s picture

Hi,

It is indeed possible to create regular links, see the function description at the API page. The hook implementation should be called automatically when you replaced 'hook' in 'hook_calendar_block' with the name of your module (e.g.: 'your_module_calendar_block'). See http://api.drupal.org/api/group/hooks/6

oduvanchik’s picture

thank you very much for your help!!! You rock!

what I did:
1. moved my function from mymodule.module to calendar_block.module
2. case 'alter':
if ($date->date == '10-19-1978') {
$date->content = l($date->day, "http://mysite.com/index.html");
}

AND IT WORKS!!! =)=)=)