Blog

Complex Pods Shortcodes

Someone on twitter recently said that WP and Pods coding was uglier than ExpressionEngine. Now, we all know it’s a bit different since EE coding isn’t straight PHP so it’s not a perfect comparison, but it got me thinking since the WP Shortcode API allows for similar stuff to this, perhaps we can do something like this with a more complex shortcode for Pods?

http://pastebin.com/AhEpymcQ

UPDATED @ 10:34pm

This looks like the best bet for the update, anything more complex would be more than we can worry about for 2.0, so this is what we’ll be adding – the ability to include template syntax / html within the Pods shortcode instead of an external template with the template=”template_name” attribute in the shortcode.

<ul>
[ pods name="friends" where="t.active=1" limit="4" ]
<li>{@name}</li>
[ /pods ]
</ul>