If using Joomla's Core SEF with mod_rewrite, many will notice that if you have an Event or Venue page as a menu item, that if the link to that same page appears after you've clicked on it, EventList will make the mistake of trailing the URL with the viewname, details, and the item slug, giving you results like so:
Your normal link to the Eventlist component events view might be the following:
http://yourdomain.com/events
Therefore the normal link to a category list / category view would be as so:
http://yourdomain.com/events/categoryev ... MyCategory
But, if you add a menu item to link directly to "MyCategory," and let's say it was made a Sub Menu item to the Events menu item, all the links within eventlist to that specific category become the following if you've already done Template overrides to use the Route Helper:
http://yourdomain.com/events/MyCategory ... MyCategory
as opposed to what you're actually looking for which is like so:
http://yourdomain.com/events/MyCategory
This hack combines template overrides with a tiny code modification within the file com_eventlist/helpers/route.php so that if you've created a menu item that goes specifically to a category or venue
Below is an example of what the templates/your_template/html/com_eventlist/categoryevents(or whichever view within eventlist)/default_table.php file could contain for the venue portion of the data where it used to be just a basic Joomla link constructor:
Code: Select all
<?php
endif;
if ($this->elsettings->showlocate == 1) :
?>
<td headers="el_location" align="left" valign="top">
<?php
if ($this->elsettings->showlinkvenue == 1 ) :
echo $row->locid != 0 ? "<a href='".JRoute::_(EventListHelperRoute::getRoute($row->venueslug,'venueevents'))."'>".$this->escape($row->venue)."</a>" : '-';
else :
echo $row->locid ? $this->escape($row->venue) : '-';
endif;
?>
</td>
Code: Select all
<?php
endif;
if ($this->elsettings->showcat == 1) :
if ($this->elsettings->catlinklist == 1) :
?>
<td headers="el_category" align="left" valign="top">
<a href="<?php echo JRoute::_(EventListHelperRoute::getRoute($row->categoryslug,'categoryevents'))?>">
<?php echo $row->catname ? $this->escape($row->catname) : '-' ; ?>
</a>
</td>
<?php else : ?>
<td headers="el_category" align="left" valign="top">
<?php echo $row->catname ? $this->escape($row->catname) : '-'; ?>
</td>
Now here comes the HACK:
Open up JOOMLA_BASE_DIR/components/com_eventlist/helpers/route.php
On line 57, REPLACE the following code:
Code: Select all
if($item = EventListHelperRoute::_findItem($needles)) {
$link .= '&Itemid='.$item->id;
};
Code: Select all
if($item = EventListHelperRoute::_findItem($needles)) {
$link .= '&Itemid='.$item->id;
if ($item->ExactMatch == 1) {
$link = 'index.php?Itemid='.$item->id;
}
};
Code: Select all
if ((@$item->query['view'] == $needle) && (@$item->query['id'] == $id) && ($item->published == 1) && ($item->access <= $access)) {
return $item;
Code: Select all
if ((@$item->query['view'] == $needle) && (@$item->query['id'] == $id) && ($item->published == 1) && ($item->access <= $access)) {
$item->ExactMatch = 1;
return $item;