4

Let's say we create an IMDB like website.

So (for example) we can have two types of custom post types:

  • movies
  • actors

We would like to see in each movie page all of it's actors. And in each actors page all of the movies he played in.

Can this cross linking be done using custom post types?

If not, is it expected to be possible in the future?

If not, is there an alternative (in WP) for doing this?

Thanks

2
  • 1
    Hey @Tal: If you get a chance check out this ticket: core.trac.wordpress.org/ticket/14513 Please comment if you have anything to add to the ticket. Sep 12, 2010 at 11:07
  • I read that unfortunately this, what I see are "core" needed functionality (really), has been postponed to the future.
    – edelwater
    Nov 4, 2010 at 0:29

2 Answers 2

3

Checkout scribu's post2post plugin, it should fill your needs.

0
0

Next to the pages for Movies and Actors just define two taxonomies: Actors and Movies. Then you can categorize each Movie with a Movie from the Movies Taxonomy and you can categorize each Actor from the Actor Category.

On the other end you categorize each Movie with any Actor from the Actors taxonomy.

If you then can query a taxonomy to list pages that are part of a specific category (which should be possible) then you have already cross-linked everything as wished with wordpress data-structures.

On the [Movie Page] get that Movies Page [Authors] from the [Authors Taxonomy]. Then query the [Authors Taxonomy] for [Author Pages] that have the specific [Author] from the [Authors Taxonomy] attached.

On the [Author Page] you can do it the other way round.

I'm not that firm with Taxonomies but it might be the case that you need to register them per custom post type. This can make some data redundant which generally makes content management more intense.

4
  • You would only need one taxonomy, otherwise you encode each relation two times. So you have Movie and Actor custom post types, and then one taxonomy, that you attach to one post type. I think MovieActors, linked to Movies makes the most sense. You don't need a ActorMovies taxonomy linked to the Actor type, since this would contain the same info as MovieActors. MovieActors contains actors, and you can match the taxonomy term slug to see whether there is a Actor custom post with the same slug.
    – Jan Fabry
    Sep 8, 2010 at 14:52
  • @Jan Fabry: Isn't it possible to share a Taxonomy between multiple post-types?
    – hakre
    Sep 8, 2010 at 17:54
  • @Jan: Additional taxonomies don't "cost" anything and the increase in clarity has significant benefits over trying to shoehorn two taxonomies into one. Sep 12, 2010 at 11:10
  • Mike - fascinating discussion (I wasn't able to follow all of it). I'm glad smart people are sitting on the problem as we speak. Cheers, Tal
    – Tal Galili
    Sep 12, 2010 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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