• Resolved Greg_R

    (@greg_r)


    David, I have created a custom field that is supposed to populate from the Template field, in which I have entered ‘[+dimensions+]’, and even though I have set it to be available as a column, it is empty. Let me know what you think my mistake might be.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Greg_R

    (@greg_r)

    Nevermind, I discovered that I have to ‘Execute’ the custom field. I thought that dimensions was a native attribute that didn’t have to populated, but for whatever reason, it works now.

    I am still unclear on the difference between a custom field and a mapping rule, and I don’t really understand yet how to get a mapping rule to copy a value from one field to another, but I’m working on it.

    Plugin Author David Lingren

    (@dglingren)

    Good to hear from you. Thanks for working through your issue and solving it before I could respond. The IPTC/EXIF and Custom Field mapping rules are powerful but they can be hard to understand at first. Also, they were added to MLA at different times and have historical quirks.

    The basic purpose of the rules is to extract information (metadata) from the image/PDF file and copy it into the database where it can be used for queries and display purposes. The IPTC/EXIF rules can populate standard fields such as Description, taxonomy terms and WordPress custom fields. The Custom Field rules were introduced and give support for displaying custom fields in the Media/Assistant submenu table and adding them to the Quick and Bulk edit areas.

    As you discovered, both kinds of rules require you to “execute” them when they are first added so existing items are updated. You can check the “Enable” boxes to apply them automatically to items added to the Media Library in the future. Executing the rules copies the metadata from its source into a database field that WordPress can access, such as a custom field.

    Most of the data sources do not change once the item is in the Library, so a one-time copy operation is efficient and effective. Some data source values can change, requiring you to re-execute the rule. For example, if you changed an item’s parent post/page several of the parent_ values would change as well.

    You mentioned “the difference between a custom field and a mapping rule“. A mapping rule defines what to copy and where to put it. A custom field is one of the places to put it.

    The Settings/Media Library Assistant Custom Fields tab allows you to define mapping rules from many “data sources” to WordPress custom fields. For your particular field you could select “dimensions” from the Data Source dropdown control and avoid the need to define a template using [+dimensions+]. You do have to scroll down a bit to find “dimensions” in the list because I tried to group the sources logically.

    I hope that gives you a better idea of the mapping rule concepts. I will leave this topic resolved, but please update it if you have problems or further questions regarding the above material. Thanks for your continued interest in the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can I add a sortable Dimensions column to the Admin?’ is closed to new replies.