Page 1 of 1

Little bug in "router.php"

Posted: 11 Mar 2010, 00:41
by susi
hi,

I use joomla core-Sef.
For some phoca-Gallery-Categories a created there own menu-items.
But at links to this categories only the default-itemId (itemid of the Site with the link) were set NOT the ItemId of the existing Menu-Item.

I changed in the router.php following lines:

Code: Select all

			
foreach ($items as $item)
			{
				// Check if this menu item links to this view.
				if (isset($item->query['view']) && ($item->query['view'] == 'detail' || $item->query['view'] == 'map' || $item->query['view'] == 'info' || $item->query['view'] == 'comment' )
					&& isset($query['view']) && $query['view'] != 'category'
					&& isset($item->query['id']) && $item->query['id'] == $query['id']) {
						$itemid	= $item->id;
				}
				else if (isset($item->query['view']) && $item->query['view'] == 'category'
					&& isset($query['view']) && ($query['view'] != 'detail' || $query['view'] != 'map' || $query['view'] != 'info' || $query['view'] != 'comment')
					&& isset($item->query['catid']) && $item->query['catid'] == $query['catid']) {
						$itemid	= $item->id;
				}
			}
to

Code: Select all

			foreach ($items as $item)
			{
				// Check if this menu item links to this view.
				if (isset($item->query['view']) && ($item->query['view'] == 'detail' || $item->query['view'] == 'map' || $item->query['view'] == 'info' || $item->query['view'] == 'comment' )
					&& isset($query['view']) && $query['view'] != 'category'
					&& isset($item->query['id']) && $item->query['id'] == $query['catid']) {
						$itemid	= $item->id;
				}
				elseif (isset($item->query['view']) && $item->query['view'] == 'category'
					&& isset($query['view']) && ($query['view'] != 'detail' && $query['view'] != 'map' && $query['view'] != 'info' && $query['view'] != 'comment')
					&& isset($item->query['id']) && $item->query['id'] == $query['id']) {
						$itemid	= $item->id;
				}
			}
I hope I could help somebody with this information and maybe Jan can check the solution.

PS: Thanks at Phoca for this create component!!

Re: Little bug in "router.php"

Posted: 13 Mar 2010, 00:58
by Jan
Hi, thank you for this info, I will do some tests.

Jan