Skip to content

Commit

Permalink
Merge branch 'feature/OP-312-redesign-cms-plugin' into feature/OP-312…
Browse files Browse the repository at this point in the history
…-fixtures-styling
  • Loading branch information
senghe committed Sep 24, 2024
2 parents 773bd15 + 4b028d9 commit 2c31636
Show file tree
Hide file tree
Showing 748 changed files with 6,387 additions and 7,233 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [![](https://bitbag.io/wp-content/uploads/2021/01/CMS.png)](https://bitbag.io/contact-us/?utm_source=github&utm_medium=referral&utm_campaign=plugins_cms)

# BitBag SyliusCMSPlugin
# Sylius CMS Plugin

----

Expand Down Expand Up @@ -30,21 +30,27 @@ Like what we do? Want to join us? Check out our job listings on our [career page

***

Almost every eCommerce app has to present some content. Managing it is often done via third-party libraries like WordPress, eZ Platform, or a built-in content management system. As Sylius does not have a CMS in the standard platform, we decided to develop our own, which will be as flexible as Sylius. This plugin allows you to add dynamic blocks with images, text or HTML to your storefront, as well as pages and FAQs section.
<img align="left" src="https://bitbag.io/wp-content/uploads/2021/01/Sylius-CMS-Plugin-Building-Block-1-1024x1024.png">
Almost every eCommerce app has to present some content. Managing it is often done via third-party libraries like WordPress,
eZ Platform, or a built-in content management system. As Sylius does not have a CMS in the standard platform,
we decided to develop our own, which will be as flexible as Sylius. This plugin allows you to add dynamic blocks and pages
with content elements to your storefront.

- [Use Case](doc/use_case.md)
- [Collections](doc/use_case_collections.md)
- [Templates](doc/use_case_templates.md)
- [Pages](doc/use_case_pages.md)
- [Blocks](doc/use_case_blocks.md)
- [Media](doc/use_case_media.md)
- [Installation](doc/installation.md)
- [Upgrading](UPGRADE.md)
- [Blocks](doc/blocks.md)
- [Collections](doc/collections.md)
- [Templates](doc/templates.md)
- [Pages](doc/pages.md)
- [Sections](doc/sections.md)
- [Blocks](doc/blocks.md)
- [Media](doc/media.md)
- [FAQs](doc/faqs.md)
- [Fixtures](doc/fixtures.md)
- [WYSIWYG](doc/wysiwyg.md)
- [Importing resources](doc/importing-resources.md)
- [Using Twig functions in the admin panel](doc/twig-functions-in-admin.md)
- [Sitemap](doc/sitemap.md)
- [Customization](doc/customization.md)

Expand Down
105 changes: 105 additions & 0 deletions UPGRADE-5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# UPGRADE FROM 4.2 TO 5.0

This upgrade is a major one, as it introduces a new feature - [Content Elements](doc/content_elements.md)
and removes the old way of creating blocks and pages.

* A lot of database modifications has been made. Read the below changelog first and then migrate your structure using
`bin/console doctrine:migrations:diff && bin/console doctrine:migrations:migrate` commands.
* Sections are now Collections, as it was a more suitable name for the feature.
* Pages and Blocks now have `Content elements` segment, where you can add elements to the page or block.
* Removed FAQ, as you can now create a FAQ page with the new content elements.
* Added new `Templates` section where you can create templates for your content elements. Read more about it in [Use case templates](doc/use_case_templates.md)
and [Templates](doc/templates.md) docs.
* Removed CKEditor deprecation modal.
* Reordered forms/elements for functionality consistency.
* Updated import functionality to work with the new structure.
* Updated fixtures to work with the new structure
* Removed `sylius_cms_render_product_pages` twig extension.
* Removed support for rendering twig functions in WYSIWYG editor.
* Added twig extensions:
* `sylius_cms_render_collection`
* `sylius_cms_render_content_elements`

## Briefly about Content Elements

Content elements is a new segment in the block/page form where you can add elements that will be rendered on the store's frontend, like:
* Textarea
* Heading
* Images
* Products carousel
* etc.

> Read more about the content elements in the updated [Content elements](doc/content_elements.md) doc.
## Changes in Collections (old Sections)

### Added fields:

* Type
* Pages/Block/Media (depending on the chosen type)

### Moved fields:

* Name field has been moved from translations to the main settings tab

> Read more about the collections in the updated [Use case collections](doc/use_case_collections.md) and [Collections](doc/collections.md) docs.
## Changes in Pages

### Removed fields:

* Products
* Breadcrumb
* Name when linked
* Description when linked
* Image
* Content
* Title

### Added fields

* Teaser title
* Teaser content
* Teaser image

### Moved fields

* Name field has been moved from translations to the main settings tab

> Read more about the pages in the updated [Use case pages](doc/use_case_pages.md) and [Pages](doc/pages.md) docs.
## Changes in Blocks

### Removed fields:

* Products
* Taxons
* Whole translations tab

### Added fields

* Name
* Locales
* Display for products
* Display for products in taxons
* Display for taxons

> Read more about the blocks in the updated [Use case blocks](doc/use_case_blocks.md) and [Blocks](doc/blocks.md) docs.
## Changes in Media

### Removed fields:

* Products

### Added fields

* Media preview with path

### Moved fields

* Name field has been moved from translations to the main settings tab

### Renamed fields

* Content -> Link content
2 changes: 1 addition & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ structure using `bin/console doctrine:migrations:diff && bin/console doctrine:mi
use raw content in [WYSIWYG editor](doc/wysiwyg.md)
* Chanel awareness has been added to pages, blocks, FAQs, sections and media. That being said, many
repository methods changed their signatures. In case you customized them in your src, check
new signatures in interfaces under [BitBag\SyliusCmsPlugin\Repository](src/Repository) namespace
new signatures in interfaces under [Sylius\CmsPlugin\Repository](src/Repository) namespace
* WYSIWYG editor has been introduced. You will need to import it in your AppKernel and install
its assets. For more, check the [installation guide](doc/installation.md)
* Sitemap support was added, you will need to enable extra bundle in your AppKernel. Read more
Expand Down
2 changes: 1 addition & 1 deletion behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ default:
FriendsOfBehat\SymfonyExtension:
bootstrap: tests/Application/config/bootstrap.php
kernel:
class: Tests\BitBag\SyliusCmsPlugin\Application\Kernel
class: Tests\Sylius\CmsPlugin\Application\Kernel

FriendsOfBehat\VariadicExtension: ~

Expand Down
19 changes: 6 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
"description": "CMS plugin for Sylius applications.",
"license": "MIT",
"require": {
"php": "^8.0",
"php": "^8.1",
"sylius/sylius": "^1.12.0 || ^1.13.0",
"league/csv": "^9.1",
"friendsofsymfony/ckeditor-bundle": "^2.0",
"instaclick/php-webdriver": "^1.4",
"symfony/webpack-encore-bundle": "^1.12"
},
"require-dev": {
Expand All @@ -31,6 +30,7 @@
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"instaclick/php-webdriver": "^1.4",
"lchrusciel/api-test-case": "^4.1 || ^5.0",
"matthiasnoback/symfony-config-test": "^5.1",
"phpspec/phpspec": "^7.2",
Expand All @@ -51,26 +51,19 @@
"symfony/runtime": "^5.4 || ^6.4",
"symfony/web-profiler-bundle": "^5.4 || ^6.4"
},
"conflict": {
"symfony/symfony": "4.1.8",
"symfony/browser-kit": "4.1.8",
"symfony/dom-crawler": "4.1.8",
"symfony/routing": "4.1.8",
"symfony/doctrine-bridge": "4.4.16"
},
"suggest": {
"stefandoorn/sitemap-plugin": "^2.0@alpha"
"stefandoorn/sitemap-plugin": "^2.2"
},
"prefer-stable": true,
"autoload": {
"psr-4": {
"BitBag\\SyliusCmsPlugin\\": "src/",
"Tests\\BitBag\\SyliusCmsPlugin\\": "tests/"
"Sylius\\CmsPlugin\\": "src/",
"Tests\\Sylius\\CmsPlugin\\": "tests/"
}
},
"autoload-dev": {
"psr-4": {
"spec\\BitBag\\SyliusCmsPlugin\\": "spec/"
"spec\\Sylius\\CmsPlugin\\": "spec/"
},
"classmap": ["tests/Application/Kernel.php"]
},
Expand Down
22 changes: 11 additions & 11 deletions doc/01.1-webpack-config.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BitBag SyliusCmsPlugin
# SyliusCmsPlugin

- [⬅️ Back](./installation.md)

Expand All @@ -13,10 +13,10 @@

```js
// webpack.config.js
const [ bitbagCmsShop, bitbagCmsAdmin ] = require('./vendor/bitbag/cms-plugin/webpack.config.js')
const [ cmsShop, cmsAdmin ] = require('./vendor/bitbag/cms-plugin/webpack.config.js')
...

module.exports = [..., bitbagCmsShop, bitbagCmsAdmin];
module.exports = [..., cmsShop, cmsAdmin];
```

2. Add new packages in `./config/packages/assets.yaml`
Expand All @@ -29,9 +29,9 @@ framework:
packages:
# ...
cms_shop:
json_manifest_path: '%kernel.project_dir%/public/build/bitbag/cms/shop/manifest.json'
json_manifest_path: '%kernel.project_dir%/public/build/cms/shop/manifest.json'
cms_admin:
json_manifest_path: '%kernel.project_dir%/public/build/bitbag/cms/admin/manifest.json'
json_manifest_path: '%kernel.project_dir%/public/build/cms/admin/manifest.json'
```
3. Add new build paths in `./config/packages/webpack_encore.yml`
Expand All @@ -42,24 +42,24 @@ framework:
webpack_encore:
builds:
# ...
cms_shop: '%kernel.project_dir%/public/build/bitbag/cms/shop'
cms_admin: '%kernel.project_dir%/public/build/bitbag/cms/admin'
cms_shop: '%kernel.project_dir%/public/build/cms/shop'
cms_admin: '%kernel.project_dir%/public/build/cms/admin'
```

4. Add encore functions to your templates

```twig
{# @SyliusShopBundle/_scripts.html.twig #}
{{ encore_entry_script_tags('bitbag-cms-shop', null, 'cms_shop') }}
{{ encore_entry_script_tags('sylius-cms-shop', null, 'cms_shop') }}
{# @SyliusShopBundle/_styles.html.twig #}
{{ encore_entry_link_tags('bitbag-cms-shop', null, 'cms_shop') }}
{{ encore_entry_link_tags('sylius-cms-shop', null, 'cms_shop') }}
{# @SyliusAdminBundle/_scripts.html.twig #}
{{ encore_entry_script_tags('bitbag-cms-admin', null, 'cms_admin') }}
{{ encore_entry_script_tags('sylius-cms-admin', null, 'cms_admin') }}
{# @SyliusAdminBundle/_styles.html.twig #}
{{ encore_entry_link_tags('bitbag-cms-admin', null, 'cms_admin') }}
{{ encore_entry_link_tags('sylius-cms-admin', null, 'cms_admin') }}
```

5. Run `yarn encore dev` or `yarn encore production`
14 changes: 7 additions & 7 deletions doc/01.2-webpack-entry.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BitBag SyliusCmsPlugin
# SyliusCmsPlugin

- [⬅️ Back](./installation.md)

Expand All @@ -14,26 +14,26 @@
// ./webpack.config.js

// Shop config
.addEntry('bitbag-cms-shop', 'vendor/bitbag/cms-plugin/src/Resources/assets/shop/entry.js')
.addEntry('sylius-cms-shop', 'vendor/bitbag/cms-plugin/src/Resources/assets/shop/entry.js')

// Admin config
.addEntry('bitbag-cms-admin', 'vendor/bitbag/cms-plugin/src/Resources/assets/admin/entry.js')
.addEntry('sylius-cms-admin', 'vendor/bitbag/cms-plugin/src/Resources/assets/admin/entry.js')
```

2. Add encore functions to your templates

```twig
{# @SyliusShopBundle/_scripts.html.twig #}
{{ encore_entry_script_tags('bitbag-cms-shop', null, 'shop') }}
{{ encore_entry_script_tags('sylius-cms-shop', null, 'shop') }}
{# @SyliusShopBundle/_styles.html.twig #}
{{ encore_entry_link_tags('bitbag-cms-shop', null, 'shop') }}
{{ encore_entry_link_tags('sylius-cms-shop', null, 'shop') }}
{# @SyliusAdminBundle/_scripts.html.twig #}
{{ encore_entry_script_tags('bitbag-cms-admin', null, 'admin') }}
{{ encore_entry_script_tags('sylius-cms-admin', null, 'admin') }}
{# @SyliusAdminBundle/_styles.html.twig #}
{{ encore_entry_link_tags('bitbag-cms-admin', null, 'admin') }}
{{ encore_entry_link_tags('sylius-cms-admin', null, 'admin') }}
```

3. Run `yarn encore dev` or `yarn encore production`
2 changes: 1 addition & 1 deletion doc/01.3-import-entry.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BitBag SyliusCmsPlugin
# SyliusCmsPlugin

- [⬅️ Back](./installation.md)

Expand Down
2 changes: 1 addition & 1 deletion doc/01.4-custom-solution.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BitBag SyliusCmsPlugin
# SyliusCmsPlugin

- [⬅️ Back](./installation.md)

Expand Down
10 changes: 5 additions & 5 deletions doc/01.5-non-webpack.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BitBag SyliusCmsPlugin
# SyliusCmsPlugin

- [⬅️ Back](./installation.md)

Expand All @@ -20,21 +20,21 @@ $ bin/console assets:install
```twig
{# @SyliusAdminBundle/_scripts.html.twig #}
{% include '@SyliusUi/_javascripts.html.twig' with {
'path': 'bundles/bitbagsyliuscmsplugin/build/bitbag-cms-admin.js'
'path': 'bundles/SyliusCmsPlugin/build/sylius-cms-admin.js'
} %}
{# @SyliusAdminBundle/_styles.html.twig #}
{% include '@SyliusUi/_stylesheets.html.twig' with {
'path': 'bundles/bitbagsyliuscmsplugin/build/bitbag-cms-admin.css'
'path': 'bundles/SyliusCmsPlugin/build/sylius-cms-admin.css'
} %}
{# @SyliusShopBundle/_scripts.html.twig #}
{% include '@SyliusUi/_javascripts.html.twig' with {
'path': 'bundles/bitbagsyliuscmsplugin/build/bitbag-cms-shop.js'
'path': 'bundles/SyliusCmsPlugin/build/sylius-cms-shop.js'
} %}
{# @SyliusShopBundle/_styles.html.twig #}
{% include '@SyliusUi/_stylesheets.html.twig' with {
'path': 'bundles/bitbagsyliuscmsplugin/build/bitbag-cms-shop.css'
'path': 'bundles/SyliusCmsPlugin/build/sylius-cms-shop.css'
} %}
```
2 changes: 2 additions & 0 deletions doc/block_legacy.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
code,type,name_en_US,content_en_US,sections,channels,products,image_en_US,slug_en_US
test4,image,Test,test,"blog, general",US_WEB,"010ba66b-adee-3d6e-9d63-67c44d686db1, 01d35db9-247d-3834-b300-20483d5e34e8",https://bitbag.shop/assets/web/images/header-logo.png,https://bitbag.shop/assets/web/images/header-logo.png
Loading

0 comments on commit 2c31636

Please sign in to comment.