From 7a05e3e5d839dcf3401fd8372b5b5c22b8e4e359 Mon Sep 17 00:00:00 2001
From: jkindly
Date: Wed, 7 Aug 2024 14:56:19 +0200
Subject: [PATCH] OP-344: init
---
src/Fixture/BlockFixture.php | 35 ++-
src/Fixture/CollectionFixture.php | 10 +-
src/Fixture/Factory/BlockFixtureFactory.php | 34 ++-
.../Factory/CollectionFixtureFactory.php | 13 +
src/Fixture/Factory/MediaFixtureFactory.php | 8 +-
src/Fixture/Factory/PageFixtureFactory.php | 28 +-
.../Factory/TemplateFixtureFactory.php | 51 ++++
src/Fixture/MediaFixture.php | 2 -
src/Fixture/PageFixture.php | 44 ++-
src/Fixture/TemplateFixture.php | 56 ++++
src/Resources/config/services/fixture.xml | 15 ++
src/Resources/views/Shop/Block/show.html.twig | 1 +
.../views/Shop/Media/Show/image.html.twig | 12 +-
src/Twig/Runtime/RenderBlockRuntime.php | 3 +-
.../Resources/fixtures/homepage_logo.png | Bin 0 -> 20968 bytes
.../packages/bitbag_sylius_cms_plugin.yaml | 250 ++++++++++++------
.../SyliusShopBundle/Homepage/index.html.twig | 47 +---
.../bundles/SyliusShopBundle/layout.html.twig | 8 +-
18 files changed, 437 insertions(+), 180 deletions(-)
create mode 100755 src/Fixture/Factory/TemplateFixtureFactory.php
create mode 100755 src/Fixture/TemplateFixture.php
create mode 100644 tests/Application/Resources/fixtures/homepage_logo.png
diff --git a/src/Fixture/BlockFixture.php b/src/Fixture/BlockFixture.php
index 2613dcdf8..d26ad4019 100755
--- a/src/Fixture/BlockFixture.php
+++ b/src/Fixture/BlockFixture.php
@@ -38,11 +38,42 @@ protected function configureOptionsNode(ArrayNodeDefinition $optionsNode): void
->arrayPrototype()
->children()
->booleanNode('remove_existing')->defaultTrue()->end()
- ->integerNode('number')->defaultNull()->end()
- ->booleanNode('last_four_products')->defaultFalse()->end()
+ ->scalarNode('name')->end()
->booleanNode('enabled')->defaultTrue()->end()
->arrayNode('collections')->scalarPrototype()->end()->end()
->arrayNode('channels')->scalarPrototype()->end()->end()
+ ->arrayNode('locales')->scalarPrototype()->end()->end()
+ ->arrayNode('products')->scalarPrototype()->end()->end()
+ ->arrayNode('taxons')->scalarPrototype()->end()->end()
+ ->arrayNode('products_in_taxons')->scalarPrototype()->end()->end()
+ ->arrayNode('content_elements')
+ ->prototype('array')
+ ->children()
+ ->scalarNode('heading_type')->end()
+ ->scalarNode('heading')->end()
+ ->scalarNode('textarea')->end()
+ ->scalarNode('single_media')->end()
+ ->scalarNode('products_carousel_by_taxon')->end()
+ ->scalarNode('products_grid_by_taxon')->end()
+ ->arrayNode('multiple_media')->scalarPrototype()->end()->end()
+ ->arrayNode('products_grid')
+ ->children()
+ ->arrayNode('products')->scalarPrototype()->end()->end()
+ ->end()
+ ->end()
+ ->arrayNode('products_carousel')
+ ->children()
+ ->arrayNode('products')->scalarPrototype()->end()->end()
+ ->end()
+ ->end()
+ ->arrayNode('taxons_list')
+ ->children()
+ ->arrayNode('taxons')->scalarPrototype()->end()->end()
+ ->end()
+ ->end()
+ ->end()
+ ->end()
+ ->end()
->end()
->end()
->end()
diff --git a/src/Fixture/CollectionFixture.php b/src/Fixture/CollectionFixture.php
index ee07390de..88f963f27 100755
--- a/src/Fixture/CollectionFixture.php
+++ b/src/Fixture/CollectionFixture.php
@@ -38,13 +38,9 @@ protected function configureOptionsNode(ArrayNodeDefinition $optionsNode): void
->arrayPrototype()
->children()
->booleanNode('remove_existing')->defaultTrue()->end()
- ->arrayNode('translations')
- ->prototype('array')
- ->children()
- ->scalarNode('name')->defaultNull()->end()
- ->end()
- ->end()
- ->end()
+ ->node('name', 'scalar')->end()
+ ->node('type', 'scalar')->end()
+ ->arrayNode('page_codes')->scalarPrototype()->end()
->end()
->end()
->end()
diff --git a/src/Fixture/Factory/BlockFixtureFactory.php b/src/Fixture/Factory/BlockFixtureFactory.php
index 157bf2627..d15a413ab 100755
--- a/src/Fixture/Factory/BlockFixtureFactory.php
+++ b/src/Fixture/Factory/BlockFixtureFactory.php
@@ -12,7 +12,12 @@
use BitBag\SyliusCmsPlugin\Assigner\ChannelsAssignerInterface;
use BitBag\SyliusCmsPlugin\Assigner\CollectionsAssignerInterface;
+use BitBag\SyliusCmsPlugin\Assigner\LocalesAssignerInterface;
+use BitBag\SyliusCmsPlugin\Assigner\ProductsAssignerInterface;
+use BitBag\SyliusCmsPlugin\Assigner\ProductsInTaxonsAssignerInterface;
+use BitBag\SyliusCmsPlugin\Assigner\TaxonsAssignerInterface;
use BitBag\SyliusCmsPlugin\Entity\BlockInterface;
+use BitBag\SyliusCmsPlugin\Entity\ContentConfiguration;
use BitBag\SyliusCmsPlugin\Repository\BlockRepositoryInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
@@ -23,6 +28,10 @@ public function __construct(
private BlockRepositoryInterface $blockRepository,
private CollectionsAssignerInterface $collectionsAssigner,
private ChannelsAssignerInterface $channelAssigner,
+ private LocalesAssignerInterface $localesAssigner,
+ private ProductsAssignerInterface $productsAssigner,
+ private TaxonsAssignerInterface $taxonsAssigner,
+ private ProductsInTaxonsAssignerInterface $productsInTaxonsAssigner,
) {
}
@@ -38,13 +47,7 @@ public function load(array $data): void
$this->blockRepository->remove($block);
}
- if (null !== $fields['number']) {
- for ($i = 0; $i < $fields['number']; ++$i) {
- $this->createBlock(md5(uniqid()), $fields);
- }
- } else {
- $this->createBlock($code, $fields);
- }
+ $this->createBlock($code, $fields);
}
}
@@ -53,11 +56,24 @@ private function createBlock(string $code, array $blockData): void
/** @var BlockInterface $block */
$block = $this->blockFactory->createNew();
+ $block->setCode($code);
+ $block->setName($blockData['name']);
+ $block->setEnabled($blockData['enabled']);
+
$this->collectionsAssigner->assign($block, $blockData['collections']);
$this->channelAssigner->assign($block, $blockData['channels']);
+ $this->localesAssigner->assign($block, $blockData['locales']);
+ $this->productsAssigner->assign($block, $blockData['products']);
+ $this->taxonsAssigner->assign($block, $blockData['taxons']);
+ $this->productsInTaxonsAssigner->assign($block, $blockData['products_in_taxons']);
- $block->setCode($code);
- $block->setEnabled($blockData['enabled']);
+ foreach ($blockData['content_elements'] as $type => $data) {
+ $contentConfiguration = new ContentConfiguration();
+ $contentConfiguration->setType($type);
+ $contentConfiguration->setConfiguration($data);
+ $contentConfiguration->setBlock($block);
+ $block->addContentElement($contentConfiguration);
+ }
$this->blockRepository->add($block);
}
diff --git a/src/Fixture/Factory/CollectionFixtureFactory.php b/src/Fixture/Factory/CollectionFixtureFactory.php
index 18f1165fa..658bc38b1 100755
--- a/src/Fixture/Factory/CollectionFixtureFactory.php
+++ b/src/Fixture/Factory/CollectionFixtureFactory.php
@@ -11,7 +11,9 @@
namespace BitBag\SyliusCmsPlugin\Fixture\Factory;
use BitBag\SyliusCmsPlugin\Entity\CollectionInterface;
+use BitBag\SyliusCmsPlugin\Entity\PageInterface;
use BitBag\SyliusCmsPlugin\Repository\CollectionRepositoryInterface;
+use BitBag\SyliusCmsPlugin\Repository\PageRepositoryInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
final class CollectionFixtureFactory implements FixtureFactoryInterface
@@ -19,6 +21,7 @@ final class CollectionFixtureFactory implements FixtureFactoryInterface
public function __construct(
private FactoryInterface $collectionFactory,
private CollectionRepositoryInterface $collectionRepository,
+ private PageRepositoryInterface $pageRepository,
) {
}
@@ -37,6 +40,16 @@ public function load(array $data): void
/** @var CollectionInterface $collection */
$collection = $this->collectionFactory->createNew();
$collection->setCode($code);
+ $collection->setName($fields['name']);
+ $collection->setType($fields['type']);
+
+ foreach ($fields['page_codes'] as $pageCode) {
+ /** @var PageInterface $page */
+ $page = $this->pageRepository->findOneBy(['code' => $pageCode]);
+ if ($page) {
+ $collection->addPage($page);
+ }
+ }
$this->collectionRepository->add($collection);
}
diff --git a/src/Fixture/Factory/MediaFixtureFactory.php b/src/Fixture/Factory/MediaFixtureFactory.php
index 01ca4e58e..58f889d82 100644
--- a/src/Fixture/Factory/MediaFixtureFactory.php
+++ b/src/Fixture/Factory/MediaFixtureFactory.php
@@ -43,13 +43,7 @@ public function load(array $data): void
$this->mediaRepository->remove($media);
}
- if (null !== $fields['number']) {
- for ($i = 0; $i < $fields['number']; ++$i) {
- $this->createMedia(md5(uniqid()), $fields);
- }
- } else {
- $this->createMedia($code, $fields);
- }
+ $this->createMedia($code, $fields);
}
}
diff --git a/src/Fixture/Factory/PageFixtureFactory.php b/src/Fixture/Factory/PageFixtureFactory.php
index b874fcb06..f31376891 100755
--- a/src/Fixture/Factory/PageFixtureFactory.php
+++ b/src/Fixture/Factory/PageFixtureFactory.php
@@ -12,6 +12,7 @@
use BitBag\SyliusCmsPlugin\Assigner\ChannelsAssignerInterface;
use BitBag\SyliusCmsPlugin\Assigner\CollectionsAssignerInterface;
+use BitBag\SyliusCmsPlugin\Entity\ContentConfiguration;
use BitBag\SyliusCmsPlugin\Entity\PageInterface;
use BitBag\SyliusCmsPlugin\Entity\PageTranslationInterface;
use BitBag\SyliusCmsPlugin\Repository\PageRepositoryInterface;
@@ -42,42 +43,45 @@ public function load(array $data): void
$this->pageRepository->remove($page);
}
- if (null !== $fields['number']) {
- for ($i = 0; $i < $fields['number']; ++$i) {
- $this->createPage(md5(uniqid()), $fields, true);
- }
- } else {
- $this->createPage($code, $fields);
- }
+ $this->createPage($code, $fields);
}
}
private function createPage(
string $code,
array $pageData,
- bool $generateSlug = false,
): void {
/** @var PageInterface $page */
$page = $this->pageFactory->createNew();
- $channelsCodes = $pageData['channels'];
+
$this->collectionsAssigner->assign($page, $pageData['collections']);
- $this->channelAssigner->assign($page, $channelsCodes);
+ $this->channelAssigner->assign($page, $pageData['channels']);
$page->setCode($code);
+ $page->setName($pageData['name']);
$page->setEnabled($pageData['enabled']);
foreach ($pageData['translations'] as $localeCode => $translation) {
/** @var PageTranslationInterface $pageTranslation */
$pageTranslation = $this->pageTranslationFactory->createNew();
- $slug = true === $generateSlug ? md5(uniqid()) : $translation['slug'];
+ $slug = $translation['slug'] ?? md5(uniqid('', true));
$pageTranslation->setLocale($localeCode);
$pageTranslation->setSlug($slug);
+ $pageTranslation->setTitle($translation['meta_title']);
$pageTranslation->setMetaKeywords($translation['meta_keywords']);
$pageTranslation->setMetaDescription($translation['meta_description']);
$page->addTranslation($pageTranslation);
- $page->setName($translation['name']);
+ }
+
+ foreach ($pageData['content_elements'] as $data) {
+ dd($data);
+ $contentConfiguration = new ContentConfiguration();
+ $contentConfiguration->setType($data['type']);
+ $contentConfiguration->setConfiguration($data['data']);
+ $contentConfiguration->setPage($page);
+ $page->addContentElement($contentConfiguration);
}
$this->pageRepository->add($page);
diff --git a/src/Fixture/Factory/TemplateFixtureFactory.php b/src/Fixture/Factory/TemplateFixtureFactory.php
new file mode 100755
index 000000000..725fcfef0
--- /dev/null
+++ b/src/Fixture/Factory/TemplateFixtureFactory.php
@@ -0,0 +1,51 @@
+templateRepository->findOneBy(['name' => $fields['name']]);
+ if (
+ true === $fields['remove_existing'] &&
+ null !== $template
+ ) {
+ $this->templateRepository->remove($template);
+ }
+
+ $this->createPage($fields);
+ }
+ }
+
+ private function createPage(array $pageData): void {
+ /** @var TemplateInterface $template */
+ $template = $this->templateFactory->createNew();
+
+ $template->setName($pageData['name']);
+ $template->setType($pageData['type']);
+ $template->setContentElements($pageData['content_elements']);
+
+ $this->templateRepository->add($template);
+ }
+}
diff --git a/src/Fixture/MediaFixture.php b/src/Fixture/MediaFixture.php
index ef7c68b76..6affd5a6f 100644
--- a/src/Fixture/MediaFixture.php
+++ b/src/Fixture/MediaFixture.php
@@ -38,13 +38,11 @@ protected function configureOptionsNode(ArrayNodeDefinition $optionsNode): void
->arrayPrototype()
->children()
->booleanNode('remove_existing')->defaultTrue()->end()
- ->integerNode('number')->defaultNull()->end()
->scalarNode('type')->isRequired()->cannotBeEmpty()->end()
->scalarNode('path')->isRequired()->cannotBeEmpty()->end()
->scalarNode('original_name')->isRequired()->cannotBeEmpty()->end()
->scalarNode('name')->defaultNull()->end()
->booleanNode('enabled')->defaultTrue()->end()
- ->arrayNode('productCodes')->scalarPrototype()->end()->end()
->arrayNode('collections')->scalarPrototype()->end()->end()
->arrayNode('channels')->scalarPrototype()->end()->end()
->arrayNode('translations')
diff --git a/src/Fixture/PageFixture.php b/src/Fixture/PageFixture.php
index 3812353c4..4f3652acc 100755
--- a/src/Fixture/PageFixture.php
+++ b/src/Fixture/PageFixture.php
@@ -38,26 +38,54 @@ protected function configureOptionsNode(ArrayNodeDefinition $optionsNode): void
->arrayPrototype()
->children()
->booleanNode('remove_existing')->defaultTrue()->end()
- ->integerNode('number')->defaultNull()->end()
->booleanNode('enabled')->defaultTrue()->end()
- ->integerNode('products')->defaultNull()->end()
- ->arrayNode('productCodes')->scalarPrototype()->end()->end()
+ ->scalarNode('name')->end()
->arrayNode('collections')->scalarPrototype()->end()->end()
->arrayNode('channels')->scalarPrototype()->end()->end()
->arrayNode('translations')
->prototype('array')
->children()
->scalarNode('slug')->defaultNull()->end()
- ->scalarNode('name')->defaultNull()->end()
- ->scalarNode('name_when_linked')->defaultNull()->end()
- ->scalarNode('description_when_linked')->defaultNull()->end()
- ->scalarNode('image_path')->defaultNull()->end()
+ ->scalarNode('meta_title')->defaultNull()->end()
->scalarNode('meta_keywords')->defaultNull()->end()
->scalarNode('meta_description')->defaultNull()->end()
- ->scalarNode('content')->defaultNull()->end()
->end()
->end()
->end()
+ ->arrayNode('content_elements')
+ ->useAttributeAsKey('key') // Use keys from YAML as node names
+ ->arrayPrototype()
+ ->children()
+ ->scalarNode('type')->end() // "type" field at the top level of each content element
+ ->arrayNode('data') // "data" field containing the actual data
+ ->children()
+ ->scalarNode('heading_type')->end()
+ ->scalarNode('heading')->end()
+ ->scalarNode('textarea')->end()
+ ->scalarNode('single_media')->end()
+ ->scalarNode('products_carousel_by_taxon')->end()
+ ->scalarNode('products_grid_by_taxon')->end()
+ ->arrayNode('multiple_media')->scalarPrototype()->end()->end()
+ ->arrayNode('products_grid')
+ ->children()
+ ->arrayNode('products')->scalarPrototype()->end()->end()
+ ->end()
+ ->end()
+ ->arrayNode('products_carousel')
+ ->children()
+ ->arrayNode('products')->scalarPrototype()->end()->end()
+ ->end()
+ ->end()
+ ->arrayNode('taxons_list')
+ ->children()
+ ->arrayNode('taxons')->scalarPrototype()->end()->end()
+ ->end()
+ ->end()
+ ->end()
+ ->end() // End of data
+ ->end()
+ ->end() // End of each content element
+ ->end() // End of content_elements array
->end()
->end()
->end()
diff --git a/src/Fixture/TemplateFixture.php b/src/Fixture/TemplateFixture.php
new file mode 100755
index 000000000..5cfdc9b62
--- /dev/null
+++ b/src/Fixture/TemplateFixture.php
@@ -0,0 +1,56 @@
+templateFixtureFactory->load($options['custom']);
+ }
+
+ public function getName(): string
+ {
+ return 'template';
+ }
+
+ protected function configureOptionsNode(ArrayNodeDefinition $optionsNode): void
+ {
+ $optionsNode
+ ->children()
+ ->arrayNode('custom')
+ ->arrayPrototype()
+ ->children()
+ ->booleanNode('remove_existing')->defaultTrue()->end()
+ ->scalarNode('name')->end()
+ ->scalarNode('type')->end()
+ ->arrayNode('content_elements')
+ ->arrayPrototype()
+ ->children()
+ ->scalarNode('type')->end()
+ ->end()
+ ->end()
+ ->end()
+ ->end()
+ ->end()
+ ->end()
+ ->end()
+ ;
+ }
+}
diff --git a/src/Resources/config/services/fixture.xml b/src/Resources/config/services/fixture.xml
index c65e24c69..df913fb6d 100644
--- a/src/Resources/config/services/fixture.xml
+++ b/src/Resources/config/services/fixture.xml
@@ -24,11 +24,20 @@
+
+
+
+
+
+
+
+
+
@@ -42,6 +51,7 @@
+
@@ -52,6 +62,11 @@
+
+
+
+
+
diff --git a/src/Resources/views/Shop/Block/show.html.twig b/src/Resources/views/Shop/Block/show.html.twig
index f739e1a88..16380c595 100644
--- a/src/Resources/views/Shop/Block/show.html.twig
+++ b/src/Resources/views/Shop/Block/show.html.twig
@@ -1,3 +1,4 @@
+ {{ dump(context) }}
{{ content|raw }}
diff --git a/src/Resources/views/Shop/Media/Show/image.html.twig b/src/Resources/views/Shop/Media/Show/image.html.twig
index 0b13ea9f0..8eb2c4cc9 100755
--- a/src/Resources/views/Shop/Media/Show/image.html.twig
+++ b/src/Resources/views/Shop/Media/Show/image.html.twig
@@ -1,10 +1,16 @@
-
{{ media.name|raw }}
-
+ {% if media.link %}
+
+ {% endif %}
+ {% if media.link %}
+
+ {% endif %}
-
{{ bitbag_cms_render_content(media) }}
+ {% if media.content %}
+ {{ bitbag_cms_render_content(media) }}
+ {% endif %}
diff --git a/src/Twig/Runtime/RenderBlockRuntime.php b/src/Twig/Runtime/RenderBlockRuntime.php
index 6b8798be2..2af5317ec 100644
--- a/src/Twig/Runtime/RenderBlockRuntime.php
+++ b/src/Twig/Runtime/RenderBlockRuntime.php
@@ -27,7 +27,7 @@ public function __construct(
) {
}
- public function renderBlock(string $code, ?string $template = null, ProductInterface|TaxonInterface $context = null): string
+ public function renderBlock(string $code, ?string $template = null, ProductInterface|TaxonInterface|array $context = null): string
{
$block = $this->blockResourceResolver->findOrLog($code);
if (null === $block) {
@@ -49,6 +49,7 @@ public function renderBlock(string $code, ?string $template = null, ProductInter
$template ?? self::DEFAULT_TEMPLATE,
[
'content' => $this->contentElementRendererStrategy->render($block),
+ 'context' => $context,
],
);
}
diff --git a/tests/Application/Resources/fixtures/homepage_logo.png b/tests/Application/Resources/fixtures/homepage_logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..decba55dd051406b2e9024c096af86f78439bf75
GIT binary patch
literal 20968
zcmXtg1ymc)*Y@HL!L_&+Cs=XU;!g46-r^qIN};%0k>XaQxNC4L?oNT?R`~M!zvtVW
zY&LUdvv=-Xn>)`gY9_1&dioSdwj
z-CD+lxx1AmwU?c{Ew#L&in=9-6$$`Q1Bx<|+TP2j#$HB7I=8R6PwUVrX)-i~
zB7u)ae04Hf!7ZsI)B~NjKc3u-^%m!K@Xa9oCY~N1e*&EBl7CbnE6o3Jh-M#jhetSy
z;|HIwT|I>=hM{q}m?@<128dIMb+g{B`Av3|!cK7S)49xh!_e><|GU_>4VEfMEahBQ
z;ohx>n3pldGOQvLFS|)BThNM@5A95^%`{xrch1n4{_h5O#D6t{%#Y*01&s8Q#eo)(
zgeh$de0n!ED4oPCpQxMPnr%A2tMjJlw@Wi-G=F&Xe|Kfu!dtH5n^vU4b(|5#d=`dV
zgNp)8(xCncq&0JXKPz>>kJ?%E{4k=T@g*Qd1cEihVe-*G{QSl&HX+HMofUn1=@>Iq
z{-aiqklLoRZkA|v;7SOsmF+iSB6NW5lcHioK#ijFea)1CjeX1jiskY^SB@0lP%>XC3A
zI)Y)Us9||;Gq@j69qEb7!}$u2Z6
size_table:
channels:
- - "FASHION_WEB"
+ - "FASHION_WEB"
type: image
path: "%fixtures_dir%/size_table.jpeg"
original_name: "size_table.jpeg"
sale:
channels:
- - "FASHION_WEB"
+ - "FASHION_WEB"
type: image
path: "%fixtures_dir%/sale.jpeg"
original_name: "sale.jpeg"
collections:
- - "products"
- media_with_products:
- type: image
- path: "%fixtures_dir%/homepage_header.jpeg"
- original_name: "homepage_header.jpeg"
- channels:
- - "FASHION_WEB"
- productCodes:
- - "666F_boyfriend_jeans_with_rips"
- - "727F_patched_cropped_jeans"
- - "111F_patched_jeans_with_fancy_badges"
+ - "products"
media_with_parameters:
channels:
- - "FASHION_WEB"
+ - "FASHION_WEB"
type: image
path: "%fixtures_dir%/homepage_header.jpeg"
original_name: "homepage_header.jpeg"
@@ -151,53 +204,78 @@ sylius_fixtures:
page:
options:
custom:
+ faq:
+ name: "FAQ page"
+ channels:
+ - "FASHION_WEB"
+ translations:
+ en_US:
+ slug: "faq"
+ meta_title: "FAQ"
+ meta_keywords: "faq"
+ content_elements:
+ multiple_media:
+ type: "multiple_media"
+ data:
+ multiple_media:
+ - "homepage_video"
+ - "homepage_pdf"
+ question1:
+ type: "heading"
+ data:
+ heading_type: "h3"
+ heading: "Lorem ipsum dolor sit amet, consectetur adipiscing elit?"
+ answer1:
+ type: "textarea"
+ data:
+ textarea: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
"
+ question2:
+ type: "heading"
+ data:
+ heading_type: "h3"
+ heading: "Lorem ipsum dolor sit amet, consectetur adipiscing elit?"
+ answer2:
+ type: "textarea"
+ data:
+ textarea: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
"
lorem_ipsum:
+ name: "Lorem ipsum page"
channels:
- - "FASHION_WEB"
- number: 14
- products: 5
+ - "FASHION_WEB"
collections:
- - "blog"
+ - "blog"
translations:
en_US:
- name: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Verba tu fingas et ea dicas, quae non sentias?"
- name_when_linked: "Lorem ipsum dolor"
- description_when_linked: "Lorem ipsum dolor sit amet, consectetur adipiscing elit..."
- image_path: "%fixtures_dir%/homepage_header.jpeg"
- content: |
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Verba tu fingas et ea dicas, quae non sentias? Fortitudinis quaedam praecepta sunt ac paene leges, quae effeminari virum vetant in dolore. Propter nos enim illam, non propter eam nosmet ipsos diligimus. At ego quem huic anteponam non audeo dicere;
-
- Estne, quaeso, inquam, sitienti in bibendo voluptas? Duo Reges: constructio interrete. Quam si explicavisset, non tam haesitaret. Non enim ipsa genuit hominem, sed accepit a natura inchoatum. Conclusum est enim contra Cyrenaicos satis acute, nihil ad Epicurum. Quis istud, quaeso, nesciebat? Verum tamen cum de rebus grandioribus dicas, ipsae res verba rapiunt;
-
- Quae cum praeponunt, ut sit aliqua rerum selectio, naturam videntur sequi; Ex quo intellegitur officium medium quiddam esse, quod neque in bonis ponatur neque in contrariis. Quid ergo hoc loco intellegit honestum? Ergo, si semel tristior effectus est, hilara vita amissa est?
-
- Nam his libris eum malo quam reliquo ornatu villae delectari. Quid est, quod ab ea absolvi et perfici debeat? Ex quo, id quod omnes expetunt, beate vivendi ratio inveniri et comparari potest. Stoici scilicet.
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Verba tu fingas et ea dicas, quae non sentias? Fortitudinis quaedam praecepta sunt ac paene leges, quae effeminari virum vetant in dolore. Propter nos enim illam, non propter eam nosmet ipsos diligimus. At ego quem huic anteponam non audeo dicere;
-
- Estne, quaeso, inquam, sitienti in bibendo voluptas? Duo Reges: constructio interrete. Quam si explicavisset, non tam haesitaret. Non enim ipsa genuit hominem, sed accepit a natura inchoatum. Conclusum est enim contra Cyrenaicos satis acute, nihil ad Epicurum. Quis istud, quaeso, nesciebat? Verum tamen cum de rebus grandioribus dicas, ipsae res verba rapiunt;
-
- Quae cum praeponunt, ut sit aliqua rerum selectio, naturam videntur sequi; Ex quo intellegitur officium medium quiddam esse, quod neque in bonis ponatur neque in contrariis. Quid ergo hoc loco intellegit honestum? Ergo, si semel tristior effectus est, hilara vita amissa est?
-
- Nam his libris eum malo quam reliquo ornatu villae delectari. Quid est, quod ab ea absolvi et perfici debeat? Ex quo, id quod omnes expetunt, beate vivendi ratio inveniri et comparari potest. Stoici scilicet.
+ slug: "lorem-ipsum"
+ meta_title: "Lorem ipsum"
+ meta_keywords: "lorem, ipsum"
+ meta_description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
about:
- products: 5
+ name: "About us page"
channels:
- - "FASHION_WEB"
+ - "FASHION_WEB"
collections:
- - "general"
- - "store"
+ - "general"
+ - "store"
translations:
en_US:
- name: "About us"
slug: "about"
- name_when_linked: "Read more about us"
- description_when_linked: "Lorem ipsum dolor sit amet, consectetur adipiscing elit..."
- content: |
- Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus
-
- - Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.
- - Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus.
- - Phasellus ultrices nulla quis nibh. Quisque a lectus. Donec consectetuer ligula vulputate sem tristique cursus. Nam nulla quam, gravida non, commodo a, sodales sit amet, nisi.
- - Pellentesque fermentum dolor. Aliquam quam lectus, facilisis auctor, ultrices ut, elementum vulputate, nunc.
-
- Pellentesque habitant morbi tristique sene
+ meta_title: "About us"
+ meta_keywords: "about, us"
+ meta_description: "About us page"
+ template:
+ options:
+ custom:
+ homepage:
+ name: "Page template"
+ type: "page"
+ content_elements:
+ - type: "textarea"
+ - type: "multiple_media"
+ about:
+ name: "Block template"
+ type: "block"
+ content_elements:
+ - type: "heading"
+ - type: "textarea"
+ - type: "single_media"
diff --git a/tests/Application/templates/bundles/SyliusShopBundle/Homepage/index.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/Homepage/index.html.twig
index ab008b882..ca606c2ed 100755
--- a/tests/Application/templates/bundles/SyliusShopBundle/Homepage/index.html.twig
+++ b/tests/Application/templates/bundles/SyliusShopBundle/Homepage/index.html.twig
@@ -3,49 +3,14 @@
{% block content %}
-
-
-
-
- {{ bitbag_cms_render_media('homepage_header_image') }}
-
-
-
-
- {{ bitbag_cms_render_block('homepage_intro') }}
-
-
- {{ bitbag_cms_render_media('homepage_pdf') }}
-
-
-
-
-
-
- {{ bitbag_cms_render_media('homepage_video') }}
-
-
-
-
- {{ bitbag_cms_render_media('media_with_parameters', "examples/media_custom_template.html.twig")}}
-
-
-
-
-
-
- {{ bitbag_cms_render_block('homepage_products_info') }}
+ {{ bitbag_cms_render_media('homepage_logo') }}
+ {{ bitbag_cms_render_block('homepage_products_carousel') }}
+ {{ bitbag_cms_render_block('homepage_products_grid') }}
+ {{ bitbag_cms_render_block('homepage_taxons_list') }}
+ {{ bitbag_cms_render_block('homepage_products_carousel_by_taxon') }}
+ {{ bitbag_cms_render_block('homepage_products_grid_by_taxon') }}
-
- {{ render(url('sylius_shop_partial_product_index_latest', {'count': 4, 'template': '@SyliusShop/Product/_horizontalList.html.twig'})) }}
-