Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong url for an image #125

Closed
Gilles-Lengy opened this issue Apr 6, 2018 · 5 comments
Closed

Wrong url for an image #125

Gilles-Lengy opened this issue Apr 6, 2018 · 5 comments

Comments

@Gilles-Lengy
Copy link

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
Copy link
Member

bitbager commented Apr 9, 2018

CC @patrick477

@patrick477
Copy link
Contributor

patrick477 commented Apr 9, 2018

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 patrick477 added the Bug label Apr 9, 2018
@patrick477
Copy link
Contributor

@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

@bitbager bitbager added Enhancement and removed Bug labels Apr 9, 2018
@Gilles-Lengy
Copy link
Author

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
Copy link
Member

Have you solved the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants