Page 1 of 1

[REQ] Possible system for slugs

Posted: 17 Sep 2015, 13:16
by Yvler
Is there already a system for using slugs in stead of passing the values in the request parameter of the url?
It would be more interesting for SEO to use
"/category/cat-2" in stead of "/list?f_name=cat-2&f_catid=4562"

Re: [REQ] Possible system for slugs

Posted: 17 Sep 2015, 13:29
by aimeos
In theory yes, but the routing implementation of Laravel 4/5 is buggy and optional parameters cause routes to fail:
https://github.com/laravel/framework/pull/8198

You can only try to work around this by creating a separate page and route that are used when a category is shown and the "f_name" and "f_catid" parameter are mandatory.

Re: [REQ] Possible system for slugs

Posted: 22 Sep 2015, 07:37
by Yvler
That was our backup plan ;-) and we'd probably create another table where a slug is saved and where this slug is linked to these parameters :)
not the best way to do it, but I don't see a better solution at this time

Re: [REQ] Possible system for slugs

Posted: 22 Sep 2015, 08:31
by aimeos
Yvler wrote:That was our backup plan ;-) and we'd probably create another table where a slug is saved and where this slug is linked to these parameters :)
You don't need another table. The mshop_catalog and thus the catalog items contains all you need, including the possibility to define URL segments (a.k.a. slugs) as associated texts.

Re: [REQ] Possible system for slugs

Posted: 24 Nov 2015, 23:31
by swpierce
Apologies for digging up an old thread, but anyone know if the referenced URL generator bug is fixed in Laravel 5.1? I'm guessing not looking at the laravel repository but I could be missing it too ;)

Re: [REQ] Possible system for slugs

Posted: 25 Nov 2015, 11:18
by aimeos
I'm not aware of that. The buggy behavior is immanent in the router implementation and Tylor had no idea how to fix that without breaking the rest.