odiseoteam/sylius-blog-plugin

This plugin add blog capabilities to your Sylius project

Installs: 89

Dependents: 0

Suggesters: 0

Stars: 7

Watchers: 2

Forks: 3

Open Issues: 0

Type:sylius-plugin


README

68747470733a2f2f73796c6975732e636f6d2f6173736574732f62616467652d617070726f7665642d62792d73796c6975732e706e67

Description

This plugin add blog features to the Sylius ecommerce framework. It uses the OdiseoBlogBundle Symfony bundle.

Now supporting Sylius 1.4 with Symfony 4 + Flex structure.

Blog admin

Blog admin

Demo

You can see this plugin in action in our Sylius Demo application.

Installation

  1. Run composer require odiseoteam/sylius-blog-plugin

  2. Enable the plugin in bundles.php

<?php

return [
    // ...
    Odiseo\BlogBundle\OdiseoBlogBundle::class => ['all' => true],
    FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
    Odiseo\SyliusBlogPlugin\OdiseoSyliusBlogPlugin::class => ['all' => true],
    // ...
];
  1. Import the plugin configurations
imports:
    - { resource: "@OdiseoSyliusBlogPlugin/Resources/config/config.yml" }
  1. Add the shop and admin routes
odiseo_sylius_blog_admin:
    resource: "@OdiseoSyliusBlogPlugin/Resources/config/routing/admin.yml"
    prefix: /admin
    
odiseo_sylius_blog_shop:
    resource: "@OdiseoSyliusBlogPlugin/Resources/config/routing/shop.yml"
    prefix: /{_locale}/blog
    requirements:
        _locale: ^[a-z]{2}(?:_[A-Z]{2})?$
  1. Because this plugin uses FOSCKeditorBundle you need to execute the following commands according to the bundle installation
php bin/console ckeditor:install
php bin/console assets:install public
  1. Finish the installation updating the database schema and installing assets
php bin/console doctrine:schema:update --force
php bin/console sylius:theme:assets:install

Usage

For the administration you will have the Blog menu. And for the frontend you can go to the /{locale}/blog to see the blog articles. Feel free to modify the plugin templates like you want.

Partial routes

To render a list of latest articles you can do something like this:

{{ render(url('odiseo_sylius_blog_shop_partial_article_index_latest', {'count': 4, 'template': '@OdiseoSyliusBlogPlugin/Shop/Article/_latest.html.twig'})) }}

And to render a list of categories:

{{ render(url('odiseo_sylius_blog_shop_partial_article_category_index', {'template': '@OdiseoSyliusBlogPlugin/Shop/ArticleCategory/_verticalMenu.html.twig'})) }}

Test the plugin

You can follow the instructions to test this plugins in the proper documentation page: Test the plugin.

Credits

This plugin is maintained by Odiseo. Want us to help you with this plugin or any Sylius project? Contact us on team@odiseo.com.ar.