1

I have an issue that has arisen and i'm looking for a solution.

I have a website that has many sections of the site built within the page hierarchy. For example it looks something like this:

Fruits
--- Apple
------ Red Delicious
--- Banana
Vegetables
--- Carrot
--- Potato
------ Sweet Potato
Dairy
--- Milk

The issue is that there is a need for users to be able to edit one section of the site (such as editing Vegetables) and all of it's children, but not other sections. Further, the people should be able to add New Pages, but only as children of pages they can edit.

I'm not sure what to do in this situation in order to achieve this or what tools I should use. I considered moving the sections to separate post types and instead restricting those, but I want the top level pages to have a base level slug (mysite.com/vegetables).

If you need further clarification let me know.

  • I haven't thought this through, but I don't think it would be possible to restrict certain users to publish to a certain category within the SAME post type. Since capabilities are at Post Type level if you give access to publish is for the whole post type. My suggestion would be to make CPT for each of those sections and then you would be able to restrict/grant permission based on capabilities for each users/roles – bynicolas Aug 25 '16 at 20:11
  • oi k I read that to quick... you were thinking of creating CPT for each section... I think that would be best. I think it's possible to prepend multiple url with /vegetable but it might require some rewrite rules at server level (htaccess) – bynicolas Aug 25 '16 at 20:15
  • Custom Post Types make sense, but I would need a post within the custom post type to act as the home page I wouldn't want "Mysite.com/vegetables/home". I would want it to be "Mysite.com/vegetables/". So ideally I would want a way to have a specific post within a post type have no slug. I feel there must be a way to do this. – Jeremiah Aug 26 '16 at 12:51
0

I was recently faced with a similar situation and chose to use custom post types. While it's technically possible to use page hierarchies or categories it would make handling user access too complicated.

If my understanding is correct then your desired permalink structure will be there by default:

slug for custom post type

PS: if you want to keep the hierarchical structure inside 'vegetable' posts, then make sure you set the post type to 'hierarchical' (like pages).

  • I know I can do this, but the problem then is that the Page called vegetables would be at something like: "Mysite.com/vegetables/home" whereas I want it to be at "Mysite.com/vegetables/". – Jeremiah Aug 26 '16 at 12:45
  • I see your concern. Now to put things in perspective this approach will get your site ready except for some permalink cosmetics (that can be fixed with minimal effort). The other option is to have the permalink cosmetics done and the user permissions broken with no easy way to fix it. – zendka Aug 26 '16 at 17:53

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.