1

I have two content types: Content A and Content B

Fields in Content A: Title, Location, Body

Fields in Content B: Title, Type, Location, Body

Location is a vocabulary (Au, Uk, Us, Ca, etc)

Type is an entity reference of Content A inside Content B node.

Content A has a node with information in order: News X, Ca, This is the body of News X

Content B has a node with information in order: John Doe, Content A, ????, This is about John Doe

In this question mark, I want to include Location but only that which is selected in that node of Content A.

Location can be multiple, that is, if Content A node has "location": Ca, Uk then Content B node referenced to Content A will only enlist Ca, Uk out of all other terms in that vocabulary.


I have looked into google, found nothing. Please help.

2

For simple displaying of taxonomy term

Assuming your are using entityreference for Drupal 7 the module provides out of the box a field formatter that allows you to display the Rendered entity with a specific view mode

Thus you can display the referenced entity with the taxonomy term included.

Go to the manage display of your Content B and change the format to Rendered entity and choose teaser for the view mode

enter image description here

Go to the manage display of your Content A and modify the teaser view mode and add the taxonomy term field to be displayed.

For more advanced use cases

You might want to try any combination of the following

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.