0

I enable the calendar module, then "Add view from template" on /admin/structure/views/add-template, but I cannot count nodes published at the same day in the month view by following this tutorial. I want events occurred in the same day can be counted like "3 events occurred" other than the original output in the red box, and the counted field can be rewritten. enter image description here

I tried aggregation feature of views, but no luck.

1

Finally, I get it working. After I turn on View's setting "Show the SQL query", I notice there is an unnecessary GROUP BY field "nid" in the Calendar view, then I unset this field in a hook_query_alter(QueryAlterableInterface $query) as below:

if ($query->hasTag('views_' . $view_name)) {
    $fields =& $query->getGroupBy();
    unset($fields['nid']);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.