• Resolved lwcorp

    (@lwcorp)


    [mla_gallery size=icon] or size=icon_only doesn’t work right for PDF files. It’s still a sort of thumbnail and not an icon. Can you make it something like:

    [PDF icon] Title of PDF #1 [PDF icon] Title of PDF #2 …

    ?

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

    (@dglingren)

    Thanks for your report. I ran a quick test on my system with these two shortcodes:

    [mla_gallery post_mime_type=application/pdf post_parent=all mla_caption="{+title+}" size="icon"]
    
    [mla_gallery post_mime_type=application/pdf post_parent=all mla_caption="{+title+}" size="icon_only"]
    

    As you reported, the first size=icon gallery includes “thumbnails” for the PDF documents that have them. The second size=icon_only gallery shows the PDF icon for all documents, even those with thumbnails. I have also included the mla_caption="{+title+}" parameter to display the title of each document, along the lines you suggest.

    The issue you are having with size=icon_only may be caused by some other problem in your shortcode syntax or parameters. You can try copying the example above as a second test case. If you are still having trouble, post the entire text of your shortcode(s) and I will see if I can reproduce the problem on my system.

    I will leave this topic unresolved until I hear back from you.

    Thread Starter lwcorp

    (@lwcorp)

    I’m saying it should look like https://www.evermap.com/AutoSplit/MergeSimilar.gif – does it look like that for you?

    Plugin Author David Lingren

    (@dglingren)

    Thanks for posting a link to the example layout.

    I’m not sure how to get to the curly brace and consolidated entries show on the right-hand side, but the left and middle columns can be created with custom markup and style templates.

    The default layout of the [mla_gallery] display is intended to be as close to the WordPress [gallery] display as possible. The custom template features are provided to enable the alternative layouts and styles you are seeking.

    I assume the size=icon_only parameter is working as described in my initial response. I am marking this topic resolved, but please update it if you are still having trouble with the size parameter. Thanks for your interest in the plugin.

    Thread Starter lwcorp

    (@lwcorp)

    All I meant was the PDF icons like in https://imgur.com/a/JlBta – that’s how they should be. Real icons, not thumbnails.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for clarifying. As I wrote, when I use size=icon_only I get icons, never thumbnails. If that’s not working for you, try the example shortcode I posted as a test case. If you’re still having trouble, post the complete source text of the shortcode you are using and I will investigate further. Thanks for any additional details you can provide.

    Thread Starter lwcorp

    (@lwcorp)

    I read the manual and it states:

    icon_only Display an appropriate 60×60 (or 64×64) pixel thumbnail for ALL items, image and non-image

    This means you’re completely right that it works as intended!
    So my issue is that “60×60″ (or 64×64)” treats icons as if they were thumbnails. But I expect them to be small enough to be inline, just like in https://imgur.com/a/JlBta

    Could you maybe add something like size=icon_only_inline? I think it’ll be very quite useful for documents.

    As for doing it in a template, it seems to be part of [+link+] and hardcoded to use class=”attachment-64×64 size-64×64″.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for confirming that size-icon_only is working as expected and for giving the custom template a try.

    As you observed, the [+link+] substitution parameter isn’t suitable for your application. You can compose your own alternative by using the component parts available in the item-level substitution parameters. For your application, you can use something like this in your template’s “Item” section:

    <a href="[+link_url+]"><img width="16" height="16" class="aria-describedby="[+selector+]-[+attachment_ID+]" alt="[+image_alt+]" src="[+thumbnail_url+]">[+title+]</a>
    

    I removed the extra class attributes and changed the width and height attributes. The other components should match the defaults in [+link+]. You can adjust the above example as needed for your application. Let me know if you have any problems or questions regarding the above suggestion.

    Thread Starter lwcorp

    (@lwcorp)

    Thanks, but the class turned out as:

    class=”aria-describedby=”mla_gallery-1-146″

    Note there’s an uneven amount of quotes.
    Also, Should there be an equal sign in there?
    Last but not least, why use a different attachment_ID for each link’s class?

    P.S.
    Since we’re dealing with size=icon_only, it might be more appropriate to use alt=”[+extension+]”.

    • This reply was modified 7 years, 6 months ago by lwcorp.
    • This reply was modified 7 years, 6 months ago by lwcorp.
    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update and alerting me to the flaw in my example. The class=" part of the example should be deleted:

    <a href="[+link_url+]"><img width="16" height="16" aria-describedby="[+selector+]-[+attachment_ID+]" alt="[+image_alt+]" src="[+thumbnail_url+]">[+title+]</a>
    

    In fact, you should also delete the aria-describedby or you should add some markup to the link text:

    <a href="[+link_url+]"><img width="16" height="16" aria-describedby="[+selector+]-[+attachment_ID+]" alt="[+image_alt+]" src="[+thumbnail_url+]"><span id="[+selector+]-[+attachment_ID+]">[+title+]</span></a>
    

    The aria-describedby attribute is for accessibility; it replaces the older title attribute and names a text element that describes the item. You can see in my second example I have added a span tag around the title with an id attribute that matches the aria-describedby value. That is why each item needs a unique identifier.

    The ALT Text value is intended to uniquely describe each “image”. You could indeed substitute something like alt="PDF Icon" to simply describe the icon.

    Thanks for your corrections and suggestions. I regret the error(s) in my earlier post.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘A true icon for PDF files, etc.’ is closed to new replies.