A true icon for PDF files, etc.
-
[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 …
?
-
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 secondsize=icon_only
gallery shows the PDF icon for all documents, even those with thumbnails. I have also included themla_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.
I’m saying it should look like https://www.evermap.com/AutoSplit/MergeSimilar.gif – does it look like that for you?
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 thesize
parameter. Thanks for your interest in the plugin.All I meant was the PDF icons like in https://imgur.com/a/JlBta – that’s how they should be. Real icons, not thumbnails.
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.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/JlBtaCould 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″.
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 thewidth
andheight
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.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+]”.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 oldertitle
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 thearia-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.
- The topic ‘A true icon for PDF files, etc.’ is closed to new replies.