I have a content type called “convention” and a content type called “convention session”. Each session has a node reference to a convention. A convention has a “from date” and a “to date”, and each convention session has a simple “from date”.
When a user browses to the full node view of a convention, I want a block to be displayed on the left that displays a grouped list of convention sessions that occur between the “from date” and the “to date” of the convention. So, for example, if you take a look at the convention node called “My Awesome Convention” from 12/10/09 to 12/12/09, I want the block to look like:
- Thursday (5) – (the numbers are the number of convention sessions on each day)
- Friday (12)
- Saturday (15)
Then, I want each of those items in the block to link to a page view that lists all the convention sessions from that day, with the block staying on the left. Can’t figure it out. Any help would be greatly appreciated.
When you want to work with the context of your site – the node being viewed things get a bit complicated. I’m not sure, but you might be able to get the node id you want to use from the url. Else you have a few other options.
hook_block(). Here you could make your logic and SQL yourself. IF you don’t know Drupal API and PHP very well, this will be a bit hard. But else this is something that can be done in a few mins.