elementor / static-html-output

Static HTML Output Plugin for WordPress
https://statichtmloutput.com
The Unlicense
124 stars 33 forks source link

Export inline background #175

Open jimmy-work opened 3 years ago

jimmy-work commented 3 years ago

Hello

Thanks for the plugin.

In my code I sometimes find myself needing to retrieve ACF fields to use inline style for image background in html. Here is an example:

<?php $background = get_field('background'); ?>
<?php $backgroundUrl = wp_get_attachment_image_src($background, 'full'); ?>
<div class="contact__background" style="background: url('<?php echo $backgroundUrl[0]; ?>') no-repeat center; background-size: 100%;"></div>

The client can put png or svg in the ideal. It's working well before the export.

The concern is that once the export is finished this type of field is empty like that:

<div class="contact__background" style="background: url('') no-repeat center; background-size: 100%;"></div>

Is this a bug?

Thank you!

leonstafford commented 3 years ago

Hi @jimmy-mezcalito, sorry for the late reply.

It does look like a bug. I'll mark it as such and write an automated test to reproduce it, then work to fix it. This may take a little time, so if there's a way you can workaround this, such as moving to a linked CSS file, that may allow you to proceed for now.

jimmy-work commented 3 years ago

Hello, thanks you, let me know :)

jimmy-work commented 3 years ago

Hello,

Any news for this bug ? :)

Thanks you !

lucanello commented 3 years ago

I'm experiencing a similar issue. The source code stays as expected but the images specified with inline background url aren't crawled at all.

leonstafford commented 3 years ago

Hi all,

Sorry, no update on this repo for a while, but will catchup when I can and sort this bug out.

Cheers,

Leon

leonstafford commented 3 years ago

If anyone wants to jump-in, you can find automated tests within the project, which can be copied to reproduce this issue, then work on a fix