Skip to content

Commit

Permalink
Merge pull request #169 from BitBagCommerce/2.0
Browse files Browse the repository at this point in the history
2.0.0-rc.1 🎉
  • Loading branch information
bitbager authored Jul 12, 2018
2 parents cf353c8 + 8884836 commit bbc3bb2
Show file tree
Hide file tree
Showing 340 changed files with 23,629 additions and 3,581 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ install:

before_script:
- (cd tests/Application && bin/console doctrine:schema:drop --force --env=test && bin/console doctrine:schema:create --env=test)
- (cd tests/Application && bin/console ckeditor:install --clear=drop)
- (cd tests/Application && bin/console assets:install web --env=test)
- (cd tests/Application && yarn run gulp)

Expand All @@ -40,7 +41,7 @@ before_script:
# Download and configure ChromeDriver
- |
if [ ! -f $SYLIUS_CACHE_DIR/chromedriver ] || [ "$($SYLIUS_CACHE_DIR/chromedriver --version | grep -c 2.34)" = "0" ]; then
curl http://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip > chromedriver.zip
curl http://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip > chromedriver.zip
unzip chromedriver.zip
chmod +x chromedriver
mv chromedriver $SYLIUS_CACHE_DIR
Expand All @@ -52,7 +53,7 @@ before_script:
# Download and configure Selenium
- |
if [ ! -f $SYLIUS_CACHE_DIR/selenium.jar ] || [ "$(java -jar $SYLIUS_CACHE_DIR/selenium.jar --version | grep -c 3.4.0)" = "0" ]; then
curl http://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar > selenium.jar
curl http://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.11.0.jar > selenium.jar
mv selenium.jar $SYLIUS_CACHE_DIR
fi
Expand Down
58 changes: 56 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,30 @@ We also recorded a webinar which presents most of the plugin features, including
$ composer require bitbag/cms-plugin
```

Add plugin dependencies to your AppKernel.php file:
Add plugin dependencies to your AppKernel.php file (note the new compiler pass):
```php
public function registerBundles()
{
return array_merge(parent::registerBundles(), [
...

new \FOS\CKEditorBundle\FOSCKEditorBundle(), // WYSIWYG editor
new \BitBag\SyliusCmsPlugin\BitBagSyliusCmsPlugin(),
]);
}

protected function build(ContainerBuilder $container)
{
...

$container->addCompilerPass(new \BitBag\SyliusCmsPlugin\DependencyInjection\Compiler\ImporterCompilerPass());
}
```

Install WYSIWYG editor ([FOS CKEditor](https://symfony.com/doc/master/bundles/FOSCKEditorBundle/usage/ckeditor.html))

```bash
$ bin/console ckeditor:install
```

Import required config in your `app/config/config.yml` file:
Expand Down Expand Up @@ -89,7 +103,7 @@ $ bin/console assets:install
$ bin/console sylius:theme:assets:install
```

### Optional, Sitemap integration
### Sitemap integration
This plugin has a ready to go integration with [Sylius Sitemap Plugin](https://github.com/stefandoorn/sitemap-plugin).

To enable the integration you need to add the following to your `app/config/config.yml` file:
Expand Down Expand Up @@ -144,6 +158,14 @@ Or rendering a page link directly:
{{ render(path('bitbag_sylius_cms_plugin_shop_page_show', {'slug' : 'about'})) }}
```

### Pages for product grouped by section

You can render page by function Twig:

```twig
{{ bitbag_cms_render_product_pages(product) }}
```

### Sections

With sections, you can organize your blocks and pages under some specific categories.
Expand All @@ -167,6 +189,38 @@ To render FAQs list, use the `bitbag_sylius_cms_plugin_shop_frequently_asked_que
<a href="{{ path('bitbag_sylius_cms_plugin_shop_frequently_asked_question_index') }}">{{ 'app.ui.faqs'|trans }}</a>
```

### Media

You can render media in two ways:

By rendering a media code template:

```twig
{{ bitbag_cms_render_media('media_code') }}
```

Or rendering a media code directly:

```twig
{{ render(path('bitbag_sylius_cms_plugin_shop_media_render', {'code' : 'file', 'template' : '@App/Some/Template/_path.html.twig'})) }}
```

### Media provider

You can add your own media provider by adding a service with a tag named `bitbag_sylius_cms_plugin.media_provider`

```php
app.media_provider.audio:
class: BitBag\SyliusCmsPlugin\MediaProvider\AudioProvider
arguments:
- "@bitbag_sylius_cms_plugin.media_uploader"
- "@templating.engine.twig"
- "@@BitBagSyliusCmsPlugin/Shop/Media/Show/audio.html.twig"
- "media/audio"
tags:
- { name: bitbag_sylius_cms_plugin.media_provider, type: audio, label: bitbag_sylius_cms_plugin.ui.audio_provider }
```

### Fixtures

Sometimes you'll need to set up your environment quickly or even load some primary CMS data on your server. You can take a look at `tests/Application/app/config/fixtures.yml` file to see how you can configure fixtures.
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
"license": "MIT",
"require": {
"php": "^7.1",
"sylius/sylius": "^1.1"

"sylius/sylius": "^1.1",
"league/csv": "^9.0",
"friendsofsymfony/ckeditor-bundle": "^1.1",
"stefandoorn/sitemap-plugin": "^1.0"
},
"require-dev": {
"behat/behat": "^3.3",
Expand All @@ -24,7 +28,6 @@
"phpstan/phpstan-shim": "^0.9.2",
"phpunit/phpunit": "^5.6",
"se/selenium-server-standalone": "^2.52",
"stefandoorn/sitemap-plugin": "^1.0.8",
"symplify/easy-coding-standard": "^2.4",
"sylius-labs/coding-standard": "^1.0",
"matthiasnoback/symfony-config-test": "^2.1.0"
Expand Down
Loading

0 comments on commit bbc3bb2

Please sign in to comment.