[theme-reviewers] Per-Post Layout Options

Chip Bennett chip at chipbennett.net
Tue Aug 9 13:04:22 UTC 2011


Justin,

Just a follow-up: thanks for this suggestion. I re-factored my
implementation to use post custom meta rather than Page Templates, and it's
actually *much* simpler now.

I skimmed through your theme-layouts.php implementation, and it seems that
I'm using a rather similar method.

One question: are nonces not handled globally on post.php? I notice you've
added nonce handling to your metabox markup and sanitization functions.

Chip

On Tue, Aug 9, 2011 at 12:36 PM, Justin Tadlock <justin at justintadlock.com>wrote:

> **
> Don't use page templates.  Use post meta.
>
> Suppose the default layout was "content|sidebar".  Further suppose you have
> an "Archives" page template.  Now, what happens if a user wants a
> "sidebar|content|sidebar" layout but also wants to use the "Archives" page
> template?  If layouts are controlled by template, they can't use both.  If
> layouts are controlled by meta, the two can be used together.
>
> This doesn't cross any boundaries to me.  Does the data deal specifically
> with presentation/display?  Yes.  Therefore, it is theme territory.
>
> I don't see this as being any different than using page templates in terms
> of appropriateness.  Themes can include custom page templates, which are
> also saved as post meta.
>
> Anyway, I've been working on a standard for theme developers who want to
> incorporate this functionality into their themes if you're interested in
> checking it out.
>
> http://svn.locallylost.com/themes/hybrid-core/trunk/extensions/theme-layouts.php
>
>
> On 8/8/2011 12:27 PM, Chip Bennett wrote:
>
> Good afternoon reviewers and developers!
>
>  I want to get your input/opinions on something. The next version of
> Oenology will incorporate layout options:
>
>   - Static Page default layout, via Theme Option
>  - Per-Page layouts, via Page Templates
>  - Single Blog Post default layout, via Theme Option
>  - Blog Posts Index layout, via Theme Option
>
>  I am considering adding post meta to allow for per-post layout selection.
> It is simple enough to implement; however, here's my question: would this
> cross the content/presentation line? Or expressed differently: would it be
> inappropriate to add Theme-specific custom post meta in this manner, given
> that such metadata would be mostly useless to the user after switching
> Themes?
>
>  I'm leaning toward the opinion that it would be appropriate, but I am
> concerned about the scalability of Themes filling up the post meta table
> with data that are only useful when using a given Theme.
>
>  Thoughts?
>
>  Thanks in advance,
>
>  Chip
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.orghttp://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110809/0e62c348/attachment.htm>


More information about the theme-reviewers mailing list