• Resolved jhempycsg

    (@jhempycsg)


    I’m setting up my first custom gallery in MLA and I’m having trouble with featured images for my PDFs. Here’s my shortcode:

    [mla_gallery post_parent=all post_mime_type=application/pdf mla_markup=pdf-list-recent mla_style=pdf-list-recent-style columns=1 posts_per_page=3 orderby=date order=DESC size=large]

    and here’s the line from my template Item area where I’m displaying the featured image:

    <[+icontag+] class=’gallery-icon [+orientation+]’>[+link+]</[+icontag+]>

    The 3 PDFs that should display in that gallery all have featured images, but I’m seeing the default thumbnails instead. I’m sure I’ve got a parameter wrong somewhere – can anyone see what’s amiss?

    Thank you for your help!
    Janine

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your question and for adding the details of your shortcode and template fragment; very helpful.

    The “Featured Image” support for Media Library items was added before WordPress began supplying thumbnail images for PDF files. The Featured Image is only used when an item does not have a native image, so the current MLA version won’t do what you want.

    I will investigate extending the Featured Image support in a way that will achieve your goal and I will post an update here when I have progress to report. Thanks for an interesting idea and for your patience in awaiting a solution.

    Thread Starter jhempycsg

    (@jhempycsg)

    Thanks for the explanation, and for considering this request as a potential feature!

    We post a lot of reports on our website, and the generated thumbnail is problematic in two ways. First, we experienced the dreaded “black box” problem with PDF thumbnails, and second, our stakeholders didn’t like that the generated images were difficult to read. In the past few days, we tested a solution that fixed the black box problem (PDFs need to be RGB, not CMYK). So at least for now, the thumbnails look reasonable. Our design team also supplies a zoomed-in, cropped version of the PDF cover to use as a featured image, which works fine when we are hand-creating galleries using Elementor. But the number of PDFs on our site is growing and we want to be able to select from them using tags and categories, so we’d like the designer-provided image to carry along with the PDFs when using MLA, too.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update with the details of your application; very helpful.

    I have uploaded a new MLA Development Version dated 20220309 that adds a new parameter for the [mla_gallery] shortcode. You can find step-by-step instructions for using the Development Version in this earlier topic:

    PHP Warning on media upload with Polylang

    Once the Development Version is installed you can update your shortcode to use the new mla_use_featured=true parameter. When this parameter is present, any item that has a Featured Image will use it instead of the native thumbnail or icon. On my system this gives the results you are looking for. You can find more information in the “Thumbnail Substitution, Featured Images and mla_viewer” section of the Settings/Media Library Assistant Documentation tab.

    This enhancement will be part of my next MLA version, but in the interim it would be great if you could let me know if it works for you. Thanks for inspiring this MLA enhancement.

    Plugin Author David Lingren

    (@dglingren)

    I have released MLA version 3.00, which contains the enhancements required for this topic.

    I am marking this topic resolved, but please update it if you have any problems or further questions regarding MLA’s support for featured images in [mla_gallery]. Thanks for inspiring this MLA improvement.

    Thanks for adding this parameter @dglingren!

    I’m trying it out on a site that uses Elementor Pro and noticed something odd.

    The featured image displays correctly in the Elementor editor and in the page preview, but in the live page after saving it seems like it’s getting encoded into base64 GIF.

    src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"

    I’ve been tinkering around with various other things on the site that could interfere with the src path (e.g., Jetpack image accelerator), but so far I haven’t come up with a definitive conflict with this parameter.

    Plugin Author David Lingren

    (@dglingren)

    @joe-alberts

    Thanks for your report. Here is an earlier topic you may find helpful:

    Odd Thumbnail Problem with mla_gallery Shortcode

    As I wrote there:

    Some function of your theme or another plugin is altering the SRC attribute and not matching the value to the proper image file. I do not believe MLA has any role in this issue.

    I will leave this topic unresolved for now in case you can provide more details of any MLA involvement. I regret that I cannot give you more specific or useful help at this point.

    If you do have more details to share it would be better to start a new topic in this forum. Thanks for your understanding and your interest in the plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Gallery not using featured images for PDFs’ is closed to new replies.