Opened 10 years ago
Closed 9 years ago
#29724 closed feature request (maybelater)
register new content areas
Reported by: | cramdesign | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | |
Focuses: | administration, template | Cc: |
Description
WordPress needs a better way to input different types of content into a post. Using metadata is fine but has many limitations.
I suggest we consider something like registering content blocks much like we register customizer controls, widget areas or menus, etc. Maybe something like:
$wp_content->add_content($id, $args); $wp_content->add_control($id, $args);
Then we could retrieve it with:
$wp_content->get_content($id);
or something of the sort. To maintain backwards compatibility, the_content()
would output all content blocks, in order, unless it was specified that the block should not be output. When the content block is registered, it could have properties that provided some control of how it would be output for older themes including headings and classes.
I know that this need more fleshing out and thought, please forgive my naivety. I would like a way to create content pages with more complex data, much like using metaboxes, but it seems like it could be easier and more elegant.
Side note. I tried to submit this to WordPress Ideas but the form would not allow me to post.
Change History (3)
#2
@
10 years ago
Hey! Thanks for the response. Congrats on being named release lead for 4.1!
Well, the CEUX plugin does look great but it is different that what I am suggesting. What I propose is that theme authors could create page templates in a way that would utilize different content blocks that were registered similarly to the way a widget area or customizer options are created. What the CEUX plugin proposes is similar to some of the other content block editors that are on the market. (or at least seems that way to me.) Both ideas seem useful to me but for different reasons.
CEUX seems focused on allowing the content editor add blocks as they need where I propose that those decisions be made by the theme developer. As it now stands, CEUX offers little that can't be accomplished in tinymce, though there could be options for more complex formatting and "art directing" posts. This is a different focus from theme developers delineating what type of content is needed and how it should be input... wysiwyg, checkboxes, selects, uploads, date pickers, etc.
Of course what I am proposing can be handled by a theme dev using metadata and metaboxes but I think that there might be value in upgrading some of this data from meta to actual content and might be able to provide some sort of fall back solution when simply using the_content to retrieve, well, the content.
The closest we've gotten to this is the CEUX project which is listed on the features as plugins page. It's on hold at the moment.