0

I was wondering if the following was possible:

  • content type A and B have field X
  • create a view to show nodes of content type A and B
  • show only field X for nodes of content type B?
  • It's a little confusing since you've named both a content type and a field 'A', but I think I'm following. What type of sort do you want? Would it be OK if all content type A's are first and all content type B's are after that? Because that could be done by just having one of the content types as an 'Attachment' – Boriana Ditcheva Apr 29 '13 at 18:55
1

Yes, i'm pretty sure you could use a module like Display Suite to make a custom view_mode for content type B. You could only use this view_mode in your View to show everything but field A from Content Type B.

Note, there are other modules that let you define custom display modes as well -- DS is not the only solution.

0

As tenken said using DS and creating additionnal custom display modes (if needed) is a really good way to go.

I always use display modes in views ("Show: content" and select the display mode) whenever possible. So that when I add a field to a content type I just have to configure the "Manage Display" sections (1 per view mode).

Sometimes I need extra fields to render, to use as token for other settings (rewrite a field, header/footer text, more link,...) or to make grouping. To achieve this I switch the "Show" option from "content" to "fields" and add "Content: Rendered Node" field (that comes with Entity API module). Then the "Show complete entity" display option of this field allows us to choose a display mode (Full content, teaser, list item or any other display mode) and render the nodes.

In some specific situations you may need to share fields between content types. This can be done using "Add existing field" in "Manage fields" section of content types.

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.