Simpods Linked Areas (Figure 1) is similar to Simpods Hierarchy. The only difference is that Linked Areas allows many to many structure. In some way, you can use Linked Areas as Hierarchy if you are careful enough. The benefits are:
Figure 1. Simpods Linked Areas
Dependencies
The Simpods Hierarchy functionality requires the Pods Framework plugin to be installed, along with the “Advanced Content Type” and “Table Storage” components
How to use it?
There are three fields to set:
Let’s learn it from an example: we are a jobs site and we don’t need to create pages to explain each individual category and sub-category. As we know, one job can be assigned to a few categories, and these categories can be assigned to bigger categories, so they are in many to many structure. For instance, a job Graphic Designer can be assigned to sub-categories Game Design, Animation and Illustration. Animation and Illustration can be assigned to bigger categories such as Advertising. Now let’s go to Pods Admin – Add New to create three new pods: Jobs, Job Sub-Categories and Job Main Categories (Figure 2).
Figure 2. Add New Pod
We will pick Custom Post Type and Table Based storage for Jobs, as we need to create pages for them, but Advanced Content Type for Job Sub-Categories and Job Main Categories for the opposite reason (Figure 3).
Figure 3. Create New Pod
Now if you go to a job, you can find a Linked Area box on the right to assign your posts to (Figure 5).
Figure 5. Assign Linked Areas
A filter will also appear on the posts list (Figure 6) to filter posts by the parent category.
Figure 6. Simpods Linked Areas filter
Coding
If you are using simpods_select()
, in your code, do the following to pull out data with its category. In our example above, the Pods table is pods_module-page :
Do the following to pull out data in a category. Replace {Job Pod ID}
with a real Pod ID and {Job sub category ID}
with a real job sub-category item ID: