Hey,
I haven't actually started with ProcessWire yet. I came across it via a Smashing Magazine article and it has piqued my interest.
I've been working in WordPress for about a 2 years. I have intermediate HTML5, CSS3 skills, and have been furiously teaching myself PHP/Javascript for the past couple of months, since I want to dig more into wordpress and develop skills on other platforms.
At the moment I have a project involving a niche movie/TV database, with associated review system. I have already built a custom solution in WordPress involving custom post types, custom fields, custom categories, and user access levels.
The site will be highly relational, as it has Movies, TV shows, Actors, Directors, Producers, Cinematographers, Studios, Production Companies etc.
The complexity of the relations comes in when you consider that an Actor can be a director and producer too, and can be attached to movies in multiple ways. Movies have multiple producers and sometimes multiple directors.
So using wordpress custom post types and custom fields I have implemented many to many relationships via intermediaries, given the limitation that each child can only have one parent of each type, but a parent can have many children of a given type. I used a custom types and display plugin for this.
Just looking at the Movies and Actors/Directors/Producers situation.
I created Movies and People as Parent post types. I created groupings of custom intermediaries to join the parent post types: Actors-In-Movies, Directors-of-Movies, Producers-of-Movies.
So now a Person can be linked to a movie in multiple ways, and to multiple movies in the same way etc.
Which was great but complicated, but it allows me to display the required fields via their many to many relationships.
An example of a problem I came up against that required digging deep was:
On a page(post) showing an actor, listing all the movies that he has been involved in is easy. I can list them by role, and display information from those linked posts, such as the title of the move, year etc.
But because this a wp_query of the child post, displaying some information from it's other parent, the problem comes about when trying to order that information by a field pulled from another parent e.g:
Person1
Acting Roles
Movie 1 - Character Name - 1972 (movie release date - from other parent)
Movie 2 - Character Name - 1971
Movie 3 - Character Name - 1973
Production Roles
Movie x - Producer - 1995
Movie y - Executive Producer - 1983
The information being displayed is from querying the intermediary post, some directly (such as charcter name) while other information is being pulled from the other parent (movie name, movie release date).
The table of information is easily sorted by fields from the linked child, ie it would be easy to sort them, alphabetically, by character name or production role. However in such a table it is more usual to sort them by the release date of the movie, either chronologically or reverse chronologically.
But in Wordpress this was difficult, because I am trying to order the information of a query of a child post by information not included on that child post, but by information queried from another parent of that post.
A solution was to duplicate inputting of information from the movie release date field in the movie parent post, into a movie release date field in the child intermediaries... An anathema of process.
I identified 2 solutions (with help).
1. Since users won't be accessing the WP Admin directly as I have implemented a user account system that keeps them in a designed user area front end, with forms to submit data. On those forms I have a system that writes data to both posts. So when a user submits a movie, the year of that movie is written into movie year fields in both the movie post movie year db entry and the intermediate (actor-in-movie/director-in-movie/producer-in-movie) post movie year db entry upon submission. It leads to complications when people don't already exist in the DB etc
2. When the DB is queried, use custom code to manipulate the list of intermediate posts after it has been retrieved and change the sort order. Not writing to the DB as above, but doing it on the fly before display by looping through the posts, retrieving the id of the corresponding movie, retrieving the year custom field from the post meta of the associated movie, adding that as an entry in the posts array for the current post, and then after having looped through each of the posts so that they now also have a year entry, sorting the posts array based on the year field, and then replacing the posts array which is part of $query with the sorted posts array.
... I do enjoy overcoming these hurdles, but since I have been reading great things about ProcessWire I am interested in tackling this same problem.
Does ProcessWire deal with relationships in a similar way, I have come across mention of one-to-one and one-to-many relationships. I would therefore surmise that you can create many-to-many in much the same way, or is there an easier way?
Does anyone have any pointers?
Thanks for any advice in advance.