First go at programming with WordPress, I am trying to use custom post types (CPT) to organize 'Log' 'Entries' by 'Console'. So it's a one-to-many relationship between Consoles and Logs, and one-to-many between Logs and Entries. I want clean URLs that don't interfere with Pages, Posts and other custom post types that have their own base URL defined.
My URL scheme would ideally be something like:
/%consolename%/ - archive list of CPT 'logs' associated with the provided consolename /%consolename%/%logname%/ - archive list of CPT 'entries' associated with the provided logname (in turn associated with the provided consolename)
Entries don't actually need slugs at all, archives via the logname endpoint can be the only way to view them.
Another requirement: consolename needs to be unique, but logname needs to be unique only within a given console. For instance, I might have /enterprise/shipslog/ and /voyager/shipslog/
It appears that the only way to achieve this is to have consoles and logs actually be the same CPT, and implemented as a hierarchy.
I've played with scribu's Posts 2 Posts and it seems I can use it to associate the Entries CPT with the ConsoleLog CPT.
Defining the CPT and linking them with P2P seems straightforward. Where it gets tricky is how to properly set up the Post Type Links, Rewrite Rules, Rewrite Tags, Permastructs, Query Vars, Template Include hooks, etc. I've spent the better part of two days reading every article I can get my hands on and it seems like WordPress has had a lot of changes on this front lately.
What are the best practices for creating a clean URL scheme as described above?
Extra points if you can explain how to terminate /%consolename%/%logname%/feed as a custom template RSS feeds of entries :)