Download the PHP package stefandoorn/sylius-seo-url-plugin without Composer
On this page you can find all versions of the php package stefandoorn/sylius-seo-url-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stefandoorn/sylius-seo-url-plugin
More information about stefandoorn/sylius-seo-url-plugin
Files in stefandoorn/sylius-seo-url-plugin
Package sylius-seo-url-plugin
Short Description SEO URLs for Sylius
License MIT
Informations about the package sylius-seo-url-plugin
Sylius SEO URL Plugin
Features
-
Remove
/taxons
from taxon URLs- Before:
https://localhost/en_US/taxons/t-shirts
- After:
https://localhost/en_US/t-shirts
- Before:
-
Remove
/products
from product URLs- Before:
https://localhost/en_US/products/t-shirt-banana
- After:
https://localhost/en_US/t-shirt-banana
- Before:
Combined with disabling localised URLs, URLs can even be shorter.
Installation
-
Require plugin with composer:
-
Add plugin class to your
AppKernel
.or to your
bundles.php
: -
Import routing (to override default shop routing):
Make sure it's imported after (because it overrides default Sylius routes):
You can remove the prefix
/{_locale}
if you prefer url's without the prefix. In this case, the import looks like this: -
Import configuration:
-
Import repository method:
The default
findOneByChannelAndSlug
for products is slow when used in a loop, therefore:-
Use the trait in your own Product Repository & add interface:
- Or use the Product repository as provided, add to your config:
-