Show only nodes that are connected via entity reference with views I am trying to create a simpler version of Organic Groups as I don't need most of it's functionality. What I am trying to do is use entity reference, nodeaccess_userreference and nodeaccess_nodereference to duplicate the bulk of what OG does.

At the moment I am trying to create the view to show all content types content that is linked to a "group" content type.

Content types:

Group

Link

Text Post

(basically reddit.com!)

Fields:

field_group - entityreference to group content type attached to link and text post.

field_shortname - textfield with a shorter name for group (no spaces, alphanumerical, etc..)

Views:

Format: Unformatted List

Page: /g/% &lt;---so I can use group name or shortened name to access group page

Relationships:

Entity Reference: Referenced Entity to field_group (required)

Contextual Filters:

Content: Title

Content: Field_shortname

Content: NID

(all requiring relationships to Entity Reference)

This way if some one goes to /g/Long-Group-Name-Blah-Blah /g/Shortername or /g/3 they will all point to the correct group page and show the link and text post content type content.

I can sort of get it to work if I just use Content: NID as the contextual filter. But I would like to be able to use the group name or shorter version in the URL as well. It also stops working as soon as I add 2 contextual filters.

Any help on getting this to work. 

Thanks
Contextual filters work combined (AND), so if you define two or more contextual filters, all of them have to pass.

Here's what I would do.


Use Pathauto to create a pattern for your group content, e.g. g/[node:nid].
Create additional aliases for long name and short name.
Make your view work with just the NID contextual filter and use the block display type.
Configure your block to only show up on group node type and place it in main content. 


Alternatively, you can also use Panels to create a similar node page for group nodes. To create the additional URL aliases for each group, you might want to try NodeSymLinks module.