Pass Nid as argument in Field collection Views

  0 comments

A field collection is internally represented as an entity, which is embedded in the host entity. Thus, if desired field collections may be viewed and edited separately too.

To Pass Nid as argument in Field collection Views one can follow the following steps:---

  • Create a field collection view.
      • Select field collection item from show selectbox
      • Select create a block checkbox for create view as a block
      • Click on continue & Edit button

    field collection view image

  • Fields:
    • Field collection item: field name
  • Relationships
    • Field collection item: Entity with the Field collection field name from content type (field_machine_name)
    • Make sure Require this relationshipenabled

      require this relationship image

  • Contextual filters
    • Add Content: Nid

Take a look on below image of Field collection view for reference.

Field collection view

Add new comment