diff --git a/spec/Assigner/ChannelsAssignerSpec.php b/spec/Assigner/ChannelsAssignerSpec.php new file mode 100644 index 000000000..e8ab0b882 --- /dev/null +++ b/spec/Assigner/ChannelsAssignerSpec.php @@ -0,0 +1,44 @@ +beConstructedWith($channelRepository); + } + + function it_is_initializable(): void + { + $this->shouldHaveType(ChannelsAssigner::class); + } + + function it_implements_channels_assigner_interface(): void + { + $this->shouldHaveType(ChannelsAssignerInterface::class); + } + + function it_assigns_channels( + ChannelRepositoryInterface $channelRepository, + ChannelInterface $webChannel, + ChannelInterface $posChannel, + ChannelsAwareInterface $channelsAware + ): void + { + $channelRepository->findOneBy(['code' => 'web'])->willReturn($webChannel); + $channelRepository->findOneBy(['code' => 'pos'])->willReturn($posChannel); + + $channelsAware->addChannel($webChannel)->shouldBeCalled(); + $channelsAware->addChannel($posChannel)->shouldBeCalled(); + + $this->assign($channelsAware, ['web', 'pos']); + } +} diff --git a/spec/Assigner/ProductsAssignerSpec.php b/spec/Assigner/ProductsAssignerSpec.php new file mode 100644 index 000000000..a6779ac8c --- /dev/null +++ b/spec/Assigner/ProductsAssignerSpec.php @@ -0,0 +1,44 @@ +beConstructedWith($productRepository); + } + + function it_is_initializable(): void + { + $this->shouldHaveType(ProductsAssigner::class); + } + + function it_implements_products_assigner_interface(): void + { + $this->shouldHaveType(ProductsAssignerInterface::class); + } + + function it_assigns_products( + ProductRepositoryInterface $productRepository, + ProductInterface $mugProduct, + ProductInterface $tshirtProduct, + ProductsAwareInterface $productsAware + ): void + { + $productRepository->findOneBy(['code' => 'mug'])->willReturn($mugProduct); + $productRepository->findOneBy(['code' => 't-shirt'])->willReturn($tshirtProduct); + + $productsAware->addProduct($mugProduct)->shouldBeCalled(); + $productsAware->addProduct($tshirtProduct)->shouldBeCalled(); + + $this->assign($productsAware, ['mug', 't-shirt']); + } +} diff --git a/spec/Assigner/SectionsAssignerSpec.php b/spec/Assigner/SectionsAssignerSpec.php new file mode 100644 index 000000000..9b553b2b2 --- /dev/null +++ b/spec/Assigner/SectionsAssignerSpec.php @@ -0,0 +1,44 @@ +beConstructedWith($sectionRepository); + } + + function it_is_initializable(): void + { + $this->shouldHaveType(SectionsAssigner::class); + } + + function it_implements_sections_assigner_interface(): void + { + $this->shouldHaveType(SectionsAssignerInterface::class); + } + + function it_assigns_sections( + SectionRepositoryInterface $sectionRepository, + SectionInterface $aboutSection, + SectionInterface $blogSection, + SectionableInterface $sectionsAware + ): void + { + $sectionRepository->findOneBy(['code' => 'about'])->willReturn($aboutSection); + $sectionRepository->findOneBy(['code' => 'blog'])->willReturn($blogSection); + + $sectionsAware->addSection($aboutSection)->shouldBeCalled(); + $sectionsAware->addSection($blogSection)->shouldBeCalled(); + + $this->assign($sectionsAware, ['about', 'blog']); + } +} diff --git a/spec/Entity/MediaSpec.php b/spec/Entity/MediaSpec.php index 110e4f4cf..5e1e6a6f3 100755 --- a/spec/Entity/MediaSpec.php +++ b/spec/Entity/MediaSpec.php @@ -51,9 +51,6 @@ function it_allows_access_via_properties(File $uploadedFile): void $this->setFile($uploadedFile); $this->getFile()->shouldReturn($uploadedFile); - $this->setOriginalPath('/media/video'); - $this->getOriginalPath()->shouldReturn('/media/video'); - $this->setMimeType('video/mp4'); $this->getMimeType()->shouldReturn('video/mp4'); } diff --git a/spec/Entity/MediaTranslationSpec.php b/spec/Entity/MediaTranslationSpec.php index 15fa927d7..6492eac4e 100755 --- a/spec/Entity/MediaTranslationSpec.php +++ b/spec/Entity/MediaTranslationSpec.php @@ -37,7 +37,7 @@ function it_implements_media_translation_interface(): void $this->shouldHaveType(TranslationInterface::class); } - function it_allows_access_via_properties(PageImageInterface $pageImage): void + function it_allows_access_via_properties(): void { $this->setName('Video'); $this->getName()->shouldReturn('Video'); diff --git a/spec/Twig/Parser/ContentParserSpec.php b/spec/Twig/Parser/ContentParserSpec.php new file mode 100644 index 000000000..d48e53799 --- /dev/null +++ b/spec/Twig/Parser/ContentParserSpec.php @@ -0,0 +1,44 @@ +beConstructedWith($twigEnvironment, ['bitbag_cms_render_block']); + } + + function it_is_initializable(): void + { + $this->shouldHaveType(ContentParser::class); + } + + function it_implements_content_parser_interface(): void + { + $this->shouldHaveType(ContentParserInterface::class); + } + + function it_parses_string_functions( + \Twig_Environment $twigEnvironment, + \Twig_Function $renderBlockFunction, + RenderBlockExtension $renderBlockExtension + ): void + { + $twigEnvironment->getFunctions()->willReturn([ + 'bitbag_cms_render_block' => $renderBlockFunction, + ]); + $renderBlockFunction->getCallable()->willReturn([$renderBlockExtension, 'renderBlock']); + + $input = "Let's render! {{ bitbag_cms_render_block('intro', '@BitBagSyliusCmsPlugin/Shop/Block/show.html.twig') }}"; + + $renderBlockExtension->renderBlock('intro', '@BitBagSyliusCmsPlugin/Shop/Block/show.html.twig')->shouldBeCalled(); + + $this->parse($input); + } +} diff --git a/src/Assigner/ChannelsAssigner.php b/src/Assigner/ChannelsAssigner.php index 6eb4e591a..05beac626 100644 --- a/src/Assigner/ChannelsAssigner.php +++ b/src/Assigner/ChannelsAssigner.php @@ -29,7 +29,7 @@ public function __construct(ChannelRepositoryInterface $channelRepository) public function assign(ChannelsAwareInterface $channelsAware, array $channelsCodes): void { foreach ($channelsCodes as $channelCode) { - /** @var ChannelInterface $channel */ + /** @var ChannelInterface $channel|null */ $channel = $this->channelRepository->findOneBy(['code' => $channelCode]); if (null !== $channel) { diff --git a/src/Controller/Action/Admin/ProductSearchAction.php b/src/Controller/Action/Admin/ProductSearchAction.php index fd13b1a70..94528a12c 100644 --- a/src/Controller/Action/Admin/ProductSearchAction.php +++ b/src/Controller/Action/Admin/ProductSearchAction.php @@ -34,8 +34,8 @@ public function __construct(ProductRepositoryInterface $productRepository, ViewH public function __invoke(Request $request): Response { - $resource = $this->productRepository->findByNamePart($request->get('phrase', '')); - $view = View::create($resource); + $product = $this->productRepository->findByNamePart($request->get('phrase', '')); + $view = View::create($product); $this->viewHandler->setExclusionStrategyGroups(['Autocomplete']); $view->getContext()->enableMaxDepth(); diff --git a/src/Controller/MediaController.php b/src/Controller/MediaController.php index ca4b9e860..213fd137e 100755 --- a/src/Controller/MediaController.php +++ b/src/Controller/MediaController.php @@ -16,6 +16,8 @@ use Sylius\Bundle\ResourceBundle\Controller\ResourceController; use Sylius\Component\Resource\ResourceActions; use Symfony\Component\HttpFoundation\BinaryFileResponse; +use Symfony\Component\HttpFoundation\File\File; +use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\ResponseHeaderBag; @@ -60,9 +62,12 @@ public function downloadMediaAction(Request $request): Response $this->eventDispatcher->dispatch(ResourceActions::SHOW, $configuration, $media); - $response = new BinaryFileResponse($media->getOriginalPath()); + $mediaPath = $this->getParameter('kernel.project_dir') . '/web' . $media->getPath(); + $mediaFile = new File($mediaPath); + $mediaName = $media->getName() . '.' . $mediaFile->guessExtension(); + $response = new BinaryFileResponse($mediaPath); - $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT); + $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $mediaName); $response->headers->set('Content-Type', $media->getMimeType()); return $response; diff --git a/src/Entity/Media.php b/src/Entity/Media.php index adcd42c57..146b0c6ba 100644 --- a/src/Entity/Media.php +++ b/src/Entity/Media.php @@ -89,22 +89,8 @@ public function setPath(?string $path): void $this->path = $path; } - public function getOriginalPath(): ?string - { - return $this->originalPath; - } - - public function setOriginalPath(?string $originalPath): void - { - $this->originalPath = $originalPath; - } - public function getFile(): ?File { - if (null === $this->type && null !== $this->path) { - $this->file = new File($this->path); - } - return $this->file; } diff --git a/src/Entity/MediaInterface.php b/src/Entity/MediaInterface.php index f8b7d4269..f93df3760 100644 --- a/src/Entity/MediaInterface.php +++ b/src/Entity/MediaInterface.php @@ -36,10 +36,6 @@ public function getPath(): ?string; public function setPath(?string $path): void; - public function getOriginalPath(): ?string; - - public function setOriginalPath(?string $originalPath): void; - public function getFile(): ?File; public function setFile(?File $file): void; diff --git a/src/Fixture/Factory/MediaFixtureFactory.php b/src/Fixture/Factory/MediaFixtureFactory.php index ef0c9a7b8..813d8c947 100644 --- a/src/Fixture/Factory/MediaFixtureFactory.php +++ b/src/Fixture/Factory/MediaFixtureFactory.php @@ -18,6 +18,7 @@ use BitBag\SyliusCmsPlugin\Entity\MediaTranslationInterface; use BitBag\SyliusCmsPlugin\MediaProvider\ProviderInterface; use BitBag\SyliusCmsPlugin\Repository\MediaRepositoryInterface; +use BitBag\SyliusCmsPlugin\Resolver\MediaProviderResolverInterface; use Sylius\Component\Resource\Factory\FactoryInterface; use Symfony\Component\HttpFoundation\File\File; @@ -29,8 +30,8 @@ final class MediaFixtureFactory implements FixtureFactoryInterface /** @var FactoryInterface */ private $mediaTranslationFactory; - /** @var ProviderInterface */ - private $imageProvider; + /** @var MediaProviderResolverInterface */ + private $mediaProviderResolver; /** @var MediaRepositoryInterface */ private $mediaRepository; @@ -44,14 +45,14 @@ final class MediaFixtureFactory implements FixtureFactoryInterface public function __construct( FactoryInterface $mediaFactory, FactoryInterface $mediaTranslationFactory, - ProviderInterface $imageProvider, + MediaProviderResolverInterface $mediaProviderResolver, MediaRepositoryInterface $mediaRepository, ProductsAssignerInterface $productsAssigner, SectionsAssignerInterface $sectionsAssigner ) { $this->mediaFactory = $mediaFactory; $this->mediaTranslationFactory = $mediaTranslationFactory; - $this->imageProvider = $imageProvider; + $this->mediaProviderResolver = $mediaProviderResolver; $this->mediaRepository = $mediaRepository; $this->productsAssigner = $productsAssigner; $this->sectionsAssigner = $sectionsAssigner; @@ -86,7 +87,7 @@ private function createMedia(string $code, array $mediaData): void $media->setEnabled($mediaData['enabled']); $media->setFile(new File($mediaData['path'])); - $this->imageProvider->upload($media); + $this->mediaProviderResolver->resolveProvider($media)->upload($media); foreach ($mediaData['translations'] as $localeCode => $translation) { /** @var MediaTranslationInterface $mediaTranslation */ diff --git a/src/Fixture/Factory/PageFixtureFactory.php b/src/Fixture/Factory/PageFixtureFactory.php index 6b96f61ed..6a1f58cc5 100755 --- a/src/Fixture/Factory/PageFixtureFactory.php +++ b/src/Fixture/Factory/PageFixtureFactory.php @@ -12,8 +12,8 @@ namespace BitBag\SyliusCmsPlugin\Fixture\Factory; -use BitBag\SyliusCmsPlugin\Entity\PageInterface; use BitBag\SyliusCmsPlugin\Entity\PageImage; +use BitBag\SyliusCmsPlugin\Entity\PageInterface; use BitBag\SyliusCmsPlugin\Entity\PageTranslationInterface; use BitBag\SyliusCmsPlugin\Entity\SectionInterface; use BitBag\SyliusCmsPlugin\Repository\PageRepositoryInterface; @@ -39,7 +39,7 @@ final class PageFixtureFactory implements FixtureFactoryInterface /** @var SectionRepositoryInterface */ private $sectionRepository; - /** @var ProductRepositoryInterface */ + /** @var ImageUploaderInterface */ private $imageUploader; /** @var ProductRepositoryInterface */ diff --git a/src/Importer/PageImporter.php b/src/Importer/PageImporter.php index b38d37927..baf7231b9 100644 --- a/src/Importer/PageImporter.php +++ b/src/Importer/PageImporter.php @@ -13,8 +13,8 @@ namespace BitBag\SyliusCmsPlugin\Importer; use BitBag\SyliusCmsPlugin\Downloader\ImageDownloaderInterface; -use BitBag\SyliusCmsPlugin\Entity\PageInterface; use BitBag\SyliusCmsPlugin\Entity\PageImage; +use BitBag\SyliusCmsPlugin\Entity\PageInterface; use BitBag\SyliusCmsPlugin\Entity\PageTranslationInterface; use BitBag\SyliusCmsPlugin\Resolver\ImporterChannelsResolverInterface; use BitBag\SyliusCmsPlugin\Resolver\ImporterProductsResolverInterface; diff --git a/src/MediaProvider/AbstractProvider.php b/src/MediaProvider/AbstractProvider.php index ff8aa2871..adea8a9f7 100755 --- a/src/MediaProvider/AbstractProvider.php +++ b/src/MediaProvider/AbstractProvider.php @@ -49,6 +49,6 @@ public function render(MediaInterface $media, array $options = []): string public function upload(MediaInterface $media): void { - $this->uploader->upload($media, $this->pathPrefix); + $this->uploader->upload($media, $this->pathPrefix); } } diff --git a/src/Menu/ContentManagementMenuBuilder.php b/src/Menu/ContentManagementMenuBuilder.php index ad8eea5bd..e1b3af81a 100755 --- a/src/Menu/ContentManagementMenuBuilder.php +++ b/src/Menu/ContentManagementMenuBuilder.php @@ -33,6 +33,14 @@ public function buildMenu(MenuBuilderEvent $menuBuilderEvent): void ->setLabelAttribute('icon', 'block layout') ; + $cmsRootMenuItem + ->addChild('media', [ + 'route' => 'bitbag_sylius_cms_plugin_admin_media_index', + ]) + ->setLabel('bitbag_sylius_cms_plugin.ui.media') + ->setLabelAttribute('icon', 'file') + ; + $cmsRootMenuItem ->addChild('pages', [ 'route' => 'bitbag_sylius_cms_plugin_admin_page_index', @@ -56,13 +64,5 @@ public function buildMenu(MenuBuilderEvent $menuBuilderEvent): void ->setLabel('bitbag_sylius_cms_plugin.ui.sections') ->setLabelAttribute('icon', 'grid layout') ; - - $cmsRootMenuItem - ->addChild('media', [ - 'route' => 'bitbag_sylius_cms_plugin_admin_media_index', - ]) - ->setLabel('bitbag_sylius_cms_plugin.ui.media') - ->setLabelAttribute('icon', 'file') - ; } } diff --git a/src/Resources/config/doctrine/Media.orm.yml b/src/Resources/config/doctrine/Media.orm.yml index 6c01a36d4..ce1f95c6a 100644 --- a/src/Resources/config/doctrine/Media.orm.yml +++ b/src/Resources/config/doctrine/Media.orm.yml @@ -22,11 +22,6 @@ BitBag\SyliusCmsPlugin\Entity\Media: type: string length: 250 unique: true - originalPath: - column: original_path - type: string - length: 250 - unique: true mimeType: column: mime_typ type: string diff --git a/src/Resources/config/services.yml b/src/Resources/config/services.yml index 3b7582ba8..f11846672 100755 --- a/src/Resources/config/services.yml +++ b/src/Resources/config/services.yml @@ -46,7 +46,6 @@ services: class: BitBag\SyliusCmsPlugin\Uploader\MediaUploader arguments: - "@bitbag_sylius_cms_plugin.media.filesystem" - - "%kernel.project_dir%" bitbag_sylius_cms_plugin.media.filesystem: class: Gaufrette\Filesystem diff --git a/src/Resources/config/services/fixture.yml b/src/Resources/config/services/fixture.yml index 944debbee..506257725 100755 --- a/src/Resources/config/services/fixture.yml +++ b/src/Resources/config/services/fixture.yml @@ -78,7 +78,7 @@ services: arguments: - "@bitbag_sylius_cms_plugin.factory.media" - "@bitbag_sylius_cms_plugin.factory.media_translation" - - "@bitbag_sylius_cms_plugin.media_provider.image" + - "@bitbag_sylius_cms_plugin.resolver.media_provider" - "@bitbag_sylius_cms_plugin.repository.media" - "@bitbag_sylius_cms_plugin.assigner.products" - "@bitbag_sylius_cms_plugin.assigner.sections" diff --git a/src/Resources/views/Shop/Media/Show/file.html.twig b/src/Resources/views/Shop/Media/Show/file.html.twig index f72cbbdef..61c47e656 100755 --- a/src/Resources/views/Shop/Media/Show/file.html.twig +++ b/src/Resources/views/Shop/Media/Show/file.html.twig @@ -1,8 +1,10 @@ {% if null != media.name %} -

{{ media.name }}

+

{{ media.name|raw }}

{% endif %} - - +

{{ media.description|raw }}

+ +
+ {{ 'bitbag_sylius_cms_plugin.ui.download'|trans }} diff --git a/src/Resources/views/Shop/Media/Show/image.html.twig b/src/Resources/views/Shop/Media/Show/image.html.twig index 7320a5057..746531e00 100755 --- a/src/Resources/views/Shop/Media/Show/image.html.twig +++ b/src/Resources/views/Shop/Media/Show/image.html.twig @@ -1,3 +1,5 @@ -{% set path = '/'~media.path %} +

{{ media.name|raw }}

-{{ media.name }} +{{ media.name }} + +

{{ media.description|raw }}

diff --git a/src/Resources/views/Shop/Media/Show/video.html.twig b/src/Resources/views/Shop/Media/Show/video.html.twig index 5186f9a08..66d871411 100755 --- a/src/Resources/views/Shop/Media/Show/video.html.twig +++ b/src/Resources/views/Shop/Media/Show/video.html.twig @@ -1,9 +1,9 @@ -{% set path = '/'~media.path %} -
{% if null != media.name %} -

{{ media.name }}

+

{{ media.name|raw }}

{% endif %} - + + +

{{ media.description|raw }}

diff --git a/src/Twig/Extension/RenderBlockExtension.php b/src/Twig/Extension/RenderBlockExtension.php index 822ea5ef4..d2e1481cb 100644 --- a/src/Twig/Extension/RenderBlockExtension.php +++ b/src/Twig/Extension/RenderBlockExtension.php @@ -16,7 +16,7 @@ use BitBag\SyliusCmsPlugin\Resolver\BlockResourceResolverInterface; use Symfony\Component\Templating\EngineInterface; -final class RenderBlockExtension extends \Twig_Extension +class RenderBlockExtension extends \Twig_Extension { /** @var BlockRepositoryInterface */ private $blockRepository; diff --git a/src/Twig/Parser/ContentParser.php b/src/Twig/Parser/ContentParser.php index b9319260a..f3cea4c22 100644 --- a/src/Twig/Parser/ContentParser.php +++ b/src/Twig/Parser/ContentParser.php @@ -60,7 +60,7 @@ private function getFunctionArguments(string $functionName, string $input): ?arr $arguments = explode(',', $functionParts[0]); return array_map(function (string $element): string { - return trim($element, '\''); + return trim(trim($element), '\''); }, $arguments); } @@ -76,6 +76,6 @@ private function callFunction(array $functions, string $functionName, array $arg $extension = $callable[0]; $extensionMethod = $callable[1]; - return $extension->$extensionMethod(...$arguments); + return call_user_func_array([$extension, $extensionMethod], $arguments); } } diff --git a/src/Uploader/MediaUploader.php b/src/Uploader/MediaUploader.php index 7de15385e..8e5e36d8f 100644 --- a/src/Uploader/MediaUploader.php +++ b/src/Uploader/MediaUploader.php @@ -22,13 +22,9 @@ final class MediaUploader implements MediaUploaderInterface /** @var Filesystem */ private $filesystem; - /** @var string */ - private $projectDir; - - public function __construct(Filesystem $filesystem, string $projectDir) + public function __construct(Filesystem $filesystem) { $this->filesystem = $filesystem; - $this->projectDir = $projectDir; } public function upload(MediaInterface $media, string $pathPrefix): void @@ -51,8 +47,7 @@ public function upload(MediaInterface $media, string $pathPrefix): void $path = $this->expandPath($hash . '.' . $file->guessExtension(), $pathPrefix); } while ($this->filesystem->has($path)); - $media->setPath($path); - $media->setOriginalPath(sprintf('%s/%s', $this->projectDir, $path)); + $media->setPath('/' . $path); $media->setMimeType($file->getMimeType()); $this->filesystem->write( diff --git a/tests/Application/app/Resources/SyliusShopBundle/views/Homepage/index.html.twig b/tests/Application/app/Resources/SyliusShopBundle/views/Homepage/index.html.twig index 1047e5edb..8132d3c8a 100755 --- a/tests/Application/app/Resources/SyliusShopBundle/views/Homepage/index.html.twig +++ b/tests/Application/app/Resources/SyliusShopBundle/views/Homepage/index.html.twig @@ -13,7 +13,7 @@
- {{ render(path('bitbag_sylius_cms_plugin_shop_block_render', {'code' : 'homepage_header_image'})) }} + {{ bitbag_cms_render_media('homepage_header_image') }}
@@ -25,12 +25,12 @@
- {{ bitbag_cms_render_media('homepage_banner_image_1') }} + {{ bitbag_cms_render_media('homepage_video') }}
- {{ bitbag_cms_render_media('homepage_banner_image_2') }} + {{ bitbag_cms_render_media('homepage_pdf') }}
@@ -47,7 +47,8 @@
Like it? We do a lot of Sylius projects & plugins.
- Perhaps there is something we can do for you. Visit our website for more information. + Perhaps there is something we can do for you. Visit our website for + more information.
diff --git a/tests/Application/app/Resources/fixtures/BitBagOffer.pdf b/tests/Application/app/Resources/fixtures/BitBagOffer.pdf new file mode 100644 index 000000000..b16ddf0b5 Binary files /dev/null and b/tests/Application/app/Resources/fixtures/BitBagOffer.pdf differ diff --git a/tests/Application/app/Resources/fixtures/homepage_banner_1.jpeg b/tests/Application/app/Resources/fixtures/homepage_banner_1.jpeg deleted file mode 100644 index 7cb15c51d..000000000 Binary files a/tests/Application/app/Resources/fixtures/homepage_banner_1.jpeg and /dev/null differ diff --git a/tests/Application/app/Resources/fixtures/homepage_banner_2.jpeg b/tests/Application/app/Resources/fixtures/homepage_banner_2.jpeg deleted file mode 100644 index 315a4e632..000000000 Binary files a/tests/Application/app/Resources/fixtures/homepage_banner_2.jpeg and /dev/null differ diff --git a/tests/Application/app/Resources/fixtures/homepage_video.mp4 b/tests/Application/app/Resources/fixtures/homepage_video.mp4 new file mode 100644 index 000000000..45c580d4f Binary files /dev/null and b/tests/Application/app/Resources/fixtures/homepage_video.mp4 differ diff --git a/tests/Application/app/config/fixtures.yml b/tests/Application/app/config/fixtures.yml index ed038bbb4..f220d1ab5 100755 --- a/tests/Application/app/config/fixtures.yml +++ b/tests/Application/app/config/fixtures.yml @@ -85,10 +85,6 @@ sylius_fixtures: bitbag_cms_render_block('homepage_banner_image_1') bitbag_cms_render_block('homepage_banner_image_2') - -

- The block with this nice woman is linked to another page. Click her and see what happens. No pornography included. I promise -

lorem_ipsum: sections: - "homepage" @@ -112,17 +108,43 @@ sylius_fixtures: translations: en_US: name: | - Some block name - homepage_banner_image_1: - type: image - path: "%fixtures_dir%/homepage_banner_1.jpeg" + This is a linked title + alt: Homepage image media + description: | +

Media description

+

+ 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. +

+ homepage_video: + type: video + path: "%fixtures_dir%/homepage_video.mp4" translations: en_US: name: | - Click me! - homepage_banner_image_2: - type: image - path: "%fixtures_dir%/homepage_banner_2.jpeg" + Homepage video media + alt: Homepage video + description: | +

Media description

+

+ 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. +

+ homepage_pdf: + type: file + path: "%fixtures_dir%/BitBagOffer.pdf" + translations: + en_US: + name: Homepage PDF media + alt: BitBag offer + description: | +

File description

+

+ The below button links to a PDF file. + Check it out! +

size_table: type: image path: "%fixtures_dir%/size_table.jpeg"