Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Show post type in post_select field #735

Closed
grappler opened this issue May 15, 2017 · 3 comments · Fixed by #736
Closed

Show post type in post_select field #735

grappler opened this issue May 15, 2017 · 3 comments · Fixed by #736

Comments

@grappler
Copy link
Contributor

Related to #627

I have been using post_select for a client and they we were querying posts from two post types. The posts in both post types had the same titles. There was no way to differentiate between the two posts.

image

Customize Object Selector has a feature where it shows the post type.
image

Beitrag = Post
Inhaltselement = Content Block (CPT)

@goldenapples
Copy link
Contributor

Good suggestion, and I like the fix you proposed for it (showing the post type object label in parentheses if more than one post type is being queried).

In order to accommodate more customization of the templated results (for requests like #627, where the idea of adding the post featured image to the dropdown was proposed), we might have to add a filter in the loop that handles the formatting of each post in the ajax return value - because it would be a two-part process, returning additional fields for each post in the ajax response, and then defining a templateSelection method on the select2 field to render it.

This is a good fix for the basic requirement here, though.

@grappler
Copy link
Contributor Author

Perhaps we can think about adding support for post statuses too. term_select could profit from some of these changes too.

Good suggestion, and I like the fix you proposed for it (showing the post type object label in parentheses if more than one post type is being queried).

I can't take all of the credit. Got my inspiration from @westonruter

@goldenapples
Copy link
Contributor

term_select could profit from some of these changes too.

Yeah, that follows the same pattern as post type -- maybe just including the taxonomy name in parentheses when more that one taxonomy is queried -- and would make sense to tackle in the same way.

Perhaps we can think about adding support for post statuses too.

I think that might be adding too much information to an unstructured UI. I've worked on setups where that would be helpful, but it would be hard to make that decision from the plugin. Maybe something that might be better done by adding a filter?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants