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

    (@dglingren)

    Good to hear from you again! Thanks for your question, which is a variation on this earlier topic:

    Bulk add ALT tags

    You wrote “how can we add some ALT Text to the PDF icon“? The real question would be better stated as “how can we add ALT Text values to the PDF documents represented by the PDF Icon in the [mla_gallery] display”? The values should be item-specific, documenting the content of each document.

    As the earlier topic suggests, you can add ALT Text values to the PDF Media Library items. Although the Media/Assistant Bulk Edit area does not support this, the IPTC/EXIF mapping rules so support it. In further testing I found that the Media/Assistant Quick Edit area for a single item also supports it. If you use either method to add ALT Text values to your PDF items, these will be added to your [mla_gallery] display.

    I will consider supporting Bulk Edit ALT Text chances in a future MLA version, but the current version gives you at least two ways to accomplish your task. I am marking this topic resolved, but please update it if you have problems or further questions regarding the above suggestions. Thanks for your continued interest in the plugin.

    Thread Starter cuckoofairweb

    (@cuckoofairweb)

    Hi David, yes it’s been a while! Just updating the websites that use MLA following WP and theme upgrades – currently trying to avoid the Gutenburg editor though.

    Following on from your comment “In further testing I found that the Media/Assistant Quick Edit area for a single item also supports it” I had a look at the Quick Edit area and for a PDF file it displays the following:
    Left hand side – Title | Name/Slug | Caption | Description
    Right hand side – Categories and Tags selection areas and then a field labeled title which is different from the Title on the LHD side.

    No Alt Text field is displayed for PDF files. If an image is selected then Alt Text is displayed on the LHD side.

    If I have to use the mapping rules then is there an easy(?!) way to copy over the values from the Title field into the ALT Text field?

    Cheers

    Paul

    Plugin Author David Lingren

    (@dglingren)

    Thanks for the update with the additional information. I am puzzled by the description of your Quick Edit area.

    On my system, using MLA v2.83, the Quick Edit area has three columns (or one column on a narrow window). On the left are Title, Name/Slug, Caption, Description, ALT Text, Uploaded on, Parent ID, Menu Order and Author. The middle contains all the hierarchical taxonomies. The right contains the flat taxonomies, followed by custom fields added to the area by an MLA Custom Field mapping rule. How does that compare to your display? Have you dated MLA to v2.83?

    To copy Title values to the ALT Text field using a mapping rule:

    • Go to the Settings/Media Library Assistant IPTC/EXIF tab.
    • If you want to apply the rule to new items as they are uploaded, check the “Enable IPTC/EXIF Mapping when adding new media” and “Enable IPTC/EXIF Mapping when updating media metadata” boxes. The rule(s) will be applied to all items, including images.
    • Click the “Standard” view to filter the display to the six standard fields.
    • Locate the “ALT Text” rule entry and click the “Edit” rollover action.
    • In the “IPTC Value” dropdown control leave the default “- None (select a value) -” in place.
    • In the “EXIF/Template Value” text box enter “template:[+post_title+]”.
    • In the “Priority” dropdown, select “EXIF”.
    • In the “Existing Text” dropdown, select “Replace”. This will apply the update to all of the existing ALT Text values. Be careful when applying this to your existing items. You can select “Keep” to limit the action to items without an ALT Text value.
    • Scroll down to the bottom of the screen and click “Save Changes”.

    Once the rule is in place you can use the “Execute” rollover action to apply it to all your items. You can also apply it more selectively using the Media/Assistant Bulk Edit area. Navigate to the Media/Assistant screen, click the “Applications” view to filter out image items. Check the items you want to update, select the “Edit” bulk action and click “Apply”. Click the “Map IPTC/EXIF Metadata” button to run the rule(s) on your selected items.

    I hope the above suggestions are helpful. If you have problems or further questions, post an update.

    Thread Starter cuckoofairweb

    (@cuckoofairweb)

    Hi I am running mla v2.83 and this is a screen grab of the image https://downtonparishcouncil.gov.uk/wp-content/uploads/2020-04-10-mla-quick-edit.png

    I think I have found the issue – if you display ALT TEXT as one of the columns it disappears from the quick edit area.

    Does your mapping rule take the details from the image Title or from the Post where it is displayed?

    Paul

    Thread Starter cuckoofairweb

    (@cuckoofairweb)

    Hi the display of ALT Text in the quick edit area is a bit hit and miss. Eg I can’t get it to appear again after the ‘it’s to do with it being displayed via screen options’ break-through.

    I re-worked the EXIF mapping to use +Title+ which worked once and then didn’t again. I’ll leave it for a while as the web seems to be playing up a bit.

    Paul

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your updates and for the screen shot; very helpful.

    I don’t believe that the “display ALT TEXT as one of the columns” symptom is accurate. There’s nothing in the code that would support that. However, further investigation of the MLA code reveals that the ALT Text text box only appears for items that have an image_meta element in the Attachment Metadata array. On my system, all items have it but I think that’s because of some experiment I ran a long time ago. If you go to the Media/Edit Media full screen editor for one of your PDF items you will not see “Attachment Metadata” between the “Parent Info” and “Menu Order” boxes at the bottom of the screen, below the custom fields.

    I also believe you will see that second title field in the “Custom Fields” area of the edit screen. Is that right?

    Regarding your mapping rule questions, you can find a complete list of available values in the “Field-level data sources” section of the Settings/Media Library Assistant Documentation tab. In particular, the post_title source gives the Title value for the item itself, and the parent_title gives the parent post/page Title value for any items attached to a post/page. You should also add parentheses to the template, i.e.:

    template:([+post_title+])
    
    or
    
    template:([+parent_title+])
    

    If you want to add ALT Text to your PDF items you can add a custom field mapping rule that will create the required image_meta elements:

    • Navigate to the Settings/Media Library Assistant “Custom Fields” tab.
    • Make sure the “Enable custom field mapping when adding new media” box is checked. If not, check the box and click “Save Changes”.
    • Scroll down to the “Add New Custom Field Rule” area below the “Enable” checkboxes.
    • Under the “Name” dropdown control, click “Enter new field” to create a new custom field.
    • In the “Name” text box, enter, “meta:image_meta.title”.
    • From the Data Source dropdown list, select “post_title”.
    • Leave the “Meta/Template” text box empty.
    • Click the “MLA Column” check box if you want to make the field available in the Media/Assistant submenu table.
    • In the “Existing Text” dropdown list, select “Replace”.
    • In the “Format” dropdown list, select “Native”.
    • In the “Option:” dropdown list, select “Text”.
    • Leave the “Delete NULL Values” checkbox unchecked. This will create the element for all items.
    • Leave the “Status” set to “Active”.
    • Click the “Add Rule” button to save your work.

    Once that’s done you can click the “Execute” rollover action to run the rule for all items, or use the Bulk Edit/Map Custom Field metadata approach I outlined in my earlier post.

    I hope these suggestions are helpful. Let me know how they work for you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add ALT Text to MLA’s PDF icon’ is closed to new replies.