I am using node galleries. I've created a view where I display all the images that are of type "gallery_image". The problem is, I need to now get it to only show me the values for a specific album, where the specific album is whatever is the most recently created album.

So in this image:

enter image description here

First prize would've been if I could say:

operator : is equal to : value

And make the value something like [[LATEST_ALBUM]] and have that somehow magically figure it out. It would be easy to do if I could add PHP there.

Any ideas how to get around this?

1 Answer 1


I just ended up using "arguments" with a default PHP argument if one is not specified. The PHP code:

$res = db_query("select nid from node where type  = 'node_gallery_gallery' order by nid desc limit 1");
$res = db_fetch_object($res);
return $res->nid;

Works beautifully. Only side effect being that anyone that can access this view, can view other galleries using a parameters. But in my case that's not a problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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