1

I want to build a up a new system based on WordPress to manage my content. I am new to WordPress and have written previous systems from scratch using PHP/mySQL.

Unfortunately it's not a simple blog or webpage system. My "real" content (labeled with Cs in the example below) is categorized into a tree structure. Levels A and B only have names and a description and they should support attachments. Going down from the root level there is always an 1:n relationship to the next lower level.

/
├── A1
│   ├── B1
│   │   ├── C1
│   │   └── C2
│   └── B2
│       └── C3
└── A2
    ├── B3
    │   └── C4
    ├── B4
    │   ├── C5
    │   └── C6
    └── B5
        ├── C8
        └── C9

My real structure would have one more level, so this is a simplified example.

As there is a clear hierarchy I thought about using post type pages for my content. But I read that pages do have some disadvantages, e.g. they do not support feeds, tags or more complex taxonomies. So I thought about using posts, but this does not really fit content of type C and so I decided to create a new Custom Post Type (CPT). It has a lot of additional fields, which are saved as meta content. I have written my own plugin for it - that is working so far.

When it comes to the hierarchy, I don't know how to really do it. I have different approaches:

  1. use the standard category system for the hierarchy; it can be added to the supported taxonomy of the CPT
  2. create own hierarchical taxonomy for the hierarchy
  3. use other CPTs for each level and manually link them to a hierarchy or somehow do it automatically

What I also want to do is to limit access to the content, i.e. I want to grant access to the content based on level A. As an example: user1 can read A1 and A2, user2 can read and write A1, user3 can read A2 only. I.e. user3 should be able to access A2 and all the content below, i.e. B3, B4, B5, C4, C5, ...

Furthermore, some users should be allowed to extend the hierarchy on levels A and B, where other users should only be allowed to read/write new content into/from the given hierarchy and not allowed to change the structure. Is this possible with the standard user roles?

I'd be happy to get some hints on how I should categorize my content. Why I am stuck with my current approaches:

Approach 1: May not work out, as I did not see an option to link attachments to categories.

Approach 2: Probably no benefit over approach 1. But I could use the standard categories still for adding some content on pages for all users and so clearly separate from the given structure. I think of help pages, etc.

Approach 3: Even though the structure of levels A and B will be quit fix after it has been created, it should still be flexible and extendible. So linking the items manually would be okay, but doesn't seem to be "clean" and the right way to go. In general, it seems that creating a hierarchy of different CPTs is not so easy.

Can you please give any hints how to do it in best practice? Or can you give recommendations for plugins that implement my needs?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.