Custom post type content using custom fields without template

When I first heard about custom post types I thought it would solve an old “problem” I have, so I was thrilled.
But when I tried to setup something I couldn’t achieve what I want.
So I’d like to know if I’m using WP tools correctly, or if there is a plugin (or a combination of plugins) that would do what I want.

Context :
On my blog I have several categories that contains “copy pasted posts”, which are posts that have a static structure and where only a few information change (a category = a specific post “format”). So to create it, I copy/paste an old one and replace a few things (some urls, titles…). There are a dozen of these.
I use a site template found on WP.com, but heavily modified and single.php has a lot of content that I don’t want to copy/paste to other files.

Read More

Problem :
I tried to use a plugin to manage custom post types. The idea was to define a post type for each category. I think this is the intended use, but my problem is that I don’t want to duplicate the single.php because any modification of my template would imply that I have to edit a dozen of files and all of my “custom types” are all almost the same as “normal” posts, it’s only their content that is fixed. And it also implies to edit other files : search results, listings…
Moreover I see some possible issues here : as the post titles are not defined and are dependant on the custom fields content, I’m afraid that the search may not work on them (I didn’t try it though).
Moreover I prefer to be able to define the post content template as “WP admin” (through UI) instead of “WP developer” (through file editing & FTP).

What I would ideally want :
So I imagined another solution, but I don’t know how feasible it is :
I’d like the mix of two plugins : “Ultimate Post Type Manager” and “Simple post template” (this plugin allows to define a default post content. It adds a button on the “new post” page which, when clicked, fills the post body with a predefined content).

I’d like, when I create a custom post type to define a default post body (and title). (as it is possible with “Simple post template” but this plugin only allows the creation of one global post template only).
As we can define custom fields, I’d like to be able to put fields replacement tokens in that content template.
The result would be that when I click on “Add new [my type]” for my custom post type, I don’t see a title or body field, but only my custom fields.
When I click on publish, it would fill the title and body with the content defined with the tokens replaced by the value entered in the fields and save it to the database.

In short, it would create the post layout from some data entered in a form before writing it in the database while the common use is to set the layout at “display time”, a kind of “creation-side” template (versus a “display-side”).

I know this is quite agains the “less display instructions in DB, more in template”, but I prefer this way in my situation.

I’m I thinking it in a wrong way (You have the right to say that it is a total nonsense !) ? Is there already something that would allow me do to that ?
What would be my best solution to get something similar ?
After some thinking, I’m not sure using custom post types is a good idea here…

Updated :
Rephrased, edited layout, added details & links.

Related posts

Leave a Reply

1 comment

  1. As already somehow suggested in the comments, I think the most easy thing is to get a solution to your “I don’t want to duplicate template files all over the place because they contain all the same” by modularizing those.

    E.g. by using template parts – and I think that’s even more powerful – by hooking into the template loader (see template-loader.php). See as well Template Actions (WordPress Codex)
    and the WordPress 3.0 Program Flow (Toolpress PDF).