BitBagCommerce / SyliusCmsPlugin

Content management system for eCommerce apps created on Sylius platform. Built with Sylius code quality, flexibility, BDD.
MIT License
233 stars 158 forks source link

Wrong url for an image #125

Closed Gilles-Lengy closed 6 years ago

Gilles-Lengy commented 6 years ago

I'm testing out you plugin. I've created an image block. A thumbnail of the image appears in the admin but not on the index page.

I've put {{ bitbag_cms_render_block('test_image') }} in the in

sylius2\app\themes\CrimsonTheme\SyliusShopBundle\views\Homepage\index.html.twig

I access to the webpage via this url : http://localhost/sylius2/web/app_dev.php/en_US/

The image url generated is media/image/f4/35/04ed36f0faaecb91d6394b1c9edf.jpeg whilst the others are for example http://localhost/sylius2/web/media/cache/sylius_shop_product_thumbnail/ec/33/f795dd125ba4ddca0a5ac1a9922e.jpeg which is an product image.

I don't know if I've done somthing wrong or if this a bug...

Do you need more informations ?

bitbager commented 6 years ago

CC @patrick477

patrick477 commented 6 years ago

yes, this is a bug on our side, we will fix it soon 🙂

at this moment you can run your applications via the web server bundle by running the command php bin/console server:start this should fix the problem 🙂

patrick477 commented 6 years ago

@Gilles-Lengy you can overwrite the template @BitBagSyliusCmsPlugin/Shop/Block/Show/imageBlock.html.twig and freely customize for your needs, for example, you can add absolute_url and this should fix the problem

Gilles-Lengy commented 6 years ago

I overrided the file

\app\Resources\BitBagSyliusCmsPlugin\views\Shop\Block\Show\imageBlock.html.twig

with

{% set path = absolute_url('/media/image/'~block.image.path) %}

I didn't work. I think It's because of my wamp...

I try running the command php bin/console server:start. I was asked to do a server:run instead and I anwser Yes and it worked on the given url.

Thank you !

bitbager commented 6 years ago

Have you solved the problem?