Hi all,
I've been working on adapting FullCalendar to load the event into the sidebar rather in a new page or colorbox. So far, this is what I have in fullcalendar.views.js on line 74:
else {
$('#block-block-1 .content').load('event/test-event .content');
}
"#block-block-1 .content" is the sidebar block where the event will load.
"event/test-event" is the url to the event, and ".content" is the div on the event page that will load into the block.
This code works correctly. However, if I replace "event/test-event" with "calEvent.url," the code breaks. I'm not sure why this is; maybe "calEvent.url" calls the entire url rather than a relative url? Any help would be appreciated.
Comments
Comment #1
aspilicious CreditAttribution: aspilicious commentedyou can try to print the "calEvent.url" so you know what it is.
If it's an absolute path you can substract "Drupal.settings.basePath" from it to get the relative part.
Comment #2
tim.plunkettSome more work on your part to debug this would be helpful.
console.log(calEvent);
and then viewing it in your JS console (Safari/Chrome natively or Firebug in Firefox).Comment #3
CoreyMoore CreditAttribution: CoreyMoore commentedI've been working on other projects, so I'm just getting back to this.
When I use colsole.log(calEvent); in my JS console, I get "ReferenceError: calEvent is not defined" error. I may be using it wrong, though.
Comment #4
CoreyMoore CreditAttribution: CoreyMoore commentedSorry guys for not giving you more information. I was finally able to get this to work using the following method: