SEF URLs in views for items corresponding with menu

Phoca Gallery - image gallery extension
Roues
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 03 Sep 2011, 08:09

SEF URLs in views for items corresponding with menu

Post by Roues »

I have menu items for PG 3.0.2 subcategories, like:

index.php?option=com_phocagallery&view=category&id=1
index.php?option=com_phocagallery&view=category&id=2

and DISPLAY_SUBCATEGORIES_ON_PAGE enabled for all pages.

But \components\com_phocagallery\views\category\view.html.php
for subcategories generated links like:

/current-menualias/category/1-subcat1-pgalias
/current-menualias/category/2-subcat2-pgalias

although must do so like:
/current-menualias/pgsubcat1-menualias
/current-menualias/pgsubcat2-menualias

I found that $items[$iS]->link variable in view.html.php
comes from \components\com_phocagallery\router.php incorrectly.

I just replaced line 66 in router.php

Code: Select all

&& isset($item->query['catid']) && isset($query['catid']) && $item->query['catid'] == $query['catid']) {
						$itemid	= $item->id;
with:

Code: Select all

&& isset($item->query['id']) && isset($query['id']) && $item->query['id'] == $query['id']) {
						$itemid	= $item->id;
and now SEF URLs for PG SubCategories with menu items are fine
(w/o id and alias is taken from the menu).

My question to developers:
please, help me, this hack - is it correct way or wrong,
and there will be any problems on the site?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49160
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: SEF URLs in views for items corresponding with menu

Post by Jan »

Hi, it is difficult to say if this is wrong or right. On some servers there were problem to recognize if the id is an id of category or image, so for this, the alias "category" or "file" was added to be sure, in such view the id is id what we are expecting.

If this is working for you and you have no problems to e.g. load detail of image then no problem with using this.
If you find Phoca extensions useful, please support the project
Post Reply