Iv created a group "Accounting", and you can upload images to this group, then i have a block that displays all the images that are uploaded to this group, to be displayed when the group is displayed.

then on the image field of the view, i have "Output this field as a link" , so i make it "group/image/gallery/%1" this will make the url of the image go to a link where %1 is the name of the group, so in this case, "group/image/gallery/accounting". this view ends here.

new view to display a gallery in a grid format from all the images that are posted to the group, so page url ="group/image/gallery" and node type only shows images, and field only shows small images in a grid format, great, not its the arguments turn, i set up a standard "Organic groups: Groups" arg with validator of grope nodes argument type "Node ID".

now i have explained my current setup, this doesn't work cause the first view is passing group-name and the second view is expecting NID to validate, if i click on the image it takes me to "group/image/gallery/accounting" shows me page not found but when i swap "accounting" for "115" i get what i want.

so my request is how do I either pass the NID in the first view from a block. or how do i change the arg validator to accept the "group-name"?

Comments

dawehner’s picture

Even if its a little uggly, you can use argument validation php code.

There you can convert in both directions:
- Node-Nid->Node-Title
- Node-Title->Node-nid

Here the example for Node-title->node-nid

<?php
if ($node = node_load(array('title' => $argument))) {
  $handler->argument = $node->nid;
  return TRUE;
}
return FALSE;
?>
B4n7o’s picture

Thank you soo much, this works like a charm!

dawehner’s picture

Status: Active » Fixed

Awesome.

So this is fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.