Title: Content Template conditional question
Last modified: August 31, 2016

---

# Content Template conditional question

 *  [Rufus McDufus](https://wordpress.org/support/users/rufus-mcdufus/)
 * (@rufus-mcdufus)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/content-template-conditional-question/)
 * 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/](https://wordpress.org/plugins/media-library-assistant/)

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

 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/content-template-conditional-question/#post-7443481)
 * 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](https://wordpress.org/support/topic/parent-category-tag?replies=5#post-8486014)
 * 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](https://wordpress.org/support/users/rufus-mcdufus/)
 * (@rufus-mcdufus)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/content-template-conditional-question/#post-7443491)
 * 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.

 * ![](https://ps.w.org/media-library-assistant/assets/icon-256x256.png?rev=973502)
 * [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-assistant/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-assistant/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-assistant/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-assistant/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-assistant/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Rufus McDufus](https://wordpress.org/support/users/rufus-mcdufus/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/content-template-conditional-question/#post-7443491)
 * Status: not a support question