Posted by thepocketgeek on May 10, 2010 at 4:46pm
What would be the simplest way to pass the Node Title to a view that is going to use that title as part of an argument? I only want the view to return an image that is part of that particular node. Right now all of the node images are showing up.
If I provide the default argument, can I use the [title] field that I am using when I rewrite the output or is there a php variable that I need to use?

Comments
You want to use the node ID
You want to use the node ID rather than the node title if you're using it to look up a node. Node IDs are constant and easy to do database lookups on, titles can easily change, are not unique, and may contain non-alpha characters which will make it difficult to search (eg. "Who's?: Gareth's" would render as "Whos Gareths" if run through an alpha-only filter, and a database search on that title would not match).
When you add a Node ID argument, under "Default Value" you can set "Get node ID from URL".
Orlando, FL Web Developer | http://www.garethsprice.com/
Okay. It will still be able
Okay. It will still be able to pull the Node ID even if I am using PathAuto, correct? I will try that.
Thanks.
Yes, pathauto's translation
Yes, pathauto's translation happens further up the rendering stack, so you can still use node/[nid] arguments in Views as by the time your data hits the view, the URL has been translated back to the node/[nid] format.
In fact, you should rarely (never?) use pathauto-translated URLs internally, most stuff (with the exception of body text fields) will automatically rewrite node/[nid] style URLs to their pathauto equivalents for display.
Orlando, FL Web Developer | http://www.garethsprice.com/