By egsj on
So I have an OG with a Projects type and a Tasks type. Tasks uses a node reference field to assign a task to a project.
I'm trying to create a block to place in my groups that will show current tasks associated with projects in that group. However its showing all tasks, regardless of which group the project is for. I have played around using arguments, relationships, and filters but I can not find a winning arrangement.
Comments
Can you list your current
Can you list your current view settings? Maybe that will shed some light on the problem.
This is with the organic
This is with the organic groups post in group filter enabled.
Any ideas?
Any ideas?
sorry, just trying to better
sorry, just trying to better understand your situation...
so, you have groups, which can have one or more projects, and each project can have one or more tasks... correct?
when you create a task (node/add/task), you have an option to assign the task to a project, and that project was previously already associated with a group, correct?
Exactly right. So what I'm
Exactly right. So what I'm trying to do is show a view of all the projects posted to that og, but only the ones in that og. The og filters are not working for me - I know there is one to filter posts only to the specific group but it returns no results. But removing it not only returns results of projects from the current group, but from any other group as well.
I am looking for projects and tasks views that are specific to the current group being viewed. I have attemped a few things with the nid of the group and relationships, but have not had any luck (although I suspect thats the recipe I should be chasing.)
while im not doing something
while im not doing something exactly the same in my situation, i do have three custom content types that are specific to my groups...
- group events
- group galleries
- group posts
taking galleries as an example, this is the view i use to display a block of the top 2 recently added galleries on the homepage of the group itself:
this probably doesnt help much, but as you can see, the only thing that is OG specific is in the Arguments section...
Any more feedback?
Any more feedback?
If the task is posted to the
If the task is posted to the group by selecting the group on the node add page then you should only need to add "Organic groups: Groups" as an argument. That will give you a list of all tasks posted to that group.
Or are you creating projects and assigning them to groups... then creating tasks for those projects without selecting the groups? In this case it may be more difficult to build the view but we might be able to get there. I would probably also recommend a different approach though so let's see where you're at first.
As it is right now you DO
As it is right now you DO select an audience for the task, but you must also chose what project in the workspace its for.
The problem is its showing projects and tasks from all workspaces, not the current, even with the groups argument.
I'm also not sure how to have the reference drop down list for the task, when selecting which project, only show projects in the group.
I'm definitely interested in a better or more successful way to structure this.
Here's how I would approach this
This is how I would tackle the issue.
Install the node reference url module. What that will do is create "add content" links on nodes that can be referenced. So on your project node it will have a link for "add task". When the user creates a task using this link then the reference is automatically created. Users should only be able to create tasks for projects they can see in the first place.
Hide the "add task" link on the create content page (and menu) so that users can only find the create task links on the project nodes. There is a fallback setting for when the reference isn't there (user tries to create task some other way) that you can set to give a 404. That will keep users from typing in the node/add/task manually.
The above should get around the whole reference listing giving all projects issue.
Now to create your view all you'll need to do is create a block view that takes in the organic groups as an argument and display all tasks. That will give you a block of tasks... or you could create the view as a page (tab) within the group. In either case you'll simply need to use organic groups as an argument.
That worked great,
That worked great, thanks.
Next question: Is there any way to filter dropdowns using views to only show nodes (node reference dropdowns) within the current group?
Can you give more detail and
Can you give more detail and / or an example? I'm not quite sure I understand what you're asking for.
Lets say I want to assign
Lets say I want to assign Content Type A (a workspace group post) to a group, then when creating Content Type B (also a workspace group post) I am asked to select from a node reference dropdown of Content Type A. Can I make the dropdown only show nodes of that type posted to the current group?
Let me try to recap to make
Let me try to recap to make sure I understand. You have two different content types (A and B). Both content types may be posted to a group. Content type B will reference content type A. And what you're looking for is a way for the user to create content type B within a group and then have the reference field be a drop-down with a list of only content type A posts within that group?
Thats exactly right!
Thats exactly right!
One option would be to create
One option would be to create a View that lists all of the content type A's for a given group and then use the node reference URL option off of that content. So the user would navigate to the group, look at the view of content type A, select content type A and then click the Add Content Type B link.
Does that workflow work for you?
Another option which may work is to go to Manage Fields on the content type that contains the node reference field (content type B). Click on configure and scroll to the bottom where you'll find a Advanced - Nodes that can be referenced (View) section. Select from an existing View (assuming you created the view already). I've never used this option but it may solve your scenario.
The problem with the second
The problem with the second option seems to be that there is no way to use a token or a url argument for views used to filter CCK reference fields. I can use a view I create, but I can't specify it down to one specific og because through CCK I can't pass an argument to the view to tell it which OG specifically. At least, I can't figure out how.
For the first option, that sounds workable but honestly I'm slightly confused. Could you clarify that for me? Thanks for the help!
The idea behind the first
The idea behind the first option is to remove the user's ability to create content type B directly. You want them to only create it using the node reference URL link provided on content type A. You can configure the node reference field to provide a 404 if the node reference ID is not provided in the URL and also remove any links (menus, etc.) that let's a user create content type B.
Now the only issue is providing a way for the user to find content type A so they can create content type B. If content type A is organized in groups then you can create a view that accepts a group as an argument and displays content type A. Add any filtering, sorting, etc. that you want. Then make that a page, tab, or block and display it on group nodes. Now the user can navigate to the group, check out the list of content type A and then create content type B using the node reference URL option.
I see what you're saying.
I see what you're saying. That could possibly work. Thanks again.