Download the PHP package stefandoorn/sitemap-plugin without Composer
On this page you can find all versions of the php package stefandoorn/sitemap-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stefandoorn/sitemap-plugin
More information about stefandoorn/sitemap-plugin
Files in stefandoorn/sitemap-plugin
Package sitemap-plugin
Short Description Sitemap Plugin for Sylius
License MIT
Informations about the package sitemap-plugin
Sylius Sitemap Plugin
Big thanks
Goes out to the Sylius team. The core code of this plugin is created by the Sylius team. Unfortunately it got removed from the Sylius core. Luckily the Sylius team approved the extraction to a separate bundle.
Features
- Creates a sitemap index file to point to sub sitemap files per type of data
- Default providers: taxons, products & static content (homepage & contact)
- Easily add your own providers
- Product provider supports locales (hreflang) & is channel aware
- Taxon provider supports locales (hreflang)
Installation
- Run
composer require stefandoorn/sitemap-plugin
. -
Add to
app/config/bundles.php
: -
Add to
app/config/packages/_sylius.yaml
: -
Add to
app/config/routes.yaml
: -
Add to
app/config/packages/sylius_sitemap.yaml
:- Default configuration
- Forcing HTTPS on Generated URLs, see Symfony Docu. In console commands, where there is no HTTP request, URLs use http by default. You can change this globally with these configuration parameters:
Usage
Generate your sitemap from the CLI:
Add this command to your cronjob to regularly generate a new sitemap, e.g. once a day.
If you only want to generate the sitemap for a specific channel, use:
The plugin defines three default URI's:
sitemap.xml
: redirects tositemap_index.xml
sitemap_index.xml
: renders the sitemap index file (with links to the provider xml files)
Next to this, each provider registeres it's own URI. Take a look in the sitemap index file for the correct URI's.
Default Configuration
Get a full list of configuration: bin/console config:dump-reference sitemap
The request context is also important for generating the URLs inside the sitemap:
- The hostname is defined per channel, if nothing set it defaults to
localhost
- Other request context settings can be adjusted as mentioned in the Symfony docs
Default storage
By default the sitemaps will be saved in %kernel.root_dir%/var/sitemap
. You can change this setting
by adjusting the parameter sylius.sitemap.path
.
Feature switches
providers
: Enable/disable certain providers to be included in the sitemap. Defaults are true.exclude_taxon_root
: Often you don't want to include the root of your taxon tree as it has a generic name as 'products'.hreflang
: Whether to generate alternative URL versions for each locale. Defaults to true. Background: https://support.google.com/webmasters/answer/189077?hl=en.images
: Whether to add images to URL output in case the provider adds them. Defaults to true. Background: https://support.google.com/webmasters/answer/178636?hl=en.
Default providers
- Products
- Taxons
- Static content (homepage & contact)
Add own provider
- Register & tag your provider service with
sylius.sitemap_provider
- Let your provider implement
UrlProviderInterface
- Use one of the default providers as an example to implement code
All versions of sitemap-plugin with dependencies
sylius/sylius Version ~1.9.0 || ~1.10.0 || ~1.11.0 || ~1.12.0 || ~1.13.0