WordPress.org

Ready to get started?Download WordPress

Ideas

Custom fields within theme templates

  1. gavinsmith
    Member

    12345

    We all know that using custom post meta fields for clients' sites is not user friendly. These things should be self-explanatory. That said, that's often the solution to page templates with multiple columns of complex layouts. My proposal is simple - the ability to use hooks like page_init with functions like add_meta_box within a theme's template files (defined via Template: Templatename in the file comments) to add inputs only to pages that have the template assigned to them via the dropdown, similar to how you do so with custom content type definitions in WP 3.0+.

    Please let me know if you'd like further explanation. It seems like an extremely logical feature and I've encountered scenarios countless times where this would be the optimal solution.

    Posted: 3 years ago #
  2. wesbos
    Member

    12345

    YES YES YES!!

    Posted: 3 years ago #
  3. I think they are often unfriendly because most theme developers don't take the time or put forth the effort to modify the Add/Edit Post/Page pages so that they prompt the user for input for the custom fields with complete descriptions of what should be entered and then take care of naming/saving/updating the post meta fields.

    Themes like Thesis from DIYThemes do a great job with this. Almost everything you need to customize Thesis (including custom fields on posts/pages) are accessible via customized admin screens.

    Not saying your suggestion is bad, just that the better theme developers don't seem to have a problem integrating custom fields in a user friendly way.

    Posted: 3 years ago #
  4. Mark
    Member

    12345

    I agree. Solving this does not require changes to the WP core, just to theming and plugin practices.

    Posted: 3 years ago #
  5. Franz Josef Kaiser
    Member

    12345

    A more easy way to modify the admin would be highly appreciated. Thesis is a bad example. The first versions haven't been capable to do this. The author can only do this, when he got a lot of people who buy his premium themes or he got extremly well paying clients, which most people don't have. So i give it a 4-star rating, because we really need an easier API for option pages and for modifying the backend itself (think about backend themes).

    Posted: 3 years ago #
  6. gavinsmith
    Member

    12345

    I've never used Thesis (though I'm well aware of what it is), so pardon any ignorance, but I believe this has a lot of merit beyond what it accomplishes and at the VERY least makes it a MUCH simpler task than what is involved in building a framework like that.

    If in a theme template file you are simply able to use an equivalent of add_post_meta, this eliminates ALL issues regarding content placement and formatting for the client/user. It is crystal clear what's happening to a user who even barely understands how to apply a page template, does not seem like a massive implementation on the core, and is almost trivial for the developer. I think the value is huge.

    Thanks for the feedback!

    Posted: 3 years ago #
  7. Angry Creative
    Member

    12345

    right niw Im using the simple fields plugin. would love to see a full api for this.

    Posted: 2 years ago #
  8. lonchbox
    Member

    is not the same as using custom metaboxes?

    Posted: 2 years ago #
  9. Angry Creative
    Member

    12345

    Yes, same thing.

    Posted: 2 years ago #
  10. gavinsmith
    Member

    12345

    Not the same, no. The basic piece custom meta boxes lack is binding them to templates. That's what I've proposed. If you have a file in your theme called 'news-article.php' with the Template Name set to News Article, I'm saying you should be able to add custom meta boxes specifically to that template, so when you select it from the template list the new meta boxes appear and any others disappear. That's the key, here.

    We all know how to use custom meta boxes, but this makes it user friendly for the client. That's what I'm trying to address.

    Posted: 2 years ago #

RSS feed for this topic

Reply »

You must log in to post.

  • Rating

    12345
    10 Votes
  • Status

    This idea is under consideration