[wp-trac] [WordPress Trac] #4148: Suggestion of a new category structure

WordPress Trac wp-trac at lists.automattic.com
Sat Apr 14 22:32:28 GMT 2007


#4148: Suggestion of a new category structure
-------------------------+--------------------------------------------------
 Reporter:  hovenko      |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  2.3      
Component:  General      |     Version:           
 Severity:  normal       |    Keywords:           
-------------------------+--------------------------------------------------
 I personally don't like the way wordpress presents categories, with URLs
 such as "http://example.tld/category/some-category", and especially not
 the possiblity to put a post inside several categories. That's a job for
 tags. Therefore I suggests a new category structure where we use a page as
 the parent (or category) of posts.

 == URL hierarchy ==
 Pages gets a URL like "http://example.tld/my-page". By using a page as the
 category of our post we can have a URL like "http://example.tld/my-page
 /my-post" or "http://example.tld/my-page/2007/04/14/my-post for our posts.
 As a bonus the "category" page would work as
 [http://www.memwg.com/blog/adsense/Easy-SEO-Siloing-for-WordPress-
 Users.html SEO Siloing].

 == New page template ==
 This would also bring up the need for a new page template similar to the
 archive template, where the latest posts inside the category/page can be
 displayed together with the content of the page. An example would be that
 the five last posts in that category/page could be listed beneath the page
 content. This would replace the category templates where the file name of
 the template files ends with the ID of the category, such as "category-
 14.php", which is much harder to maintain on a page with many categories.

 == Post templates ==
 With this solution the posts will have only one category, the page it was
 assigned. That way it is possible to have post templates based on the
 nicename of the page. This will solve the problem that I have today when I
 need different layout of my posts based on which category it belongs to.

 == Default page for posts ==
 The default category for posts will then (of course) be the front page,
 and a post on the front page will get a URL as "http://example.tld/my-
 post".

 == Database structure ==
 Posts and pages uses the same database table ($wpdb->prefix . 'posts') and
 we then need a link between a post and a page to make this relation
 possible. My purpose would be to create a new table ($wpdb->prefix .
 'post2page') to handle the relation between posts and pages where we will
 have two columns, one primary key that would be the "post_id" and the
 other would be the "page_id", both referring to the same posts table and
 the column "ID". This is because I want to leave the posts table as is and
 as well making it easier to extend this relation later on.

 == Category management ==
 There would then be no need for the categories as we know it from todays
 WordPress. Tags, that will come with the WordPress 2.2 release, will be
 able to replace the functionality of adding a post to multiple categories.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4148>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list