Skip to content

Conversation

@gabrielcld2
Copy link
Collaborator

This ensures that background images generated within Elementor's CSS files are handled accordingly.

Approach

  • Hook into the Elementor parse_css hook.
    • Check for any background image elementor keys
    • Generate the corresponding cloudinary URL for the media
    • Inject the right CSS rule to override the default one within Elementor
  • Flush the elementor cache whenever a cache flush occurs on Cloudinary
    • This ensures any setting change is directly applied for Elementor background images

QA notes

  • Activate the Elementor plugin
    • Create a page with Elementor
      • Within the elementor page, add an element like a heading
      • Edit the heading, go to Advanced and open the background section
      • Apply a background image (and if you want, you can also apply a hover background image, or even some viewport specific ones like tablet or mobile background images)
    • Publish and view the page
    • Inspect the element and check its CSS contains the cloudinary URL for the background image
    • Go to Cloudinary -> Image Settings
      • Make some changes for instance the image format
      • Save the changes
      • Reload the elementor page and make sure the changes applied to the background image
  • Deactivate the Elementor plugin
    • Make sure the Cloudinary plugin still works, and doesn't expect Elementor to be enabled

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants