Closed (outdated)
Project:
Calendar
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Apr 2009 at 21:11 UTC
Updated:
2 Apr 2020 at 15:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
osopolarDoes this work with insert view or with embed view?
print views_embed_view("calendar", "calendar_block_1" );For me its not working, the view will not show. Now I'm not sure if I have an error somewhere or is it a problem which comes with the changes.
If I use the mini calendar in a block it works well, but I want to be able to use it in a node.
Comment #2
agentrickardLikely an error in the PHP code you are using, especially if there are missing or different arguments.
What PHP code are you using? Or are you just using the old 'default to now' setting?
Comment #3
osopolarThis is the code For the date Argument:
This should return YYYY-mm of the current date in the cases:
- argument is empty
- argument is today (this is my placeholder)
- or the argument is not a valid Date (year and month)
But actually I have the same Problem with:
The date argument is the first one. I have a second one (taxonomy term) but this I set to show all values if no argument given.
Actually its working well in as a normal block (i.e. see http://cyber4kids.de/kalender/2009-08-06). But not on my front page (http://cyber4kids.de ... should appear in the top right green box called "Kalender"; a normal page with some views inserted by insert_view; embed view will have the same problem).
To insert the view on the front page I use: [view:kalender=calendar_block_1]. If I use the default argument handling (Provide default argument -- Current date) it works fine.
Maybe I have to change something else in the calendar module.
Comment #4
agentrickardIf I recall correctly the date format must match that used by your argument. So if you are using month granularity 'y-m' is correct.
Also make sure that arg(1) works in this context. I don't believe that it does. And even so, it cannot always be used in a write-context.
Are you logging any errors?
Comment #5
osopolarYes I'm using month granularity (its about the mini calendar). Why do you think arg(1) won't work. I thought that maybe arg() was not working before but now its doing well ... I'll check documentation for what is the better way. ... But arg() is not the cause of this problem, because also when I just use
return '2009-05'(without the php tag) it's not working (can't see the embedded calendar block).Would you be so kind and test it with your calendar? With the insert_view module or just with views_embed_view function to see if your calendar block will show up in a page?
As I said before, the from views provided block is working well. But the strange thing is if I want to use this block with
module_invoke('views', 'block', 'view', 'kalender-calendar_block_1');it won't work.Comment #6
arlinsandbulte commented+1 for this feature request to allow php default arguments!
This feature might solve this issue: #174881: Make calendar default to next month.
Comment #7
rismondo commentedI used a similar patch to allow for a fixed default. It works, but then the mini calendar block disappears from the page for all pages whose address is /node/nnn (it appears on the frontpage and on the administration pages, however).
Anyone else sees the same side-effect?
Comment #8
MichaelP commentedThe initial patch give me an error and didn't get all the validations to allow php supplied values rather than default current date, but I got the idea, tks @agentricard.
Here's a follow on which modifies block, attachment and style elements to allow php defaults.
This is my first patch - hope it's correct and I'm doing the right thing posting it...
Comment #9
wilgrace commentedSubscribe - is this likely to make it into the next release?
Comment #10
momper commentedsubscribe
Comment #11
momper commentedtested and works ...
thanks momper
Comment #12
momper commentedbut there seems to be a limitation - if i use the top navigation in the page view with week, month, day in a first testing circle it stays in the future but in a second circle it switches again to the current date?
Comment #13
momper commentedi only changed the argument as an override for the "Calendar block" display - i wanted to do this for the "Calendar page" display too, but i got this know error message in the views configuration backend, that there are no standard arguments defined ...
Comment #14
arlinsandbulte commented#12: What do you mean?????
Comment #15
momper commentedok - bad english :)
i have the calendar block -> everything is fine -> it shows for example the october
i click on an event day in the calender block -> the correct day is shown in the calendar page
i change with the navigation in the calendar page to the display month -> i'm in month june (wrong behaviour ...)
Comment #16
momper commented#8 there is the file calendar_plugin_display_page.inc - this has also to be patched too ...
so everything is working now :)
Comment #17
arlinsandbulte commentedneeds work then, according to #16.
Could some one make a patch that includes everything?
Thanks
Comment #18
mandclu commentedThe attached patch includes the changes from #8 with an extra instance as identified in #15.
Comment #19
mandclu commentedComment #20
tryitonce commented.... so, I installed the patch - no problem.
But which php code do I put where to create a mini calender in the sitebar looking one month ahead?
Thanks for any suggestions .....
Comment #21
drupal_was_my_past commentedsubscribe
Comment #22
jg314 commentedsubscribe
Comment #23
kenianbei commentedI'd also like to see this included, particularly in 7.x branch. I have a use case where the client needs a calendar for a specific day each year (room booking for a yearly conference). I'd like to grab that day using php for the calendar view.
Comment #24
simon georges commentedIn 7.x, I succeeded in having PHP-based default arguments for the Calendar View (without any patch). The only remaining problem is: when exporting the Views, the PHP code isn't exported (same symptom as in #1202248: Exported view doesn't include 'default_argument_options' attribute).
Comment #25
neslee canil pintoThe D6 branch is no longer supported so we're closing this issue. If you think this issue still exists in D7 you can open a new one.