• Resolved cuckoofairweb

    (@cuckoofairweb)


    Hi , firstly let me just say the MLA is an excellent plug in and the support you give is first rate.

    I have been using it for some years to automatically update WP tags/categories using information from PDFs to enable sorting and filtering. If anyone is interested an easy way to get the info into the PDF is to use Document Properties fields available in the original source word processor/spreadsheet/slide etc. I use Office and it is an easy way of getting basic info into the PDF.

    I am now about to embark on (for me anyway) its real use as we’ve got 1000+ photos going back 40 years of the cuckoo fair.

    What I want to do is to update the metadata on the PC/MAC (exiftools/csv-files have been mentioned – any others) upload the photos, have the categories updated to sort and filter the photos that are then displayed using a viewer front end (eg https://justifiedgrid.com/?). This will hopefully mean anyone can prepare their photos offline knowing that the website will take care of filtering and sorting the photos for display. I have no wish to use slideshow plug-ins where you manually pick the photos!

    So now some really basic questions:
    1 If I enable automatic processing on upload can this be turned off for different types of images. eg I want to process the photos (all JPG) but not the images used on the web-site (all PNG).
    2 I’d like to be able to filter the images by date. As the fair is only on for 1 day but has say a week before of prep and a couple of days afterwards. How do I do the date filtering for a two week period? Or do I just set a field to the year?
    3 The filters required are quite basic eg location (1 of 8 choices), who is in the photo (either General public, Fair Team or name of performer/band), year (eg 2019, 2020) plus maybe a copyright statement if required by the photographer and maybe a Caption. Are these best left in separate fields or combined?

    Many thanks

    Paul

    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 the positive feedback on the plugin and its support; much appreciated.

    Regarding gallery display tools, Justified Image Grid is an excellent choice with good support for MLA. There are a number of other gallery and lightbox plugins that can be used with MLA’s mla_alt_shortcode parameter to combine MLA’s data selection features with more elaborate gallery display features. You can find more information in the “Support for Other Gallery-generating Shortcodes” section of the Settings/Media Library Assistant Documentation tab. Here’s a link to an earlier topic that contains a list of similar topics:

    Slider gallery plugin

    Regarding your questions:

    1. Selective processing by image type. The current MLA version does not contain and specific features to turn metadata mapping on or off depending on the image type. You could easily add this by implementing a small custom plugin that uses the hooks MLA provides to disable one or more rules based on image type. See the “MLA Custom Field and IPTC/EXIF Mapping Actions and Filters (Hooks)” section of the Documentation for more information, and search the Example Plugins for “mapping”.
    2. Filtering by date. You can use the WordPress Date Query to filter gallery items in a wide variety of ways. See the “Date and Time Parameters, the ‘date query’ ” section for more information and links to the WordPress Codex documentation.
    3. Filters required. These are best implemented as separate fields. The “location” could be a custom field or a taxonomy term. The “Caption” could be the built-in caption/excerpt field or a separate custom field. The others are best implemented as separate custom fields.

    I hope that gets you started with your application. I am marking this topic resolved, but please update it if you have problems or further questions regarding the above suggestions. Thanks for your interest in the plugin.

    Thread Starter cuckoofairweb

    (@cuckoofairweb)

    David,

    Hi, I’ve had a look at the “Date and Time Parameters” in the documentation and then links out to wp_query – which links out to https://developer.www.ads-software.com/reference/classes/wp_query/#date-parameters but that rapidly descends into coding eg:
    $args = array(
    ‘date_query’ => array(
    array(
    ‘year’ => 2012,
    ‘month’ => 12,
    ‘day’ => 12,
    ),
    ),
    );
    $query = new WP_Query( $args );

    It’s not clear to me what code is needed and then I can add code into MLA itself.

    I did find this in the section on long shortcodes:
    [mla_gallery]
    tax_query=”
    array(
    array(
    ‘taxonomy’ => ‘attachment_category’,
    ‘field’ => ‘id’,
    ‘terms’ => array(11, 12)
    )
    )”
    post_mime_type=image/png link=file
    [/mla_gallery]

    so could my one look like to display all photos taken in 2012:

    [mla_gallery]
    post_parent=all
    attachment_category=’test’
    date_query=”
    array(
    ‘field’ => ‘DCF-Date-Taken’,
    ‘year’ => 2012
    )”
    post_mime_type=image/jpg
    link=file
    [/mla_gallery]

    Plugin Author David Lingren

    (@dglingren)

    Thanks for investigating the date_query and your update with the details on what you are trying to accomplish. Your example includes ‘field’ => ‘DCF-Date-Taken’, which looks like a reference to a custom field you have created; is that right?

    The WordPress date_query does not support custom fields and does not have a field parameter. The documentation states:

    • column (string) – Posts column to query against. Default: ‘post_date’.

    The phrase “Posts column” means a column in the posts database table, so the date_query is limited to post_date, post_modified, post_date_gmt and post_modified_gmt.

    To query on a custom field such as your DCF-Date_taken you can use the meta_query parameter, which has a slightly different syntax. More information can be found at:

    https://developer.www.ads-software.com/reference/classes/wp_query/#custom-field-post-meta-parameters

    Of course, this documentation descends into coding pretty quickly, too. For your example you can try something like:

    [mla_gallery]
    post_parent=all
    attachment_category='test'
    meta_query="array( array( 'key' => 'DCF-Date-Taken', 'value' => array( '2012-01-01 00:00:00', '2012-12-31 23:59:59' ), 'compare' => 'BETWEEN', 'type' => 'DATETIME' ) )"
    post_mime_type=image/jpg
    link=file
    [/mla_gallery]
    

    A similar query is working on my test system, albeit with different category and field names. If it doesn’t work for you, post a few examples of the values in the DCF-Date-Taken field; the format may be a problem.

    Let me know if you have problems or further questions regarding the meta_query and the above suggestions. Thanks for your persistence.

    PS – I am in California and we are about to lose power for a few days, so there may be a delay in my next response.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘End to end Processing of photos’ is closed to new replies.