Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am only using the calendar module to be displayed as a block, not a page...and it's connected to my blog.
I realize most people want the calendar for projects potentially listing several events per day, but I will always only post one event per day. Is there a way to delete the interim page listing all events for that day, and just link directly to the blog article?
However, I would like to keep that feature for the "Month" link in the calender...IE: when visitor clicks on July they will see a list of all articles for July.
Thanks in advance.
paul
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedThere is a theme in calendar.theme called 'calendar_date_box'. That is where the link to the day is created. Just create your own version of that function and put it in your theme folder, and make the link go wherever you want it to.
Comment #2
finedesign CreditAttribution: finedesign commentedThanks Karen-
First, I haven't responded in awhile because I thought the Drupal site would email with responses to my post.
I'm sorry to say I really don't understand the function you describe. I've copied it over to my template.php file and tried some things, but I really don't know what I'm doing. Any chance you could elaborate?
Just to make things clearer, the function follows:
Comment #3
KarenS CreditAttribution: KarenS commentedNow that I look at this closer, I see the problem. The way to link to the blog is to to change $url at the top of the function to something like:
But you don't have any $nodes at the point where the date box is created (on the month view), you'll only have your list of $nodes when you actually go to the day view, so there is no way to do this. Based on the way Views and the Views calendar work, I'm not sure there's any easy way to do what you want. And this is not a common use case, so it wouldn't be worth spending a lot of time trying to figure out a work-around.
Sorry!
Comment #4
KarenS CreditAttribution: KarenS commentedActually there is a way to do it, but it's only for someone who is willing to dig into Views and who knows a bit of PHP. I can just point you in the right direction if you want to try it. You would have to run something like the following:
That is just a general idea of the way you would have to do it. The idea is to run the view that would have been run on the day view by building the view with the arguments for that day, but ask for the array of items it would have found instead of the full view. Then pop off the first item as your node and link to it.
I can't help you debug this and get it working, I'm just providing this to point you in the direction of a solution.
Comment #5
finedesign CreditAttribution: finedesign commentedThank you Karen. This helps a lot actually. I'll see what I can find out.
Comment #6
(not verified) CreditAttribution: commentedComment #7
Eugene Fidelin CreditAttribution: Eugene Fidelin commentedI also use this theme function to turn off link to those dates which have not any nodes
Comment #8
funkeyrandy CreditAttribution: funkeyrandy commentedcan anyone post the full code to this...maybe returning a day list like this:
jan30 2008
-node
-node
jan29 2008
-node
-node
etc
thanks!