Revisiting Pods and Beaver Themer; Conditional Field Connections
At the last WordCamp Kent, I gave a presentation about building darn-near any kind of website using Pods and Beaver Themer. Someone had asked why I preferred Pods for custom post types and custom fields to ACF & CPT. I didn’t have much of a preference back then, except for the benefit of managing everything within one plugin rather than 2.
I have come to find one vital limitation with Pods and Themer though – testing conditionals for values. With Pods and Themer, you can only do all-or-nothing conditional field connections in a shortcode; “if there is something in this field, then display this”.
[wpbb-if post:pods_display field='field_name'] <ul> <li>If there's something/anything in that field (field_name), this content will show.</li> <li>If it's blank, this list will not appear.</li> </ul> [/wpbb-if]
This is valuable when you don’t want a blank space to appear. However, if you need it to be value-based, Beaver Themer can only help you if you’re using ACF. I’ve come across a few instances where I need content to change based on a toggle or radio button; relying on a “yes/no” rather than a yes/null.
There is a lot you can do with conditionals, especially if the field is numbers rather than text. I haven’t come across a scenario yet where I needed the content to change if the field value was less-than or equal to, say 100, but here’s an example from a site I built, partakekitchen.com:
[wpbb-if post:acf type='radio' name='vegetarian'] <div class="mp-label">Vegetarian</div> <img src="/wp-content/uploads/2019/03/vegetarian-icon.png?189db0&189db0" alt="Vegetarian"> [/wpbb-if]
In this example, if the menu item is labeled Vegetarian, the little vegetarian icon appears.
I felt like I had to do excessive digging to find out that I couldn’t do this with Pods. Any time I have to dig, I have to write about it! So let it be known, value expressions, like those discussed in this Beaver Themer knowledge base article, cannot be performed with Pods custom fields. Only with ACF or Toolset (though I have no firsthand experience with Toolset).
There is, however, a wealth of information in the Beaver Builder KB on using ACF. So much so that they put together a collection of ACF-related field connection KB articles. Then there’s the one little “Build This” article on using Pods and Beaver Themer.
This is not to say that it can’t be done! I know there’s a lot you can do with Pods templates, though I haven’t had any luck using them in Themer. There’s also a thing called Meta Box which has been paired with Pods, but I couldn’t find anything easily digestible on it.
There is a lot of information on the Pods website, but most of it seems to require a lot of advanced WordPress development knowledge. I can handle a little PHP customization, plug-in creation, but I don’t have a good enough grasp on it to freestyle write PHP. That’s why I use a plugin for my custom post types in the first place!
About the Author
I'm Abby (Armstrong-Lehman) Buzon, Lead Designer & Owner of The Helpful Marketer, based in Medina County, Ohio. I got my start in marketing and website administration in 2010, became a mom in 2015, and left my day job in 2017 to begin The Helpful Marketer. I'm happier than I've ever been and I truly love what I do, so I'm here to share my story and give some marketing tips along the way!