google-code-export / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
2 stars 1 forks source link

View page of site associated with custom posts #445

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What functionality do you want to see?

When defining a custom post type, I'd like to be able to specify the page of my 
site which will be used to display the posts. This link would then be displayed 
at the top of the post listing page in the Dashboard and also at the top of the 
edit posts page.

Please provide any additional information below.

For example, I have a post type which is used to build a listing of all 
performances which my choral group has performed at. The posts are only used to 
build this page and do not have a single- php file, so in order to preview them 
I have to go to the page in my site. Having this functionality would enable me 
to click on the "view associated page" button at the top of either the edit 
screen to open the page in a new window. If possible, it would be great if the 
"view post" link that Wordpress displays automatically could be redirected to 
this page, rather than attempting to display the single post.

Original issue reported on code.google.com by i...@brightongmc.org on 15 Jan 2013 at 12:29

GoogleCodeExporter commented 9 years ago
The way I would recommend accomplishing this would be to use the 
summarize-posts shortcode 
(http://code.google.com/p/wordpress-custom-content-type-manager/wiki/summarize_p
osts_shortcode).  I understand what you're trying to do, but here's why this 
can't (or shouldn't) get implemented:

1. WordPress does not have the events/actions/hooks necessary to support the 
customizations you have described. (deal-breaker)
2. You are defining a *collection* of posts (in your case, locations). 
*Forcing* the whole collection to appear in a single place blurs the 
architecture.  If you want to format the collection as a list, that's fine: 
simply dedicate a page for that and use the summarize-posts shortcode on that 
page.  

Summarize-posts (or some similar querying mechanism) is really the best way to 
do this.  Even if WordPress had the necessary hooks to override the standard 
behavior, you'd end up opening a can of worms when it came to trying to specify 
formatting, order, etc.  All those controls are already there, you just need to 
earmark a page where you will display your list.

Original comment by ever...@fireproofsocks.com on 15 Jan 2013 at 4:32

GoogleCodeExporter commented 9 years ago
Hi.

Thanks for the quick response, but I think you've completely misunderstood what 
I am suggesting.

I already have a custom page template to pull the posts into the page using a 
custom Loop. That's no problem. What I was hoping for is to be able to define a 
link that will be displayed at the top of the wp-admin/edit.php?post_type=xxx 
and the wp-admin/post.php?post=xxx&action=edit pages which will simply take me 
to the page that displays the posts on the website.

To further illustrate, have a look at this page: 
http://www.brightongmc.org/performances/all-performances/

Every single one of those entries is a separate custom post type called 
performance. I do not have, nor do I want, a single-performance.php for these 
posts, as they are only supposed to be viewed in this page as part of the 
listing, and not as indvidual posts. My idea is simply to make it easier for me 
to update the posts and then check they they are working properly on the page. 
At the moment I have to go to the All Performances page manually, but if I 
could define a link in the custom post type definition that took me directly to 
that page, then it would make things a little quicker and easier.

I'm also thinking of when sites are built for a client, who then manages the 
day to day posting. I developed one such recently and initially kept getting 
calls saying that things weren't working when she had edited a post and clicked 
on the View Post button, only to get a 404 error. So I was thining that it 
would be great if it could also override this link to take her to the page, 
rather then trying to display the individual post. 

I hope that makes what I'm suggesting a little clearer!

Thanks again

Peter

Original comment by i...@brightongmc.org on 15 Jan 2013 at 5:01

GoogleCodeExporter commented 9 years ago
I think I understood the first time, and my recommendations and the limitations 
remain.  Create a page, call it "All Performances", and on that page put a call 
to summarize-posts.  If you never want to use single-performance.php page, you 
can set the post-type to be non-queriable so it never shows directly in the 
front-end directly.  That "edit" link is exactly what I'm talking about when I 
said WP doesn't support editing of certain things.  The whole event-driven 
architecture doesn't deal with that sort of thing well.  

You can't fix your users, unfortunately. You may want to take add a vivid 
description in your performance custom fields, or customize the manager html 
(http://code.google.com/p/wordpress-custom-content-type-manager/wiki/Customizing
ManagerHTML) to add a more obvious note.

Original comment by ever...@fireproofsocks.com on 15 Jan 2013 at 5:23

GoogleCodeExporter commented 9 years ago
I think I understood the first time, and my recommendations and the limitations 
remain.  Create a page, call it "All Performances", and on that page put a call 
to summarize-posts.  If you never want to use single-performance.php page, you 
can set the post-type to be non-queriable so it never shows directly in the 
front-end directly.  That "edit" link is exactly what I'm talking about when I 
said WP doesn't support editing of certain things.  The whole event-driven 
architecture doesn't deal with that sort of thing well.  

You can't fix your users, unfortunately. You may want to take add a vivid 
description in your performance custom fields, or customize the manager html 
(http://code.google.com/p/wordpress-custom-content-type-manager/wiki/Customizing
ManagerHTML) to add a more obvious note.

Original comment by ever...@fireproofsocks.com on 15 Jan 2013 at 5:23