[wp-hackers] Page Templates vs Category Templates

Mike Schinkel mikeschinkel at newclarity.net
Thu Dec 2 03:42:04 UTC 2010


On Dec 1, 2010, at 10:18 PM, Haluk Karamete wrote:
> I see your points. But I still do not get why have "that convenient
> functionality" in one ( that is Add New Page UI ) but not in the other
> ( that is Add New Category UI).

Because the functionality evolved, it wasn't built to a master plan (like almost all open-source software.)

We (the WordPress community) haven't gotten there yet. Maybe we will, all depends on what the core team thinks is important and if someone builds it to contribute.

> You are saying "The template-file functionality is exactly the same
> for Categories; the difference is only in the UI." I'm asking Why the
> UIs are different...

Because the implementations are different and grew out of different paths.  And in part because the requirements are different.  A category archive page displays a list of posts, a Page Template typically only displays one post.  That's not a defense of it, just an explanation as to why it might be the way it is.

> You may ask who cares...  new comers may. me for sure. I'm sure most
> users go thru this kind of cycle.

Frankly I'm not a new comer but I could see value in it too.  But my seeing value is not the same as me recognizing why it is not there (yet?) and the process required for something to get included. Believe me, I've gone down the path of advocating for a feature only to have it shot down so I know about the process first hand.

> Then you look back into your categories and wonder why on earth this
> functionality why the lack of those various page layouts options DO
> NOT EXIST for categories even though it is EQUALLY & EASILY achievable
> by WP.

One of the other reasons is URL routing. Currently the URL routing system views a category URL to be very different from a page URL.  Pages that users add as content are managed by users, and pages that come for free as part of the architecture are managed by WordPress core.

Again, it is what it is.

> And interestingly, cats are the 1st group where you need this
> kind of flexibility, I think more than the pages...  Why should not I
> have a no sidebar ( just content layout ) for some of my category
> pages...  but you look at the themes world, majority provide a
> no-sidebar layout only for the pages but cats are totally left alone.
> I think this end-result may be trickling down from the out-of-the-box
> WP UI which exposes Page layoutsbut not the cat layouts.

If you need this functionality today if can be done but would have you implement a Page Template that lists your categories and then you create a Page for this and renamed your category slug something obscure.  You may also need to write a bit of PHP to hide tell WordPress your category URL is the URL of the page.

Again, it's just not part of WordPress today.  But it is doable.

> I'm sure Jane must have thought about this and decided the way it is
> now. I'm only curious to understand the wisdom behind it.

I'm pretty sure this was baked into WordPress long before Jane joined.  Or at least before she had dealt with bigger issues.

> I amy be wrong, but it just appears to me that if the next version
> were to expose this functionality, it would not only make it
> convenient to the end user to select a category template from the drop
> down but also encourage the theme designers to bundle their themes
> with as many category layouts as the page layouts they provide.

It's all about priorities and frankly developer interest.  

Expect a post from Jane after v3.1 releases asking what they community wants next.  If it seems that many in the community it and some developers are excited about it, maybe something like this will make it into core.

Hope this helps.

-Mike




More information about the wp-hackers mailing list