Pods UI: The Latest and Greatest Addition to Pods
Pods makes it super easy to give your clients the upmost control when managing their content. You can custom tailor WordPress not only to power their blog and standard content-heavy Pages, you can give them a Pods installation that helps to manage that one-off group of data that will really help their website completely reflect their business or organization.
If you haven’t followed the first three articles in the Pods CMS Series, I would recommend starting at the beginning with An Overview of and Introduction to Pods CMS for WordPress so you’re familiar with the setup we’re working with up to this point.
Incorporating Pods UI
Pods UI is the latest feature to become available for Pods. It’s the first add-on, and I’m already in love. If you’ve been keeping up with the Pods CMS Series, we discussed the ability to mark a certain Pod as a Top Level Menu in Pods Basics: Installation and Setup. It was a great way to give a particular Pod a bit more attention by including it as its own entry in the WordPress admin navigation.
If you really take Pods under your wing and end up creating numerous Pods to power various sections of a website, and they all carry a certain bit of importance, the main WordPress admin navigation can get quite busy really quick. Pods UI helps tackle that issue directly.
Before adding Pods UI, we can go ahead and remove Team as a Top Level Menu. Just uncheck the box and click Save settings:

Now we’ll go ahead and install the Pods UI plugin, and create our own plugin file that will interact with Pods UI:
<?php
/*
Plugin Name: Team Pods UI
Plugin URI: http://example.com/
Description: Customized Pods UI
Version: 0.1
Author: Jonathan Christopher
Author URI: http://jchristopher.me/
*/
function pods_ui_team()
{
$icon = '';
add_object_page('Team', 'Team', 'read', 'team', '', $icon);
add_submenu_page('team', 'Team', 'Team', 'read', 'team', 'team_page');
}
function team_page()
{
$object = new Pod('team');
$add_fields = $edit_fields = array(
'name',
'position',
'photo',
'bio',
'permalink',
'eom');
$object->ui = array(
'title' => 'Team Member',
'columns' => array(
'name' => 'Name',
'position' => 'Job Title',
'created' => 'Date Created',
'modified' => 'Last Modified'
),
'add_fields' => $add_fields,
'edit_fields' => $edit_fields
);
pods_ui_manage($object);
}
add_action('admin_menu','pods_ui_team');
?>
Note: I’d suggest creating an additional plugin file outside the pods-ui folder you just uploaded when installing Pods UI, else WordPress will think your plugin file is out of date based on the version number.
There is a lot of custom setup going on, all of which is covered in extreme detail in the Pods UI download, but I’ll cover the basics explaining what we’ve set up.
At first glance, this is just a simple WordPress plugin, and it is, we’re simply interacting with the Pods UI plugin as well. The first function that fires here is:
add_action('admin_menu','pods_ui_team');
We’re hooking admin_menu and firing pods_ui_team as a callback. pods_ui_team is defined as follows:
function pods_ui_team()
{
$icon = '';
add_object_page('Team', 'Team', 'read', 'team', '', $icon);
add_submenu_page('team', 'Team', 'Team', 'read', 'team', 'team_page');
}
Pods UI allows you to define an icon file to use in the sidebar, a nice bit of customization available! From there, we fire add_object_page, a Pods UI function that sets up the menu structure and includes the icon we just defined. This creates a ‘section’ in the WordPress admin navigation sidebar. add_submenu_page then adds a submenu entry to the sidebar section we just created. The last parameter we pass when firing add_submenu_page defines the callback we’d like to fire when that menu is clicked. That’s the other function we need to define in our plugin file:
function team_page()
{
$object = new Pod('team');
$add_fields = $edit_fields = array(
'name',
'position',
'photo',
'bio',
'permalink',
'eom');
$object->ui = array(
'title' => 'Team Member',
'columns' => array(
'name' => 'Name',
'position' => 'Job Title',
'created' => 'Date Created',
'modified' => 'Last Modified'
),
'add_fields' => $add_fields,
'edit_fields' => $edit_fields
);
pods_ui_manage($object);
}
In this function, we define a series of variables. We first define our $object as the Pod with which we’d like to link this UI element. We then define $add_fields as an array of columns we’d like to include on the ‘add’ screen. We can include or omit any existing columns we’d like. In this case, we’ve added all available columns. Next, we define object->ui which actually builds the ‘browse’ table view listing out any existing Pods data. We can define which columns are visible (and therefore sortable) which is very useful! Finally, we fire pods_ui_manage($object); which makes all the magic happen, and we have even more useful sidebar entries for our Pods.

While not completely obvious with just a Team Pod, the real beauty of Pods UI comes when you group a selection of Pods under a generic heading. These cases are usually very client-specific, but can really make the usability of Pods that much better.
This article is meant to be the most basic introduction to Pods UI, I would absolutely suggest checking out the User Guide for further information.
The Pods CMS Series on MBN
This article is the fourth in a series for Monday By Noon dedicated to Pods CMS.














