The 'Month','Week','Year' 'Day' and 'next>>','<

Comments

KarenS’s picture

Status:Active» Postponed (maintainer needs more info)

I do not have any clue at all what you are reporting here. And if you refer to other modules, like Panels, you need to be clear about which version of that you are using. Panels 2 is dead, only Panels 3 is going to be supported, so be sure you're using that.

iam_himanshu’s picture

Thanks KarenS

cgillogly’s picture

Status:Postponed (maintainer needs more info)» Active

Panels 6.x-3.0-beta1
Views 6.x-2.5
Calendar 6.x-2.1

I believe the problem iam_himanshu is talking about is the same one I am having. When going to the view page and you click on the date / navigation links, it goes to /path-to-calendar-view-page/ARGUMENT. However, when you add the view page to a panel, the link goes to /path-to-panel?=path-to-calendar-view-page/ARGUMENT

Example URLs:
http://example.com/calendar/2009-W18 (calendar view page)
http://example.com/custom/calendar?=calendar/2009-W18 (calendar view in a panel)

So, the problem seems to be that the argument never gets passed along to the view. I'm not sure if this is really a bug Calendar or Views... or something with Views within a Panel...

cgillogly’s picture

If you add a view pane (or content pane) to the calendar view, attach the year, month, etc to it, and set the argument input to be From panel argument and set it to first it will work if you manually type the argument into the URL... but the links still to the ?=path-to-calendar-view-page/ARGUMENT and don't work... so the output of the URLs is what needs fixed as well as maybe adding the view pane in the default install so people can just add that to their panels without having to create it and attach everything...

Parkes Design’s picture

Hi cgillogly? have you come up with a solution on how to get around this problem yet? Or are calendar pages just not meant to be in a panel pane?
I'm currently at the same stage where you are and I'm stuck as to how to change the links.

cgillogly’s picture

Try the latest release of ctools & panels to see if it's fixed now. I believe a few things were fixed in the last 2 releases that may fix this. I have changed how I was working with the Calendar when I changed themes, so I no longer need panels for this. However, if you find that the latest ctools & panels doesn't solve the issue, I will setup a calendar in a panel and take another look at it.

Parkes Design’s picture

Thanks cgillogy, I've used the latest versions but still have the same problem. So I reverted to renaming the calendar views path to the directory I wanted to use and build items around it using standard blocks to achieve the effect that I was after. I would be really interested when a solution for this gets released though.

Cheers.

Michelle’s picture

Title:Calender Navigation not working on Panels» Calender Navigation not working on Panels due to problem with date_real_url()
Project:Calendar» Date
Component:Code» Date API
Assigned:iam_himanshu» Unassigned

I just ran into this problem and spent most of the last hour digging through Calendar to try and figure it out. I was also chatting to merlinofchaos at the same time which got him looking at it. Being much better at this than I am, he found the problem. It's midnight and I'm not up to understanding what he's saying at this time of night, so just pasting the relevant bits here. Hopefully this is enough for Karen to swoop in and get it sorted so we can all use the lovely Calendar module in Panels. :)

[23:51] <merlinofchaos> Michelle: date_api.module function date_real_url() line 2331
[23:51] <merlinofchaos> That is creating a malformed url.
[23:52] <merlinofchaos> And I think the issue is that date_block_identifier is broken.
[23:54] <merlinofchaos> And indeed, date_block_identifier() comes up empty.

Thanks,

Michelle
(edit to add code tags)

cronix’s picture

Subscribing

basanta86’s picture

Has this been incorporated into the latest dev?

Michelle’s picture

@basanta86: This is still an active issue. When it's fixed, it will be marked so.

Michelle

ck9’s picture

Could you fix this please? Thanks / subscribing

milkmiruku’s picture

subscribe

marcin-mark’s picture

Title:Calender Navigation not working on Panels due to problem with date_real_url()» subscribing

subscribe

Michelle’s picture

Title:subscribing» Calender Navigation not working on Panels due to problem with date_real_url()

Sigh. I already asked you in the other issue not to change the issue title. Please stop. Nonsense titles make it hard to tell what something is when looking in the queue / tracker.

Michelle

ck9’s picture

Any progress on this? I guess a lot of people using calendars will want to present them within a panel.

attilahooper’s picture

Edit: oops, this wasnt my issue.

petrelharp’s picture

There is a temporary workaround in #395936-12: Date browsing doesn't work indside a panel pane, for all you antsy folks.

Fr0s7’s picture

Subscribe

jgoodwill01’s picture

Subscribe

ldweeks’s picture

subscribing

rismondo’s picture

subscribing

Skorpjon’s picture

subscribing

jessefulton’s picture

subscribing

robbertnl’s picture

Subscribe

davepoon’s picture

subscribing. Having an exactly same problem...

FreddieK’s picture

subscribing

jdln’s picture

subscribing

Apfel007’s picture

subscribe

mccrodp’s picture

subscribe

Apfel007’s picture

any hints here? Need a event slider in a panel - did someone find a work around ? A costum views etc.?

gapple’s picture

Digging closer to the problem, it seems to occur within date_real_url() with this particular statement:

<?php
 
// Is this an embedded or a block view?
 
