[wp-hackers] Post/Page "Types"?
Peter Westwood
peter.westwood at ftwr.co.uk
Sat Nov 1 10:35:50 GMT 2008
Mike Schinkel wrote:
> Hi All:
>
> I've been working with Drupal for 1.5 years but was recently developed some
> plugins for WordPress and came away liking WordPress an awful lot.
>
> Still there are some things Drupal does that WordPress doesn't do that I
> need for future WordPress projects and I was wondering if anything like this
> has been discussed in the past and/or if there is a plugin I'm not familiar
> with that addresses this.
>
> First some background for those that don't know Drupal. In WordPress you
> have the "wp_posts" where either "Posts", "Pages", or attachments are stored
> (if I understand correctly.) In Drupal there is a table analogous to
> "wp_posts" called "node" where all content is stored. In Drupal "node"
> table's "type" field is similar to WordPress' "post_type" field in the
> "wp_posts" table. Yet unlike in WordPress where you have first-class Posts
> or Pages, Drupal can have an infinite number of different "content types" so
> that there are no "special" types in Drupal (even though there are some
> default types like "Page" on installation.)
>
> Let's say I wanted to create a website listing companies like you might find
> at http://crunchbase.com. In Drupal I'd use the CCK module and create a new
> content type called "Company" and define the additional fields I'd want for
> the company. In addition I'd be able to create a theme template that is
> specific to a node of type "company."
>
> It would be really useful if I could do something similar in WordPress, for
> example say I could create a "company" post_type and store in the "wp_posts"
> table but as a "company" and not as a "post" or "page" yet I'd still be able
> to use features like categories and tags. Further I'd want to define custom
> fields that would apply to just each company (like "CEO name", "Phone
> Number", etc.) and then be able to create a theme template that would apply
> to a company and a URL that would apply to a company.
>
> What are your thoughts on this? Is anyone trying to address this with any
> of the existing plugins and/or with future plans for WordPress. Further,
> does it make any sense in future versions to genericize posts/pages and
> allow a power user to configure them in the admin where each "post type"
> would get configured to have a defined set of URLs, and logic like "Uses
> Tags", "Uses Categories" etc?
>
> Thanks in advance for the help and discussion.
>
From memory the table structures would allow this fine if you want to
do it in a plugin.
You would need to provide admin pages and query extensions and template
extenstions though.
westi
--
Peter Westwood
http://blog.ftwr.co.uk | http://westi.wordpress.com
C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5
More information about the wp-hackers
mailing list