EVA and Entity Reference Use Case How-to

This article describes the building of a practical example use case using modern Drupal 7 modules and site building techniques. I will show how to use Views, EVA, Fieldgroup, Entity Reference, Entity Reference Prepopulate, Display Suite modules to display content from multiple content types and other Drupal Entities on an article content type page. The goal is build a review system for the article content type.

Modules

Modules used in this how-to.

Display Suite

Display Suite allows you to take full control over how your content is displayed using a drag and drop interface. Arrange and configure the fields for your nodes, views, comments, user data etc. the way you want without having to work your way through dozens of template files.

https://drupal.org/project/ds

EVA

"Eva" is short for "Entity Views Attachment;" it provides a Views display plugin that allows the output of a View to be attached to the content of any Drupal entity. The body of a node or comment, the profile of a user account, or the listing page for a Taxonomy term are all examples of entity content. The EVA views display provides an interface in the Views UI attach a view as a field to any Drupal Entity. It also provides interface to select any value of the Entity that the EVA view field is attached to, as a contextual filter in the view. Allows the options and flexibility of views to be used in your content displays.

You can use EVA to display only fields values for a particular piece of content, giving incredible control over the display and formatting flexibility of the fields. For example you may desire to have two fields concatenated in some special way. You can add your fields to your EVA display, set the contextual filter to NID, add a Global: Text Field, and using tokens format your fields with HTML. Don’t forget to exclude your fields from display if you are going to use them together in a Global: Text Field. Example: You may have a city, state, and zip fields. You can combine them in a Global: Text Field in Views to display as “City, State ZIP”. When you manage the display for your content type add the EVA just created to the display and whenever a node the type is displayed it will pass its nid to the EVA and the EVA will return the fields you select, formatted as you desire.

https://drupal.org/project/eva

Entity Reference and Entity Reference Prepopulate

Entity Reference provides a field type that can reference arbitrary Drupal Entities. Entity Reference Prepopulate allows prepopulating any entity reference field via URL argument.

http://drupal.org/project/entityreference

https://drupal.org/project/entityreference_prepopulate

Fieldgroup

Fieldgroup will, as the name implies, group fields together. All fieldable entities will have the possibility to add groups to wrap their fields together. Fieldgroup comes with default HTML wrappers like vertical tabs, horizontal tabs, accordions, fieldsets or div wrappers

http://drupal.org/project/field_group

How-to Guide

Create a “Review” content type.

  • Add an entity reference field (Label: Article Reference fieldname:field_article_reference) to the view which will be prepopulated by a url argument via a link created by a custom Display Suite code field.
  • In the settings for the entity reference field in the “Additional behaviors” group check the “Entity reference prepopulate” checkbox. For the action property set Disable field. This shows the article that is referenced but doesn’t allow the user to change it when creating or editing review.
  • Create Display suite code field
  • Check the Node value for the Entities field. This will attach the custom field to Nodes (Content).
  • Enable tokens for the custom code field by checking the Token check box below theField Code
  • Set ‘Text Format’ to ‘Display Suite Code’ and create token html code for a link where field_article_reference is the name of the entity reference field created in step one and added to the article content type

Create a Review for Article EVA

  • Create a new view listing Content of Type Review
  • Add an EVA view display.
  • Enter a value for the view Title, "Reviews"
  • In the Entity content settings category
    1. Set Entity to Content (Nodes)
    2. Set Bundle to Article
    3. Leave Arguments set to id
  • Add a contextual filter that is the entity reference field of the Review content type.
    1. Add Contextual Filter: Content: Article Reference (field_article_reference)
    2. Under When the filter value is NOT available set hide view
  • Sort by postdate.
  • Display an unformatted list of Reviews teasers.

Add view to Article Display

  • Manage the display for the Article content type. For the Default or the Full Content display modes select custom display suite layout, for example (One Column)
  • Add a horizontal tab group Field group and two horizontal tab items Fieldgroups. Nest the two tab items in the tab group. Nest the article body and other fields (comments, links, title) in the first tab labeled “Article”.
  • Nest custom Display Suite Field second tab item labeled “Reviews”.
  • Nest the review list eva field in Reviews tab after the custom field.

Tags: 

Comments

rewq

Here in this post, you

