By jpbaldiga on
Hello Everyone,
What I'm trying to accomplish may seem simple. But I can't figure out a way to set it up.
I have 2 content types, each content type is a group post, within the same group, that need to be linked using cck node reference.
When creating a group post, I see that the groups nid is incorperated into the URL. ( node/add/content_type?gids[]=10 )
Is there anyway to filter a node reference select box to show only posts in that group (mentioned in the URL of the add/edit form)?
Comments
More than one way to pass an argument.
I figured out a way to do it, it may be a little sloppy tho.
Here's what I came up with.
I created a view with a group argument to use for the select list.
I had a hard time passing the arguement to the add/edit form so I figured global would be a good way to go.
In the views argument settings, I typed this in the "provide default argument using php code"
Basically I pull the current URL, discard everything I don't need using the trim function, and I'm left with the group nid to filter my view :)
Hope someone finds this helpful one day.
same issue
@jpbaldiga
I want to do same, I want to filter a node reference to show only nodes in that group... Have you found any solution??
use filter - not arguments to do this
if you are selecting the filter "Organic groups : OG: Posts in current group" the view shows - like the filter says - only posts in the current group.
Hope that helps ....
@intervalle is correct. You
@intervalle is correct. You don't need to do anything special, just add that filter.