Creating a new content type
To create a new content type, use the core_usercontent pod as an example. This pod contains several files, including generic handlers for adding and editing content, viewing permalinks, viewing lists of content, adding comments, add accepting votes.
You can customize the content type by editing a simple config file and creating a few templates in your theme! However, you'll probably want to dig deeper into the code to add special functionality.
1) Copy core_usercontent pod to a new name
cp -R core_usercontent content_post2) Edit the content_type.php file. This file contains information used by all the other files.
Set the $content_type variable to a short name for the new content type. No spaces!
$content_type ='post';
Set the $permamlink variable tp first part of the permalink. This will be used to make links to each piece of content, as well as to the list of most recent content. We'll use "blog." This means we can get a list of new posts at /blog and each post will be located at /blog/title-of-post
$permalink = 'blog';
Set the edit/add url. This means I can go to /edit to create a new post.
$edit_link = "edit";
Change the name of the edit form template. This template will be located in the theme/content folder and will be used on the add/edit page
$input_template = 'postform';
Change the name of the default output template for the content permalink:
$output_template = 'post';
Change the $pod_dir variable to the same name as the folder you created in step 1.
$pod_dir = "content_post";
3) Go into your theme content directory. Copy editform.php to the new template you referenced in step 2.
cp editform.php postform.php
4) Make changes to the form design and fields.
You can create meta fields by naming them meta_fieldname
You can attach files by simply creating file inputs. The files will be named the same as thing as the input.
For example, if we wanted to add a meta field named "Via" we could add this to our form:
<input type="text" name="meta_via" value="" />
5) Copy output.php to the the new template you referenced in step 2.
cp output.php post.php
6) Load the PeoplePods Command Center, go to Options->Plugin Pods and turn on your new custom content type pods. They'll be called contenttype_YOURCONTENTTYPE_add, contenttype_YOURCONTENTTYPE_edit, and contenttype_YOURCONTENTTYPE_list.
7) Navigate to your new add/edit screen. You should see your new form. Create your first test post!
8) Your new post should show up at the top of your content list. Click on it. You should see that it goes to a new permalink url as descrived in step 2. But the template is the generic template!
9) Go back to your theme directory and customize post.php
VOILA!
You may want to change the access restrictions on your new content type pods. For example, you may want to restrict the add/edit pod to admin users. You can do this by changing the 'lockdown' parameter in the pod files.
Download the latest version of PeoplePods!
0.9
Latest Version:
Release Notes
Recent Posts from Our Blog
Version 0.9 is here!
The latest version of PeoplePods is now available for download! This version features a drastically revamped theme which is now valid HTML5, a completely rewritten JSON-powered API, many...
Ben Brown on how running a community is like throwing a giant, never-ending party
An interview I did with OpenSource.com is now online! Read it here. In it, I discuss how running an online community is like throwing a giant, never-ending party, how open source techniques...
Recently Updated Documentation
Recent Posts from The Forum
I can't verify my account :(
1 comment | 20 hours ago
Jquery UI problem. I having an issue for implementing UI on my theme, all reference are ok (304) on net console. http://un1v.altervista.org/ I have...
0 comments | 5 days ago
Can anybody tell me which hosting using for PP and it working good? I tryed to much (i think good) hoster and still have no site on PP :( Tell me...
0 comments | 8 days ago


No comments have been posted yet.