Skip to content

Loocos/SyliusSeoPagePlugin

 
 

Repository files navigation

Seo page plugin for Sylius

Installation

$ composer require ipanema/sylius-seo-page-plugin

Add plugin dependencies to your config/bundles.php file:

return [
    ...

    Ipanema\SyliusSeoPagePlugin\IpanemaSyliusSeoPagePlugin::class => ['all' => true],
];

Import required config in your config/packages/_sylius.yaml file:

# config/packages/_sylius.yaml

imports:
    ...
    
    - { resource: "@IpanemaSyliusSeoPagePlugin/Resources/config/config.yml" }

Create routing file ipanema_seo_page.yaml in your config/routes file:

# config/routes/ipanema_seo_page.yaml
...

ipanema_sylius_seo_page_plugin:
  resource: "@IpanemaSyliusSeoPagePlugin/Resources/config/routing.yml"

Finish the installation by updating the database schema and installing assets:

$ bin/console doctrine:migrations:diff
$ bin/console doctrine:migrations:migrate or php bin/console doctrine:schema:update --force

Use of Twig Extension

Create at first {% block metatags %}{% endblock %} in your layout.html.twig if not exist. Extension seo_page render html by default

{% block metatags %}
    {# by code #}
    {{ seo_page({'code': 'home'}) }}
    {# by route #}
    {{ seo_page({'route': app.request.get('_route')}) }}
    {# get only data record #}
    {{ seo_page({'route': app.request.get('_route'), 'data-only': true}) }}
    {# merge current data with default seo record (search by code ex: default) #}
    {{ seo_page({'route': app.request.get('_route')}, 'default': 'default') }}
{% endblock %}

About

Seo plugin for Sylius

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 89.3%
  • JavaScript 4.5%
  • Twig 4.1%
  • Shell 2.1%