Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Enable WordPress Category to Organise WordLift Entities #442

Closed
cyberandy opened this issue Jan 12, 2017 · 13 comments
Closed

Enable WordPress Category to Organise WordLift Entities #442

cyberandy opened this issue Jan 12, 2017 · 13 comments
Assignees
Milestone

Comments

@cyberandy
Copy link
Member

In some cases it becomes very useful to have the WordPress Category available also for Entities.
Let's assume I'm creating a vocabulary for plants and flowers. Both are in WordLift things and a simple way to create a menu for plants and a menu for flowers would be to create two WordPress categories and use them for classifying entities as well as articles.

This also will blur the distinction between an entity and an article letting the user create richer experience within a specific domain.

@cyberandy cyberandy changed the title Add WordPress Category to WordLift Entities Enable WordPress Category to Organise WordLift Entities Jan 12, 2017
@ziodave ziodave added this to the 3.11 milestone Jan 12, 2017
@markkap
Copy link
Contributor

markkap commented Jan 30, 2017

In theory it should not be a problem to just attach the post categories to the entity "post type", and than you will be able to associate entities with existing categories. the more interesting question is what are the implications for the front-end or admin. where would there need to be any change of behaviour due to the association? IIRC, by default, even when you have the association there is no immediate noticeable user impact except for the menu and the category selection meta box

@cyberandy
Copy link
Member Author

Hi @markkap the main goal here is to ensure people can use entities as pages within the site and that they can group them in menus and sidebar menus. We had several cases where users end up using the advanced custom fields plugin in order to group entities.

Another case is when I want an entity to be listed as part of my blog (i.e. I write an entity type=event and I want to see it on the homepage of my blog - https://wordlift.io/blog - where otherwise I only have articles).

@ziodave
Copy link
Member

ziodave commented Jan 30, 2017

Do we have a specific test cases that we can work on? My perception is that is theme-related, and that the themes are loading post_types post or page.

@cyberandy
Copy link
Member Author

cyberandy commented Jan 30, 2017

A simple use case will be on the new taoroma.it where the user would like to create navigation menus for entities grouped them in 3 categories (earth - human - sky).

Having entities appear in the list of the latest articles is theme related and should not affect our work. The main goal is to be able to create navigation menus using categories that works across article and entities.

@ziodave
Copy link
Member

ziodave commented Jan 30, 2017

Can we schedule a quick call to see how this is being done with posts/pages on taoroma.it?

@markkap
Copy link
Contributor

markkap commented Jan 30, 2017

If anyone just want to add the entity pages, or entity type archive into the menu system, it is possible without actually doing any coding, it is an "hidden" option in the menus admin page, for which you need to go into the screen options for that admin page.

As @ziodave says, this probably needs a better definition of a use case as I can't right now see why would anyone want to use ACF here.

@markkap
Copy link
Contributor

markkap commented Jan 31, 2017

per the discussion with @cyberandy and @ziodave I will make a test version inwhich it will be possible to associate post categories with entities, and show entities in the archive page of the categories it is associated with. The point of the test is to discover theme compatibility issues and how much of an advantage this configuration provides on the wordpress admin side

@markkap
Copy link
Contributor

markkap commented Feb 1, 2017

pushed the experimental code to the feature/442.... branch. Do you need me to make a zip, or you just will get it from github?

From what I see with my very poor local entities is that the design on the category page do not match in the 2017 theme. I actually not sure why. As for menus, I don't see any real impact on what can be selected and what is displayed.

ziodave added a commit that referenced this issue Feb 1, 2017
@ziodave
Copy link
Member

ziodave commented Feb 1, 2017

We need to hide the Categories menu entry from the Vocabulary menu:

image

@ziodave
Copy link
Member

ziodave commented Feb 1, 2017

@markkap to recap let's:

  • check why the post author doesn't show up in 2016,
  • check why the publish date doesn't show up in 2017,
  • hide the Categories menu entry under Vocabulary (unless there's a strong reason to keep it),
  • add unit tests such as
    • WP_Query with no post_type set,
    • WP_Query with 1 post_type set,
    • WP_Query with 2+ post_types set.

@markkap
Copy link
Contributor

markkap commented Feb 1, 2017

Th reason post author and other information is not displayed in 2015/2016/2017 themes, is that they explicitly check that the post type is "post". It is not obvious that there is any way to override it.

As for the categories menu, it seems like when filtering posts by category, the wordpress admin have an error when there are two post types being mixed together. I didn't investigate to the end why it happens, so there might be a way to explicitly override the error.
Except for the explicit error, inspection of the code reveals that it assumes that all posts being displayed are of the same type and based on that does capability checks. It is not a major problem if the entities always have the same capabilities/permissions like posts have.

@ziodave
Copy link
Member

ziodave commented Feb 1, 2017

Th reason post author and other information is not displayed in 2015/2016/2017 themes, is that they explicitly check that the post type is "post". It is not obvious that there is any way to override it.

Ok, nothing we can really do in this specific case.

@markkap
Copy link
Contributor

markkap commented Feb 1, 2017

Some more wordpress core bugs.... It seems like the count of the number of "posts" which is displayed in the count column of the category listing page has no context and will always display the number of plain posts associated with the category, even when looking at it in the context of entities

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

No branches or pull requests

3 participants