• Resolved hjerem

    (@hjerem)


    Hi David !

    I configured MLA plugin to automatically add Att. Categories from IPTC value “2#025 keywords” when importing media. I also classified all these Att. Categories by feature, let me explain:

    All my medias have height filled up in keywords like “1800H”, “1900H”, … I put these height in a parent named “Height”, which gives me:
    Height
    – 1800H
    – 1900H
    – …

    This configuration allows me to to display Att. Categories with mla_term_list, and to exclude those parent with their children easily (without to write each term id but only by adding parent term id to the exclude parameter).

    The problem is, when I import a media with “1800H” keyword and this att categories alredy exists but is a child of parent Height, it creates a new one, which is not the behavior I expect. Is it possible to do that ?

    Thanks!

    • This topic was modified 8 years ago by hjerem.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your question and for all the details of your application.

    As you discovered, WordPress hierarchical taxonomies allow terms with the same name/label to appear as root terms or child terms. You could change your mapping rule and set the parent to “Height”, but then ALL of the IPTC Keywords would become child terms of the Height parent. As I recall, you have other parent/child relationships mixed in as Keyword values; is that right?

    If all of your Keywords are unique, a workable solution would be to first search the taxonomy for an existing term with a matching name and use it if it exists. If not, the new term could be added as a root term or, perhaps, under the term you set in the Parent field in the mapping rule. This would require some PHP code that intercepts the hooks provided by the MLA mapping process.

    Let me know if my assumptions are correct and if the PHP/hooks solution would work for you.

    Thread Starter hjerem

    (@hjerem)

    As you discovered, WordPress hierarchical taxonomies allow terms with the same name/label to appear as root terms or child terms. You could change your mapping rule and set the parent to “Height”, but then ALL of the IPTC Keywords would become child terms of the Height parent. As I recall, you have other parent/child relationships mixed in as Keyword values; is that right?

    That’s right.

    If all of your Keywords are unique, a workable solution would be to first search the taxonomy for an existing term with a matching name and use it if it exists. If not, the new term could be added as a root term or, perhaps, under the term you set in the Parent field in the mapping rule. This would require some PHP code that intercepts the hooks provided by the MLA mapping process.

    Let me know if my assumptions are correct and if the PHP/hooks solution would work for you.

    This solution seems perfect to me ! ??

    Thanks.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your patience while I looked into this issue. I decided that the failure to locate existing child terms during the mapping process in, in fact, and MLA defect. If you do not specify a “Parent” term for a hierarchical taxonomy mapping rule an incoming value should match any term with the same name regardless of where it occurs in the hierarchy.

    I have uploaded A new MLA Development Version dated 20170309 that corrects the problem and should work the way you intend. To get the Development Version, follow the instructions in this earlier topic:

    Shortcode not working in (special) widget

    It would be great if you can install the Development Version and let me know how it works for you. Thanks for inspiring an MLA fix/enhancement.

    Thread Starter hjerem

    (@hjerem)

    It would be great if you can install the Development Version and let me know how it works for you.

    Unfortunately, it’s not working, att. caterogies are still created even if they exist. In which file is this code located ? How do you perform search ?

    • This reply was modified 7 years, 12 months ago by hjerem.
    Thread Starter hjerem

    (@hjerem)

    It’s working now, thanks David ! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘IPTC & EXIF Processing & Att. Categories’ is closed to new replies.