济南二手房网慢慢走向正规了,博主做的也不错,支持一个。
Johnathan, your intro to Pods UI couldn’t have come at a better time. I was looking to create a way for a client to access and update records in a database via WordPress and Pods looked like a good way to make that happen.
Your Pods UI walkthrough was an invaluable way to get up to speed quickly and whip this out.
Thanks!
This is fantastic!!! PODS is a great tool. I’ve used it in several of our installations but, ended up straying away from it because of the lack of UI options. This seems to bridge the gap between developer and client!!
I’m getting this error
Fatal error: Call to undefined function pods_ui_manage()
Why?
Oh, I got it. because i hadn’t downloaded the Pods UI package.
I fixed that problem : )
Can you explain a bit further how to set up a pods ui plugin, or point me to a documentation resource? I can’t seem to understand how pods would pick up a plugin file in the wp-content/plugins folder.
No problem! You simply create a new plugin file entirely in the plugins folder, just a plain text document and name it something unique. I usually choose something like client-ui.php or something similar. You can even paste the code from above in the file, save it, and WordPress will see it as a plugin inthe admin. Does that help a bit? I can elaborate further if you’d like.
Jonathan,
In your example the *manage team* page has a button labled “Add New Team”, I don’t suppose you know how you could change this to read something more meaningful like “Add New Team Member”?
Ignore my previous comment,
If I had only spent 5 minutes to RTFM I would have discovered that the pods_ui_manage() takes a whole host of options including one to change the name of an individuam pod item.
In case anyone else is looking to do the same thing you can pass a value to the ‘item’ parameter like so:
pods_ui_manage('pod=team&item=Team Member');Glad you found the documentation to be helpful!
Great tutorial! Quick question, I have a file column in my POD that contains the URL of an image. How would I display that image in the list of results on the admin page? Currently it just displays the URL path, but I can’t figure out how to wrap it in an IMG tag.
Thanks for these tutorials, since especially Pods UI supports very little information about how to use their plug-in.
I have a problem though – maybe you can help me!
I have a pod which makes contact persons… when you add a new contact person you need to define a group … I have made this field a wp page sellection when post_parent id is equal to the contact page.. that means if they want more groups they simply add a new child page to contact and it will pop up in the group sellection when adding – very smart!
Now the thing is Pod UI… I would like to make it possible to do the drag and drop reorder feature but for each group.. Can you find a way to tackle more tables under same Edit page? or at least a sub page for each group…?
I hope it is possible to understand my English..
Once again thanks for the tutorials/guides!
Fairly good article on a technical level but it misses on one important thing. I had to read it a few times before I could figure out on a practical level what Pods UI is and does. When looking for content, most readers are trying to solve a specific issue. When they find something that seems to solve the issue, they read further. So it is helpful to preface the technical stuff with a description of what all the hard work will produce.
What is the issue you were looking to solve when you came upon the article?
Thanks for the tutorial. I am not well versed in WP by any means, however I did want to clarify that these functions:
add_object_page();
add_submenu_page();
are not Pods UI functions, they are WordPress functions. So for newbies like myself looking all over the Pods UI site for some documentation on those functions and not finding anything, you’ll find out about them in the WordPress Documentation.
http://wpseek.com/add_submenu_page/
http://wpseek.com/add_object_page/
Thanks!
Wow, great information. I have not any clue about wordpress future like that. Make me , think about wordpress more.
I will try to expand my wordpress blog as soon as possible.
Thank , Jonathon
Does Pods UI have any way to FILTER the displayed results based on a certain field (or fields), maybe with dropdowns the way wp-core has for Categories?
Yes absolutely — the third parameter of findRecords() is a WHERE clause that you can use to target what data you’d like.
Sorry not sure I understand yet. Is findRecords() for displaying pods content on the front-end of the site to the public? I’m looking at the screenshot above, of the Admin > Manage Team page. If that page listed dozens of results (team members), I’d want a dropdown above the list to filter by Job Title (for example), so I could find just the team members who have Job Title = Web Developer. But I don’t see a UI for that. Are you saying that findRecords() must be called before this page is displayed? If so, how/where is that done? I hope I’m being clear enough. Thanks!
can this line:
$object = new Pod(‘team’);
be altered to call more than one pod?
Is there a way to call more than one pod at a time?
OK, I’m really sorry to ask such a basic question, but I honestly couldn’t get the custom icon feature to work.
Could you please explain where should I place the icon file? and also how should I reference it ?
This is how I referenced it in the plug-in:
function pods_ui_team()
{
$icon = ‘customicon.png’;
add_object_page(‘Team’, ‘Team’, ‘read’, ‘team’, ”, $icon);
add_submenu_page(‘team’, ‘Team’, ‘Team’, ‘read’, ‘team’, ‘team_page’);
}
I placed the file in:
\wp-admin\images
\wp-content\plugins\pods\images
\wp-content\plugins\pods-ui
\wp-content\plugins\pods-customized
but nothing seems to work
I’d really appreciate your help, Thanks!
Armando:
I get the icon work when I type in an absolue URL, might that be the prob. in your case? Then it really wouldnt matter where you place the file.