if (!$force_view_url &&
  (!empty(
$view->preview) || !empty($view->date_info->block_identifier))) {
   
$url = $view->get_url($args);
    return
url($_GET['q'], array(
     
'query' => date_querystring($view, array(date_block_identifier($view) => $url)),
     
'absolute' => TRUE));
  }
  else {
   
// Normal views may need querystrings appended to them
    // if they use exposed filters.
   
return url($view->get_url($args), array(
     
'query' => date_querystring($view),
     
'absolute' => TRUE));
  }
?>

The if block returns a url like "calendar?=calendar/2010-09", while the else block returns "calendar/2010-09" (which I assume is the correct url needed).

It appears that date_api determines that the view is within a block, and so attempts to add the arguments to the query string instead of the url.
date_block_identifier() returns empty, as merlinofchaos mentioned, but I don't think it's broken; it just doesn't have a proper block identifier to return since we're not using a block.
I don't think date_block_identifier() needs any fixes, just the if condition needs to be improved so that it falls through to the else block when the view is within a panel.

gapple’s picture

It looks like the problem is with $view->preview.

When viewing the calendar as a page, both $view->preview and $view->date_info->block_identifier are NULL
When viewing within a panel, $view->preview is set to 'TRUE', resulting in the wrong path being output

kapep’s picture

Simple fix to use calendar navigation in panels without patching anything:

Use a validator (PHP Code) for the date argument.

$handler->view->preview = false;
return true;

In panels overwrite the view path with panels path.

gapple’s picture

While I was able to implement @kapep's work-around for a panel display, it took considerable wrangling (possibly due to some other issues with Calendar)
It's also worth noting that this will break the actual preview, so don't click any links in the display preview in the admin ui.

Views Settings:
I had difficulty with argument inputs other than "From Panel Argument: First". Others that seemed like they should work simply wouldn't, resulting in the default argument always being used.
"Allow Settings: Path Override" must be enabled, otherwise the view will use the entire path, arguments included, for links. It does not work to turn on the "Use Panel path" setting.

Panels Settings:
Add an optional argument to the panel's path (e.g. calendar/!date) and configure it (you may need to save and reload the page for the 'Arguments' item to appear in the panels menu)
Add the calendar panel display to the panel page. Override the path to the page's path without the argument (e.g. calendar).

kapep’s picture

Maybe I should mention that I wasn't able to create a working Calendar content pane in Views. It shows the Year/Month/Week/Day header and the current month and year but is empty otherwise. (Any help here?)

What I did was adding the calendar view page to the panel content.

Views: Only add the validator as in #34

Panels:
When adding/editing the calendar page:
There is an option named "Override URL:", I have set it to "events/calender" (that's my panels path).
For the arguments: I was lazy and checked "Send arguments" - I'm pretty sure it will also work by selecting specific arguments as described below the arguments input form.

The views preview does not work as it did before, I guess it some kind of non-ajax version of a preview. Well, unless you are using the same view somewhere else where you actually need the preview version with the ?=calendar/ part in the argument it shouldn't be a big problem.

KarenS’s picture

KarenS’s picture

KarenS’s picture

I don't use panels and don't have time to install it and try to debug this, so this is waiting for someone who does use panels to provide some sort of patch.

endiku’s picture

Subscribe

mErilainen’s picture

I have a same problem. In addition I'm using different languages, so the override URL sounds a bit tricky, I would have to set different override for each language. Best solution would be to get it working with with AJAX inside the pane. I'll investigate more and post here if I find a working solution with Panels and Views settings or patch.

AlfTheCat’s picture

subscribing

haggins’s picture

subscribe

baff’s picture

subscribe

MickC’s picture

Month Navigation solved - you have to do 3 things in Pane Settings:
1) set Use Panel path to Yes
2) set Argument Input to From Panel Argument, select first
3) Allow settings and check Path Override

Then in the panel settings in the page set the URL to your path URL. Then the month navigation works.

selwynpolit’s picture

I am using panels 6.x-3.9 and I can't see these Pane settings. Is there something I need to do in views to see these panel settings?

stevebart9’s picture

Not seeing settings in post #45 either

selwynpolit’s picture

ok, figured this out. Create a panel (it needs a url like "mycalendar") , add the calendar "page" view into the content and on the panels settings window (pane?) click Send arguments and then below that in "override URL" add the url mentioned above (i.e. mycalendar) - save and you are done!

When you click on the navigation links, instead of them referring to calendar/2011-09, they will refer to mycalendar/2011-09 which is your panel.

Aargh! I hope this saves someone else some time.

ps. You can use the url calendar for your panel but you will need to change the views page URL to something else. It appears that in the battle between panels and views, views wins and so a panel with a url "calendar" will never show up when there is a view with a url "calendar"

MickC’s picture

Pane Settings is in the Views UI, bottom left - I'm using Views 6.x-2.12.
#48 is using a "page" view, but you can also use a "panel" view if you change Pane Settings.

cartagena’s picture

Thank you sooooooo much for #45!! Worked perfectly. How did you ever figure this out? Thanks again...

revelstokesnowboard’s picture

@MickC

Thanks 1,000,000 for figuring that out.

Parkes Design’s picture

Nice... can't wait to try this.