URL patten problem

Phoca Gallery - image gallery extension
asmol
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 27 Sep 2020, 13:11

URL patten problem

Post by asmol »

Hello!
By creating a hidden menu, I got a link with the following content http://club.crematorium.ru/photo/jagger ... 08-12-16-1 How can I achieve that was only this link in the url? http://club.crematorium.ru/photo/jagger-08-12-16

Thanks,
Andrey Smolyaninov.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: URL patten problem

Post by Jan »

Hi, you can create a menu link directly to the category - then it gets only menu link alias.

Jan
If you find Phoca extensions useful, please support the project
asmol
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 27 Sep 2020, 13:11

Re: URL patten problem

Post by asmol »

Hey Jan! Thanks for the answer. But the problem is that when I make a direct link, the category id appears in my url ... And I want it not to be. Is this a bug on my side or yours? That is. I want to have a list of categories first, and then there will be a category, but without an id. Is that possible?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: URL patten problem

Post by Jan »

Hi, it depends on the way the menu links are created.

If there is a categories view and there is a menu link to categories view, then you need to differentiate between each category in category view with ID.

If ther eis no categories view, you can create a menu link to each category and then all menu links to each category will have only alias set by menu link.

There is a lot of different combinations possible. Another way is to rewrite the router so instead of ID the category will be recognized by alias. But this way just slow down your website as working with ID is the simlest and fastest way to get the page.

Another question is why you want to change the URLs when in fact URL is hidden by most browsers and it has no effect on loading of the page. When we are talking about SEO, it is better to use IDs because the website is loaded faster so it is better for SEO. :idea:

Jan
If you find Phoca extensions useful, please support the project
asmol
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 27 Sep 2020, 13:11

Re: URL patten problem

Post by asmol »

Hi Jan!
Well, since rewrite website url slows down the system, we won't do it. Moreover, my boss says that it is not so critical. ;) I'm just a rather pedantic person and I love order in everything. ) Well, yes, if you have a minute of free time, you will make new features in the new versions of the gallery that allow you to remove the id. But again, this is not critical. ;) Thank you for your help and patience, as well as support. And sorry for the mistake in the subject of topic - ya est ne ochen karasho govorit' po-Angliisky. ;)
User avatar
b2z
Phoca Enthusiast
Phoca Enthusiast
Posts: 52
Joined: 09 Dec 2016, 13:52

Re: URL patten problem

Post by b2z »

Hello Jan.

I consider this as a bug. When you have a menu item to specific category you cannot have another route to it.

As an example on this site:
1. http://club.crematorium.ru/photo - route for a menu item for the list of categories.
2. http://club.crematorium.ru/jagger-08-12-16 - route for a menu item for specific category with ID 92 (menu item alias: jagger-08-12-16).
3. http://club.crematorium.ru/jagger-08-12 ... r-08-12-16 - route for the same category with ID 92, but when you access it from the list of categories.

So in case 3 the component adds "category/92-jagger-08-12-16" to menu item "jagger-08-12-16". That is for sure considered as incorrect route.

Best regards,
Dmitry
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: URL patten problem

Post by Jan »

Hi, thank you for the info.

It looks like there was some change in Joomla!

Because the flow in Phoca Gallery is: First try to find the menu link to category then if not found the menu link to categories. This is still valid and works. Then when the category menu link was found, just use the menu link alias and display the menu alias link. Which does not work now.

I will try to do more tests. For now I cannot find it as Phoca Gallery justs sends to Joomla! the menu link with Itemid without any other part in the URL, :idea:

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: URL patten problem

Post by Jan »

BTW you can test to comment the line 67 in: components/com_phocagallery/router.php on line cca 67

FROM:

Code: Select all

&& isset($item->query['catid']) && isset($query['catid']) && $item->query['catid'] == $query['catid']) {
TO:

Code: Select all

/*&& isset($item->query['catid']) && isset($query['catid']) && $item->query['catid'] == $query['catid']*/) {
Then it should work (but it can have negative effect on detail view if used in iframe method)

The problem of routing is, there are always some side effects :-(

Jan
If you find Phoca extensions useful, please support the project
asmol
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 27 Sep 2020, 13:11

Re: URL patten problem

Post by asmol »

Jan, thank you very much for the advice. I will try to apply those lines that you advised when I have a minute (laughing) free time. ;)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: URL patten problem

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply