0

I have two content types. One is author (fields are author name, designation, bio, image etc) and another one is article. In article content type, I have created an entity reference field "Author Info" where target bundle is author. While I am creating article, I get author list in Author Info field and I can select an author from the list.

When visiting the article page I only see the Author name/title under Author Info field. But I want to display there all author fields information.

I did some search to find out a way but no luck so far.

How I can do that?

Do you have any hint about that or what to search for?

1

Depending on your layout and other details there are a few ways to handle the display of the content from your related entity.

The most basic (and therefore limited) way is to go to Manage Display first on your article content type and adjust the settings for the format. It is likely already "rendered entity" (if not set that) and then click the gear to the right and set the view mode to be Default or Teaser. Once that's set, switch to manage the display of your authors and make sure the fields you want to display on your article pages are enabled.

The draw back to this approach is that it can have side effects unless you create extra view modes and are careful about when those modes are displayed. For example, if you change the teaser settings any place the author teasers appear will change to match. If you install Display Suite you will have additional options to control the layout of both content types within the Manage Display form.

A common approach is to use views. With Views you can create a block that displays the author information, and then you can carefully place that block where ever you need. There is a reasonably good tutorial on Drupal.org for how to set something like this up in a general case.

If you'd like to do more research on options I suggest searching for things like "drupal views entity reference" or "drupal ds entity reference".

  • I think "rendered entity" things will help me in this case. I will check in details. Thanks for your answer. – Suvash Sarker Nov 6 '16 at 19:52
  • If you are going to try to do much with rendered entities (which can be a great approach) you'll probably want to look into Display Suite to help give you fine-grained control. – acrosman Nov 6 '16 at 20:02

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.