• Resolved ventilator

    (@ventilator)


    …just as the title, really. I want to use an alternative to the default image placeholder (image-placeholder.svg). I can see this gets called with <use xlink:href=”image-placeholder.svg”></use>, and I’m sure I could find and edit that to point to a different .svg, but that won’t survive any plugin updates. Can you help?

    Really useful plugin, by the way. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Code Amp

    (@codeamp)

    Hey @ventilator

    Right now there isn’t an easy way to do this – we have a bit of complicated setup so we can load SVGs optimally – essentially we register (while a page is loading) different SVGs we use via xlink:href, and then before the closing body tag we outout those SVGs via PHP – this ensures no SVG is loaded more thank once, and keeps the page size down too.

    If you wanted to hack at it, the easiest thing to do would be to replace the SVG in our plugin, but as you mention that’s generally not advisable.

    We do plan to an option so you can choose an image from your gallery as the placeholder image, but thats not coming for some time.

    * I do have another idea, we have some PHP hooks, so you can filter the output of any of our elements – including the featured image.

    You could conditionally check for the existance of the image placeholder in the content, and replace the html with your own:
    https://customlayouts.com/documentation/action-filter-reference/

    You would need one called custom-layouts/element/render_output:

    add_filter( 'custom-layouts/element/render_output', 'cl_element_render_output', 10, 2 );
    

    I hope that might help until we add this feature!

    Thanks
    – Ross

    • This reply was modified 3 years, 2 months ago by Code Amp.
    Thread Starter ventilator

    (@ventilator)

    Ross, thanks a lot for taking the time to look into that. I’ve considered the option of using a php hook, but I think it’ll be beyond me. For the time being, I’ve simply overwritten the .svg, and have made a note to re-overwrite it on upgrade – not ideal, but practical for the short-term!

    Thanks again

    Plugin Author Code Amp

    (@codeamp)

    Ok thanks for the update – hopefully we’ll get to releasing this feature sooner rather than later.

    Best
    – Ross

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Use custom .svg for image placeholder?’ is closed to new replies.