Discussion:
Unique Admin View for Custom Post Type
Jeff Rose
2013-09-01 02:29:41 UTC
Permalink
Hi Everyone:

I'm wondering if there's a tutorial or anyone has an idea of how to present
select users (based on a custom capability) with a unique layout of a
custom post type.

For example:
Custom Post Type might be a Movie and it collects a bunch of metadata using
custom meta-boxes and taxonomies like year, production company, cast,
director etc. (Let's pretend it's like IMDB quantity of data)

For a user/visitor this is presented using a post template through a theme
in a certain manner - that's simple enough.

But the selected user (Admin, content manager) just needs an overview in
perhaps a tabular or 2 column layout to review the data. Perhaps the
content manager can't edit it but still needs to review it.

I hope that makes sense. I did it once but it felt like a hack and not the
best way.

I appreciate any feedback.
Ken Newman
2013-09-01 05:36:06 UTC
Permalink
You can do so in your meta box code. Just check for the desired cap, and print the layout of the meta box as you like. You may want to remove support for the standard stuff like editor and whatnot, so that you can handle it your self in the meta box, this way you can not show it to some users.
Post by Jeff Rose
I'm wondering if there's a tutorial or anyone has an idea of how to present
select users (based on a custom capability) with a unique layout of a
custom post type.
Custom Post Type might be a Movie and it collects a bunch of metadata using
custom meta-boxes and taxonomies like year, production company, cast,
director etc. (Let's pretend it's like IMDB quantity of data)
For a user/visitor this is presented using a post template through a theme
in a certain manner - that's simple enough.
But the selected user (Admin, content manager) just needs an overview in
perhaps a tabular or 2 column layout to review the data. Perhaps the
content manager can't edit it but still needs to review it.
I hope that makes sense. I did it once but it felt like a hack and not the
best way.
I appreciate any feedback.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Jeff Rose
2013-09-01 17:50:10 UTC
Permalink
Post by Ken Newman
You can do so in your meta box code. Just check for the desired cap, and
print the layout of the meta box as you like. You may want to remove
support for the standard stuff like editor and whatnot, so that you can
handle it your self in the meta box, this way you can not show it to some
users.
Thanks for the reply Ken. I think I wasn't clear in my question.

The metabox stuff is all fine, I've got that covered.

What I'd like is when the user clicks the "View post" link either from the
publish meta box, the preview link or the view post link (also in Quick
Edit actions), to send the Admin user to a custom page that shows an
entirely different layout of the material. They would be viewing the post
data not in the edit layout, and not in the post layout, but in a custom
(third) view.

Jeff
Drew
2013-09-01 18:15:41 UTC
Permalink
Why not just do a current_user_can( 'custom_cap' ) check on the single page
and show a different layout for those users?
Post by Jeff Rose
Post by Ken Newman
You can do so in your meta box code. Just check for the desired cap, and
print the layout of the meta box as you like. You may want to remove
support for the standard stuff like editor and whatnot, so that you can
handle it your self in the meta box, this way you can not show it to some
users.
Thanks for the reply Ken. I think I wasn't clear in my question.
The metabox stuff is all fine, I've got that covered.
What I'd like is when the user clicks the "View post" link either from the
publish meta box, the preview link or the view post link (also in Quick
Edit actions), to send the Admin user to a custom page that shows an
entirely different layout of the material. They would be viewing the post
data not in the edit layout, and not in the post layout, but in a custom
(third) view.
Jeff
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
--
-- I've kinda got a thing for WordPress > http://www.drewapicture.com
Loading...