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

Export inline background #175

Open
jimmy-work opened this issue Mar 4, 2021 · 6 comments
Open

Export inline background #175

jimmy-work opened this issue Mar 4, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@jimmy-work
Copy link

jimmy-work commented Mar 4, 2021

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

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.

@leonstafford leonstafford added the bug Something isn't working label Mar 15, 2021
@jimmy-work
Copy link
Author

Hello, thanks you, let me know :)

@jimmy-work
Copy link
Author

Hello,

Any news for this bug ? :)

Thanks you !

@lucanello
Copy link

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

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants