Link from Mini-Calendar direct to event details

More
11 years 4 months ago #23101 by Avi
Hi!

I'm only going to be having one event per day so I want to link from the mini-calendar directly to the event detail page (where the user can then register).

I've been playing the the module's file, as well as the Up-coming Events module and I'm stuck. I can't seem to pass the event_id over to the calendar's link.

By default it is this: $link = JURI::root()."index.php?option=com_eventbooking&view=calendar&layout=daily&day=$year-$month-$dayos&Itemid=$Itemid";

On the event list the link is this:

<?php echo JRoute::_('index.php?option=com_eventbooking&task=view_event&event_id='.$row->id.'&Itemid='.$itemId); ?>" title="<?php echo $numberEvents. ($numberEvents > 1 ? JText::_('EB_EVENTS') : JText::_('EB_EVENT')) ; ?>

There the event id is "event_id='.$row->id.'" but try and I may to combine code, I just can't get it to work. Any suggestions? Thanks!

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #23110 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Link from Mini-Calendar direct to event details
Hi

You can try to use the code below :
Code:
if (count($currentDay["events"]) == 1) { $row = $currentDay["events"][0] ; $link = JRoute::_('index.php?option=com_eventbooking&task=view_event&event_id='.$row->id.'&Itemid='.$itemId); } else { $link = JRoute::_('index.php?option=com_eventbooking&task=view_event&event_id='.$row->id.'&Itemid='.$itemId); }

Then echo that $link variable to the href attribute of the a tag. The idea is that if the current date has only one event, you get that event by accessing to $currentDay["events"][0] . I think you know programming, so with that clue, you can edit code to meet your need.

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc