Active
Project:
Calendar Block
Version:
6.x-2.0
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Jun 2010 at 05:46 UTC
Updated:
18 Jun 2010 at 22:07 UTC
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
Comment #1
skilip commentedThis is possible by creating links in hook_calendar_block(). There's an example on how to use this at the help page.
Comment #2
oduvanchik commentedThank 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..
Comment #3
skilip commentedHi,
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
Comment #4
oduvanchik commentedthank 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!!! =)=)=)