Add Content to Page without shortcodes

The site I’m working on has a couple of pages that needs to be filled with different content elements like text image combinations, sliders, lists of content, etc. The client would need to re-order these content blocks, add new ones and so forth. Every content block would be piece of content (post or custom post type) or a list of content.

From what I understand I have 2 options:

  1. Use an complex plugin to drag and drop predefined content
  2. Use shortcodes

From a developing standpoint I would rather not leave all the logic to a third party plugin. It seems I would lose some of the control over the templating?

But shortcodes don’t seem like an acceptable solution for any customer, really, because they are too technical.

Any suggestions? Is there a best practice?

4 s
4

This is an interesting question, though a bit too broad for a Q&A model. Here is what I would do:

  1. Create a custom post type, where each post is a block of content
  2. Create a second custom post type for pages that are assembled from blocks of code. In stead of a content field, create ten drop down fields (or more if there are more blocks possible on a page). For the select options in the dropdown, take the title of all posts in the first custom post type. In this way any new block of content will automatically become available for assembly.
  3. Create a template for the second post type, that loops through all drop down fields and assembles the content from the first custom posts.

Leave a Comment