• Hi – apologies if this has been done before. This isn’t a feature request as it’s not really important to me at all but just a question to see if it’s possible with MLA right now.

    As far as I understand the way conditions work in content templates is:

    (if isset value then display it) else (do something else)

    Are there other possibilities/operators with conditionals – e.g.:

    (if isset value then return true) else (do something else)

    ? I was thinking attachment_tag would be ideal for this – to do something like (in my imaginary language):

    ([+terms:attachment_tag[‘nodate’]+])|([+iptc:DateCreated+])

    meaning:

    (if tag with name ‘nodate’ is set then return true) else (display iptc:DateCreated)

    I guess this opens a whole Pandora’s Box of language possiblities though which really go beyond what might be deemed necessary!

    https://wordpress.org/plugins/media-library-assistant/

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

    (@dglingren)

    Thanks for your question and for the example you included. The current production MLA version does not have anything like what you’ve outlined but the latest Development Version dated 20160604 adds “custom data sources” in response to this earlier topic:

    Parent category tag

    With this new feature you could implement a custom format option to get the results you want, e.g.:

    ([+terms:attachment_tag,assigned('nodate')+])|([+iptc:DateCreated+])

    The assigned('nodate') custom format could return “true” or “nodate” or anything you like when the nodate term is assigned to the item’s attachment_tag terms.

    I am marking this “not a support question” since it isn’t a feature request, but thanks for another example of how this new MLA feature might be used.

    Thread Starter Rufus McDufus

    (@rufus-mcdufus)

    That looks absolutely perfect – many thanks David!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Content Template conditional question’ is closed to new replies.