WordPress.org

Ideas

Support multiple post types in same tree -- CMS-like behavior

  1. stonor
    Inactive

    Today, it can be tricky to build a classic hierarchical site with multiple custom post types within the same tree structure, e.g.

    Root
    - Leaf 1
    - News item 1 (News post type)
    - Product A (Product post type)

    - Leaf 2
    - News item 2 (News post type)
    - Product B (Product post type)

    WordPress tends to treat each post type as an island, both when it comes to hierarchical structuring and URLs:

    Newsroot
    - News item 1
    - News item 2

    Productsroot
    - Product A
    - Product B

    The reason is that by default custom post types can only select a hierarchical parent of the same post type.

    Another issue is that WordPress encourages a kind of URL namespace for each post type, e.g.

    /newsitems/news-item-1
    /newsitem/news-item-2
    /products/products-a
    /products/products-b

    Instead of what I want:

    /leaf1/news-item-1
    /leaf1/products-a
    /leaf2/news-item-2
    /leaf2/products-b

    I would really love that option -- to work with a unified tree instead of separate islands of content.
    The easiest way would probably be to allow the selection of parents across hierarchical post types. And of cause the permastruct and permalink logic would have to be adapted as well.

    I know you could use taxonomies or the menu system (we do that today) as workarounds, but neither works really well.

    WordPress comes with a lot of blog legacy. I think this could be one of the steps towards a "normal CMS".

    Posted: 3 years ago #
  2. Ipstenu (Mika Epstein)
    Lead Plugin Wrangler

    That would not be what CPTs are meant for. If you want them all in the same hierarchy, you need a custom taxonomy. Tags and categories, for example.

    Posted: 3 years ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    3 Votes
  • Status

    This idea is under consideration