Hailong / sitemap-plugin

Sitemap Plugin for Sylius eCommerce platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sylius Sitemap Bundle License Version Build status on Linux Scrutinizer Quality Score Code Coverage

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

  1. Run composer require stefandoorn/sitemap-plugin.
  2. Add to app/AppKernel.php:
  new SitemapPlugin\SitemapPlugin(),
  1. Add to app/config/config.yml:
  - { resource: "@SitemapPlugin/Resources/config/config.yml" }
  1. Add to app/config/routing.yml:
sylius_sitemap:
     resource: "@SitemapPlugin/Resources/config/routing.yml"

Default configuration

Get a full list of configuration: bin/console config:dump-reference sitemap

sitemap:
    template:             '@SitemapPlugin/show.xml.twig'
    index_template:       '@SitemapPlugin/index.xml.twig'
    exclude_taxon_root:   true
    absolute_url:         true
    hreflang:             true
    static_routes:
        - { route: sylius_shop_homepage, parameters: [], locales: [] }
        - { route: sylius_shop_contact_request, parameters: [], locales: [] }

Feature switches

  • exclude_taxon_root: Often you don't want to include the root of your taxon tree as it has a generic name as 'products'.
  • absolute_url: Whether to generate absolute URL's (true) or relative (false). Defaults to true.
  • hreflang: Whether to generate alternative URL versions for each locale. Defaults to true. Background: https://support.google.com/webmasters/answer/189077?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

About

Sitemap Plugin for Sylius eCommerce platform

License:MIT License


Languages

Language:PHP 97.5%Language:HTML 2.5%