Hiya,
Been working on this one for a bit and just can't quite get it. Here's the scenario. I have a content type "Portfolio Pieces" - I want to create a view that displays all images from a specific gallery in the sidebar of each node.
Now, I could create a separate block view for each piece and configure it to only appear on that node's page - but that would be 20+ views and not very intuitive to add new portfolio pieces in the future.
I could also do this in a custom block where I did a db_query based on the URL of the page. Better, but, lets just say I want to do this with a view for arguments sake.
So I've set up a block view configured to appear on 'portfolio/*' and every "Portfolio Piece" is aliased to 'portfolio/node_title'. I've then went and created a gallery for every "Portfolio Piece" that has been named "node_title"
Now, in the docs this is the example it gives on argument handling code:
// Show full node view, rather than teaser, if an argument exists
if ($args[0]) {
$view->page_type = 'node';
}
return $args;
This indicates that I _can_ change the view itself through the argument handling code if I want.... so I tried this...
if ($args[0]==portfolio && $args[1]) {
$view->filter = array (
array (
'tablename' => 'term_data',
'field' => 'name',
'operator' => '=',
'options' => '$args[1]',