Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions /

Event_calendar and "show in menu"


Reply


3 Posts   1228 Views

Avatar
martbarr

Community Member, 53 Posts

3 July 2010 at 8:34am

Edited: 03/07/2010 8:35am

Hi,
I'm trying to have my calendar show in top menu but not the calendar_events in the tree below it.
by unchecking "show in menu".
But this also stops the events from showing at all in the events list.

Is there an easy way to fix this?

Am digging round the event_calender code and getting into dataobject::get filters etc
but surely this is a simple thing to do - why does unchecking "show in menu" also hide the events in my event list?
and anyone got a fix?

thanks
Martin

Avatar
martbarr

Community Member, 53 Posts

4 July 2010 at 9:54am

Edited: 04/07/2010 9:56am

well - have a workaround by altering a core file in event_calendar

changed line 159 of calendar.php from

   if($children = $this->Children()) {

to
   if($children = $this->AllChildren()) {

and now I get all events showing in my calendar even when "show in menu" is off.

but would love a better solution .................

cheers
Martin

Avatar
prawnstar

Community Member, 127 Posts

2 December 2010 at 7:10am

I just came across this problem as well. And while I don't think this is an elegant solution, I think it's better than hacking the core event_calendar code.

In my template.ss file I use:

<% if CalendarEvent %>
...do nothing...
<% else %>
<% control Children %>
...some code...
<% end_control %>
<% end_if %>

IMHO - I think of this as a template hack to fix a code logic issue. But at least it keeps the code from being hacked. It doesn't seem logical that events would be forced to show in the navigation. Like the blog module, the events should show up in the events holder without cluttering up the navigation.

Chris.b