mjml-app icon indicating copy to clipboard operation
mjml-app copied to clipboard

cannot display mj-hero background image with related path

Open horans opened this issue 8 years ago • 4 comments

env: win7 x64 ver: v2.8.0

when setup the background image for mj-hero, if we use a "relative path" rather than a "absolute path", it will not be rendered in preview window. however, when exported as html, it works just fine.

<mj-hero mode="fluid-height" background-width="750px" background-url="./images/edm2-2-06.png">

if we toggle the dev tools, it will show error as below:

GET file:///C:/Program%20Files/MJML/resources/app.asar/images/edm2-2-06.png net::ERR_FILE_NOT_FOUND

horans avatar Mar 15 '18 08:03 horans

Hi @horans, I'll look into this,

meriadec avatar Mar 16 '18 13:03 meriadec

It's the same for background-url on mj-wrapper.

dakur avatar May 03 '18 14:05 dakur

I can confirm this issue for section also.

ruudboon avatar Sep 27 '18 04:09 ruudboon

Use the exact file path as so:

background-url="file://D:/Projects/project-file/project-image.jpg"

sqnkov avatar Oct 19 '18 14:10 sqnkov