How to remove the category id from the routes and keep only the category url segment?
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
How to remove the category id from the routes and keep only the category url segment?
Laravel framework version: 9.26.1
Aimeos Laravel version: * 2022.07.2
PHP Version: 8.1.9
Environment: Linux
My category links are like this in the main menu:
/category~{id}
How can I make them only:
/category
Aimeos Laravel version: * 2022.07.2
PHP Version: 8.1.9
Environment: Linux
My category links are like this in the main menu:
/category~{id}
How can I make them only:
/category
Re: How to remove the category id from the routes and keep only the category url segment?
That's tricky because the Aimeos code expects the category ID at several places and also in the Laravel routes. You would have to change the routing in aimeos-laravel, the code for resolving the path in the catalog frontend controller and removing the category ID in the templates. Furthermore, you have to make sure the all category paths are unique and keep care about site and locale handling too.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: How to remove the category id from the routes and keep only the category url segment?
I just checked several Laravel websites from Aimeos Showcases (https://aimeos.org/showcases). I found no showcase with the character '~' in the category URL. Also, I'm 99% sure my client will ask me to remove it too. So... probably it would be a very good idea to simplify the process of removing this character, perhaps through configuration.That's tricky because...
Okay, if not removing it entirely, at least changing "~" to something like "/"? Just to avoid alarming the SEO experts.
Re: How to remove the category id from the routes and keep only the category url segment?
Using "/" as separator would conflict with the catalog home and/or catalog detail route:
https://github.com/aimeos/aimeos-larave ... #L259-L262
Then, you will have to use a prefix like "c/" for the aimeos_shop_tree route. The current routing is optimized for short top level URL because "~" as separator is nothing that affects SEO. Nevertheless, you can adapt it to whatever you prefer. Only "/category_name" will not work at all because that routes are reserved for the product detail pages (for SEO reasons).
https://github.com/aimeos/aimeos-larave ... #L259-L262
Then, you will have to use a prefix like "c/" for the aimeos_shop_tree route. The current routing is optimized for short top level URL because "~" as separator is nothing that affects SEO. Nevertheless, you can adapt it to whatever you prefer. Only "/category_name" will not work at all because that routes are reserved for the product detail pages (for SEO reasons).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star