Custom URLs for categories and products

Help for integrating the Laravel package
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!
SYPOMark
Posts: 1
Joined: 13 Dec 2018, 15:48

Custom URLs for categories and products

Post by SYPOMark » 13 Dec 2018, 16:01

Hi there,

I hope that you can help.

I've just installed Aimeos on a test domain to try it out, and so far it looks good.

Apologies if this is a bit of a noob question, but I am wondering how to make use of the URL target field when creating a new category so that the URL for that category becomes http://www.example.com/list/<category-name>

Currently it stands as http://www.example.com/list?f_name=Dresses&f_catid=2.

Any help you can provide with this would be most appreciated.

With kind regards,

Mark
Aimeos version: ~2018.10. PHP version: 7.2 Laravel version: 5.7

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

Re: Custom URLs for categories and products

Post by aimeos » 13 Dec 2018, 23:23

That's due to buggy routing in Laravel, in all other frameworks it's "list/1/Home".

You can add a new named route to ./routes/web.php file and add that name (here: aimeos_shop_catalog) in the category target field, e.g.

Code: Select all

	Route::match( array( 'GET', 'POST' ), 'list/{f_name}/{f_catid}', array(
		'as' => 'aimeos_shop_catalog',
		'uses' => '\Aimeos\Shop\Controller\CatalogController@listAction'
	));
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply