For a view I needed the node id but there was no option to disable passing the entity_id's as arguments so my default argument never worked.

I added a 'Pass arguments' checkbox in the display settings to enable/disable passing the arguments to the view and fixed some minor code style issues along the way ;)

CommentFileSizeAuthor
pass_arguments.patch2.76 KBmrharolda

Comments

mrharolda’s picture

Shameless bump...

g089h515r806’s picture

Have you test you code with latest dev version?

marblegravy’s picture

MrHaroldA - Applying the patch I can get the entity ID to come across as a field value, but it's still not available to be used for contextual filters.

You can't use it or add it in the Filters section even, so I don't know how you used the value to give your view understanding of which node you are looking at?

mrharolda’s picture

@marblegravy: I've used a "contextual filter: Content: Nid" with "Provide default value" set to "Content ID from URL".

jdjeet’s picture

Hi,

MrHaroldA is right, You can use contextual filter if you want to filter the context to a certain section.

But for your query as you need nid to be available, you can use relationship.
I guess you are creating field collection entity view. you can get nid and other content details by creating a relationship to the relevant node entity.

-Thanks,
Jeet

marblegravy’s picture

Thanks to both of you for your assistance.
Yes, the issue was that I was trying to use the provided field collection view template and apply that directly to the field which does not have nid available. The solution was to ignore that and create a block with a new view using a relationship. Much more flexible and let me do exactly what I needed to do.

jdjeet’s picture

Status: Needs review » Fixed
mrharolda’s picture

@jdjeet: is this committed? Can't find it in the repository viewer: http://drupalcode.org/project/field_collection_views.git

g089h515r806’s picture

Field Collection already provide more views integration now.This issue could be resolved with latest version of field collection.

jdjeet’s picture

Hey, I found the issue can be solved in the latest version of FC view.

Field collection gives you an relationship if you are looking to connect to another context in views.
Please let me know if I am wrong.

-Thanks,
Jeet.

Status: Fixed » Closed (fixed)

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