• Resolved DjSlash

    (@djslash)


    Hi, I’ve created an PDF gallery/archive page. It’s almost to my liking, but the main thing I’m running against now is that the PDF thumbnail doesn’t have an alt-text. I’ve searched around, but couldn’t find anything related. Maybe I overlooked something.

    My current custom template I use for this page is:

    <div class="g-grid"> 
      <div class="g-block size-100">
        <h3>[+title+]</h3>
      </div>
    </div>
    <div class="g-grid">
    <div class='g-block'>
    	[+link+]
    </div>
    <div class="g-block">
        <h4>Inhoud:</h4>
        [+description+]
    </div>
    </div>

    I’d like to adjust the output of [+link+], so that I have control what’s in it (like the alt-text). Is that possible?

    The page I need help with: [log in to see the link]

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

    (@dglingren)

    Thanks for your question and for including the details of your custom template; very helpful.

    I am traveling until 10/26 and away from my development system. I will be able to give you an answer to your question shortly after my return. I am confident your template can be adjusted to meet your needs. Thanks for your patience and your interest in the plugin.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your patience. I have returned home and had a chance to investigate your question.

    The alt= attribute is populated from the item’s Caption value, if it exists. It looks like you are using the mla_viewer=true parameter to generate thumbnail pages for PDF documents that have no Caption value in the Media Library; is that right?

    The easy way to achieve your goal is to add an mla_image_alt parameter to your shortcode, something like:

    mla_image_alt="{+template:{+caption+}|{+post_title+}+}"

    The above example will use the Caption if it exists, otherwise it will use the item’s Title. You can change the template to compose any ALT Text value you like. You can also put the entire parameter in the “Arguments” section of your custom template if you don’t want to add it to the shortcode that displays the gallery.

    I hope that gets you started on a solution for your application. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions.

    Thread Starter DjSlash

    (@djslash)

    Excellent, that works like a charm. Thanks for your awesome plugin and support!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PDF thumbnail alt text’ is closed to new replies.