Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
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. –  MikeSchinkel Sep 12 '10 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 '10 at 0:29
add comment

2 Answers

up vote 3 down vote accepted

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

share|improve this answer
    
Thank you - this is what I was looking for. –  Tal Galili Sep 10 '10 at 16:31
add comment

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.

share|improve this answer
    
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 '10 at 14:52
    
@Jan Fabry: Isn't it possible to share a Taxonomy between multiple post-types? –  hakre Sep 8 '10 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. –  MikeSchinkel Sep 12 '10 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 '10 at 16:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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