I actually wish to embed the OG Calendar in a view. Is there a way to do this? I figure if I can embed it in a page, I should be able to embed it in a view.

Thanks!

Comments

somebodysysop’s picture

Actually, I found a way:

global $current_view; // The current arg is "12" for group id 12

$output = og_calendar_page($current_view->args);
print t($output);
print t("<hr>");

Problem is, this generates this error:

user warning: Unknown column 'n.0' in 'where clause' query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE n.0 = '12' in /var/www/html/websites/drupal/brix/includes/database.mysql.inc on line 172.
somebodysysop’s picture

Never, mind. Fixed the problem this way:

global $current_view;
$gid = $current_view->args;

$output = og_calendar_page($gid[0]);
print t($output);
print t("<hr>");

What this allows me to do is create another view for my Group Home, and embed the group calendar in it.

darren oh’s picture

Status: Active » Closed (fixed)
gracearoha’s picture

Title: Is there a way to embed the OG Calendar on a page » Is there a way to embed the OG Calendar on a page?
Status: Closed (fixed) » Postponed (maintainer needs more info)

Where did you put this code?
in the views header?

somebodysysop’s picture

Yes, in the views header.

gracearoha’s picture

Thanks that does embed the calendar nicely in a view.
but it seems that my events show up in the date they were entered and not in the date of the event.
also, i am still having a problem with my events also showing in the public calendar as well as in the group and i see the message, "Could not access any events for the "ABC" group" above the embedded calendar view as well as when i click on the "Group calendar" in the Group details block. Are you encountering any of these issues?

somebodysysop’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks that does embed the calendar nicely in a view.
but it seems that my events show up in the date they were entered and not in the date of the event.

Ths is another issue being added to one that has already been closed. I suggest you open a new issue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.