Want To Change Category Url

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
awaidqureshi
Posts: 86
Joined: 12 Jan 2019, 15:17

Want To Change Category Url

Post by awaidqureshi » 14 Jan 2020, 14:36

Default category url is http://......com/catgegoryname~categoryid

want to change it to only category name means
http://......com/catgegoryname

Please guide how can i do that

Thanks

User avatar
aimeos
Administrator
Posts: 4125
Joined: 01 Jan 1970, 00:00

Re: Want To Change Category Url

Post by aimeos » 14 Jan 2020, 15:02

That will be difficult because the category name must be unique then and this is only rarely the case. Furthermore, things get more complicated if category names should translated into several languages.

For products, we've added a resolve() method to the product frontend controller that is used in the HTML client and which finds the product by its name:
https://github.com/aimeos/ai-controller ... #L294-L310
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

awaidqureshi
Posts: 86
Joined: 12 Jan 2019, 15:17

Re: Want To Change Category Url

Post by awaidqureshi » 20 Jan 2020, 10:18

aimeos wrote:
14 Jan 2020, 15:02
That will be difficult because the category name must be unique then and this is only rarely the case. Furthermore, things get more complicated if category names should translated into several languages.

For products, we've added a resolve() method to the product frontend controller that is used in the HTML client and which finds the product by its name:
https://github.com/aimeos/ai-controller ... #L294-L310
Can i replace this "~" with forward slash if yes then where i have to do the changes

User avatar
aimeos
Administrator
Posts: 4125
Joined: 01 Jan 1970, 00:00

Re: Want To Change Category Url

Post by aimeos » 21 Jan 2020, 09:49

Only if you change the product detail routes too because they already use a "/" for separating name and id and/or pos. Otherwise, the Laravel router won't be able to distingish which route to use.

You can add a prefix like /category_name/c/123 to make routes unique.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply