Page 1 of 1
"Ugly" url, SEF is enabled...
Posted: 11 Dec 2014, 14:36
by gjhvs
Hi!
Working on my new site and ofcourse using Phoca Gallery again.
I have created a menu link to the gallery and it looks like this (ignore 109.73.233.142/~madonna8/, it is in development):
109.73.233.142/~madonna8/?Itemid=205
I want the link to be this >>>
109.73.233.142/~madonna8/madonna/foto-album
I have enabled SEF URLS in Joomla... but Phoca Gallery makes "strange/ugly", like this for a category:
109.73.233.142/~madonna8/component/phocagallery/category/1-madonnaned
This one needs to be: 109.73.233.142/~madonna8/madonna/foto-album/madonnaned
How do I make this so the Phoca Gallery have SEF urls?!
Re: "Ugly" url, SEF is enabled...
Posted: 12 Dec 2014, 13:24
by Jan
Hi, which Phoca Gallery version you are running? Are you using the standard SEF? Phoca Gallery does not create menu links nor SEF links, their are created by Joomla! JRoute method. Mostly, such link which is wrong for you is displayed, when the menu link somehow does not work
See:
https://www.phoca.cz/joomla3demo/category/6-cities
Phoca Gallery gets standard SEF links by Joomla!

Re: "Ugly" url, SEF is enabled...
Posted: 12 Dec 2014, 15:41
by gjhvs
Hi Jan,
Thanks for your answer.
I deleted the component completely, installed again and made a new menu item.
Now it is working, see here 109.73.233.142/~madonna8/madonna/foto-album
One question: if you hit FILMS on this page the link made is this: 109.73.233.142/~madonna8/madonna/foto-album/category/5-films
I would like the word 'category' gone so the URL is 109.73.233.142/~madonna8/madonna/foto-album/5-films
Is that possible?
Re: "Ugly" url, SEF is enabled...
Posted: 16 Dec 2014, 00:42
by Jan
Re: "Ugly" url, SEF is enabled...
Posted: 08 Jan 2015, 14:21
by filipetorres
Hi Jan,
I'm using an old Joomla 1.5.26 website with Phoca Gallery 2.8.1 and I have the same problem:
remove word 'category' from URL.
The website shows this URL:
http://www.dbchampions.com.br/fotos/category/48-2014 and I need to change to:
http://www.dbchampions.com.br/fotos/48-2014
I try to follow the third tip (
3. Changing word "category" to other word in URL (SEF link) of Phoca Gallery (or other Phoca extension)) from tutorial mentioned by you in
https://www.phoca.cz/documents/2-phoca-g ... t/511-tips, but with no success.
I changed two methods of the
components/com_phocagallery/router.php file:
method
PhocaGalleryBuildRoute from:
Code: Select all
if (!empty($segments)) {
foreach ($segments as $k => $v) {
if ($v == 'category') {
$segments[$k] = 'Kategorie';
}
}
}
to:
Code: Select all
if (!empty($segments)) {
foreach ($segments as $k => $v) {
if ($v == 'category') {
$segments[$k] = '';
}
}
}
method
PhocaGalleryParseRoute from:
to:
Unfornately, Joomla returns "404 - Category is not published" error.
It seems that this tip works only to change the word 'category', but not to remove it.
How to
remove word 'category' from URL?
Thanks in advance.
Re: "Ugly" url, SEF is enabled...
Posted: 12 Jan 2015, 02:14
by Jan
Hi, there needs to be some word, it cannot be empty as the SEF needs to discover which ID is used (if id of category or if id of image) So every view manage it other way - if you get ID in categories view, it is an ID of category, if you get ID in category view, it is an ID of image and to make it working you need to have some string to detect in which view we are now.
http://www.dbchampions.com.br/fotos/48-2014
the "fotos" is an alias, but SEF system cannot now, if this alias is an alias of category or or image
Jan