This post is continued from previous post: Create and manage new pod
In this post this is what we will do :
- Create new template file to display pod items
- Enable Pages component , create new page for pod
- Edit template file to list items.
Create new template file to display pod items
Create a new php file in current used theme directory.
Name your template file wirelesskeys.php so it would be easier to find it later.
In that file, in comment section you can put template name as: Wireless keys List so when you want to assign template for pod page it will displayed as Wireless keys List .
Here is the source code of wirelesskeys.php :
Save this file.
Enable Pages component , create new page for pod
Login to Admin Dashboard
Go to Pods Admin and click Components . You will see this item in list.
Click Enable to enable Pages component
Now we can create new page for this pod.
By creating a page for pod will enable us:
- To set it’s URL
- To assign template to display pod items
After enabling Pages component, you will see Pages menu below Components menu.
Click Pages .
You will see this page.
Click Add New to add new page.
You will see add new pod page.
We only need to set three fields. Which is :
- URL, so we can view pod items
- Title, so the page will have title
- Template, so we can assign which template to use, and to write query or anything just from template file.
Set required fields like below:
We are done with this. Click Publish to publish this page.
Edit template file to list items
Now we are going to dispay pod items in a table .
Replace wireleskeys.php with this:
You can read more about querying and displaying data here
And.. we are done with this post.
We will continue this module in next post, I haven’t think about it yet.
Probably can do this:
- Find out how to connect one pod with another (Just like how you assign foreign key from one table to another )
- Find out how to display other template in another
- Display pagination
Here is how it look like:
Working example can be found here: http://mweldan.com/wirelesskeys
Thank you for reading.