7

I am struggling with displaying a view in a node. I have installed EVA module and have created a view of products categorized for that node (Restaurant Type).

The entity displays in the node but I'm having trouble contextualizing the view. How do I dynamically provide the context when the page containing the entity is viewed.

I am normally a PHP programmer and a newbie recently thrown into the Drupal framework. I have been able to print out the criteria (in php template) and display the entity but I am failing in making them play together.

I presume that the "Criteria" I am able to pry out of the template is the long way round solution to my issue, how do I configure my "entity view attachment" to display a contextualized list. my file structure always contains the variable and resolves as "*.com/restaurants/steak_houses" where "restaurants" is the node and "steak_houses" is the context criteria.

I need help in feeding that data to the entity.

  • I am set up in the same way as your example to no success. I think I am getting my context wrong, let me try to explain the parameters. I have an a product list "Broilers" (it is a node) that in categorized according to the restaurant type "Restaurants" (Also a node). I am listing categorized broilers in the restaurants node (Restaurant type examples steak_houses, Institutional, fast_food etc). when accessing the restaurant types the URL cites *.com/restaurants/steak_houses (the last phrase specifies the context "steak_houses". – Glen Bass Dec 30 '11 at 17:42
  • Fields Content: Thumbnail (Thumbnail) Content: Title Content: Broiler Category (Broiler Category) Content: Description (Description) Entity content settings Entity type: Node Bundles: Restaurant Arguments: id Show title: No Access: Permission | View published content Contextual filters Content: Broiler Category -----------In the Context------------ I am able to set the context statically and get a proper list, unfortunately I am still unable to get the context to set dynamically. – Glen Bass Dec 30 '11 at 17:48
12

== Updated. Rewrite the answer, provide step by step screenshot ==

P.S. you also need References, I apologize that didn't mention it.

  1. Create a Content Type called Restaurant, everything by default, save. enter image description here
  2. Create a Content Type called Product enter image description here

    Add Node Reference field for Product Content Type. enter image description here enter image description here enter image description here

Create an instance of Restaurant content. enter image description here

Create an instance of Product content, set the node reference field to the resturant just created. enter image description here enter image description here

Next, create a new EVA view. enter image description here enter image description here

Add filter => Content type => Product enter image description here

Set Entity to node, Bundle to Restaurant enter image description here enter image description here

Add Contextual filter, select the node reference field created. enter image description here

Provide default value => Content ID from URL enter image description here

So you overall EVA view set up should be something like this: enter image description here

Next, an important step: clear the cache, then refresh the restaurant node page to see the change:

enter image description here

You can see the Product One has been attached to the Restaurant.

You will get it. :)

  • I am set up in the same way as your example to no success. I think I am getting my context wrong, let me try to explain the parameters. – Glen Bass Dec 30 '11 at 17:30
  • Can you show your content types setup and views setup? Screenshot would be great. – gilzero Dec 31 '11 at 16:47
  • I assume that you have two content types for this. One is Product. One is Resturant. You want to attach a list of products nodes that associated with a resturant node TO that resturant node. Right? – gilzero Dec 31 '11 at 16:51
  • Yes, "restaurants" and "broilers". A list of broilers matching the restaurant category (steak_houses, amusement_parks, etc.) – Glen Bass Dec 31 '11 at 17:32
  • For some reason the link ref on the edit isn't changing but the images can be downloaded from the links listed above – Glen Bass Dec 31 '11 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.