Here in this post, you describe the beautifully about the entity and entity reference. I need this topic because of my project and I need the good data. You give the good detail and helpful for me. Thank you for sharing this post and I am preparing essay on time with the help of some paper composers and will share with you guys.

Lavender (L. angustifolia and

Lavender (L. angustifolia and others) is a shrubby flowering bush indigenous to the mountainous regions of the western Mediterranean and is considered have been first domesticated by the Arabians, then later spread across Europe by the Romans. discover here

miom

Produk Jelly Gamat -Not only good for health but also very useful for the treatment, Ace maxs made from mangosteen peel and soursop leaves, Had a very remarkable properties. Because the content is owned mangosteen peel is needed by the human body.recent post- Ace Maxs

modern Drupal 7 modules

Superior introduction keen on responsive design, excluding unfortunately here are some issues that still stay unanswered by the responsive rationality.The major in my view are 'responsive tables', which is a typical issue not yet understood by responsive outline. do my essay

The Moncler Outlet starts

The Moncler Outlet starts from 1952 if Rene Ramillom and Andre Vincent fabricated their aboriginal anorak for workers. Accompany acclimated acquaintance of abstracts in Apple War Two times if they fought in French Resistance troops. Young humans - agent Andre Vincent, architect Rene Ramillom and arch drillmaster Lionel Terray Grenoble absitively to use their abilities cheap Moncler jackets for aggressive purposes. French aberrant army needs acceptable accessories to attempt able German troops. And accompany apperceive mountains with all the dangers and arresting angle and wish to assure colleagues from algid and diseases.After continued Moncler Outlet UK aeon of abstracts accompany accept the able actual - new polyester fiber, alleged Tergal. And afterwards some time no ads were bare – Moncler became acclaimed and reliable trademark.In 1968 Moncler advised accouterment for the French at http://www.mohanan.co.uk Alpine skiing Team which alternate in the Grenoble Olympic Games.

I think such modules are the

I think such modules are the best for students as it doesn't cost a single penny. You must provide a demo as Phuong Hoang recommend you which provide them an ease in the use of this plugin. For students, it is best to get essays online which will be helpful to get written their contents at low cost.

Great information

Entity means some kind of things and entity reference is the content of entity. As we know that Drupal is vast software and we need to learn it. For this purpose, everyone who is known to the Drupal software makes a video or some kind of article to help the people. Your views are great and very helpful. Just visit this http://essaymama.org/research-paper-help.html website and complete all type of task.

Harvest Project

This post is very informative to teach us about the entity reference and the techniques you provide in this post is really so helpful and I need this help. I search lots of sites but I never found such informative post related this topic. Thank you for sharing this post with http://www.bestessay.org/ which you can get best quality work with the support of our writers.

Good post

Aren’t these things a little bit outdated? I don’t think it is possible to do these things this way. Our systems have been updated and we are using codes and techniques according to it. You don’t have to type all these codes now.  prefab tiny homes

Essay

I'm therefore happy that the weblogs supply all of us along with someplace to operate in order to for those the educational composing problems. I'm within serious require associated with buy assignment assistance. We possess a small amount of time remaining and far when i possess attempted to get this done by myself, We can't draw this away. Make sure you stage me personally within the correct path.

good post

It is the first time I am hearing about Drupal 7 modules and the site building techniques. You have provided some reference guide that can be very helpful for the people to gain some knowledge about the building techniques and its uses. internet providers

Good

It has reliably been a dream of mine to one day open and keep up a private wander. I feel that I know myself well, and that this calling field would suit me best. Instead of have one significant association that got a satisfactory wage yearly, I need to have different private endeavors which hence incite to broad net incomes.<a href="http://www.instylejackets.com/product/game-of-thrones-tv-series-jon-snow... Snow Jacket Instylejackets</a>.

I am searching for this topic

I am searching for this topic and try to know about the information related Eva and entity reference. Your information is true and you described everything in detail and it is very easy to understand. I did not face any difficulty in asking online experts to write an essay for me when it comes to complete assignments.

The Idaho state display some

The Idaho state display some rules and authorities which are good. This state can now easily implement some rules which are so important. But I can say that Idaho state working so good and set the exemplary model to the other state. The best opportunity to get cheap paper writing service online which is the good helping material.

Pages

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.