Custom Content Type Manager
custom content type which includes another content type (4 posts)

  1. mgrant
    Posted 4 years ago #

    Is it possible to create a customer content type which includes another content type? For example, a customer content type that includes a slide show?

    For example, the new content type would contain:

    a title
    the slide show on the left
    some descriptive text on the right
    a taxonomy (category/sub-category) so this content could appear in a menu automatically

    I could do this manually by first creating a slide show, then create a post, then insert the slide show's slug into the post in just the right place in a table or div and set the taxonomy of the post. However, there's so much room for user error here I feel the need to create a content type to do this for me.

    Ideally when the user creates one of these things, they are asked to type in a title, then click here and create a slide show.

    Unlike a stand-alone image, a slide show isn't a standard content type in wordpress, however, most of them seem to let you include a slide show inside a post/page using [slugname].

    However, from a creation point of view, I have no idea how that might work.

    Is something like this possible with this plugin or is there an intelligent way of doing this otherwise?

    Michael Grant


  2. fireproofsocks
    Plugin Contributor

    Posted 4 years ago #

    You can create a custom field that references another post (i.e. a relation, an image, a media item, or any type of post you have on your site). 0.9.5 (in dev, but almost ready) allows you to attach as many posts as you want to a relation field. E.g. you could create a "repeatable" image field, then select all the images you wanted in your slideshow. How you format that data (slideshows, marquee text, etc.) is entirely up to you.

    A "slideshow" is not a content type: an image is. A content type must be atomic, not an infinite array of possible members.

  3. mgrant
    Posted 4 years ago #

    I've installed Thethe Slider and under the Content Types within your plug in, it shows:

    This post type has been registered by some other plugin.

    So it's sort of a content type.

    Adding repeatable images to a content type is what I want, but what I don't want to do is re-invent the wheel and rewrite a slider to display those.

    What's the right thing to do here? Would for example one of the slide show plugins need to be modified to work with a list of images like this?

    I see what you've created and I see things like slide shows and other things, and it seems there aught to be a way to use one in the other.

  4. fireproofsocks
    Plugin Contributor

    Posted 4 years ago #

    Ok, so some other developer has embarked on a perhaps novel usage of the wp_posts table and calls it a post-type. I'd have to look at how they are storing their data, but somewhere and somehow it is storing an array of images.

    All the CCTM does with relation-type fields is store the foreign key to the other post (i.e. its post ID). So if all the slideshow data is in some row in the wp_posts table, then you can at least reference that row in the database and extract the data it contains, but I would guess that the slideshow plugin is attaching formatting hooks and filters onto the reading of that data... so who knows if you could coax that data back out in a usable form.

    I tend to favor rolling my own solution because you never know what you're gonna get with something like that. WP is full of horrible architecture and bad designs born of a desire to come up with a one-size-fits-all solution. Sometimes they save a lot of time, other times they cost you dearly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic