1

I have searched on this topic and have seen a number of answers, but they all seem rather complex for what (I think) is something straight-forward.

Our not-for-profit holds a monthly meeting. There are two primary program elements at the meeting: Presentation and Panel. A meeting will always have exactly one Panel and between zero and two Presentations.

I have created Content Types for Presentation and Panel. Presentation has the fields: Title, Date, Presenter, and Description. Panel has the fields: Title, Date, and Description. I would like to create a view which outputs the following: Date Panel->Title Panel->Description Presentation->Title Presentation->Presenter Presentation->Description

Where the Presentation block is hidden if there are none and repeated if there are two.

I believe the Filter Criteria are set correctly - Content: Type (in Panel, Presentation)

Under Format->Setting, I grouped by Date.

The problem is that I cannot control the output - the fields all appear, but I cannot order them as desired nor can I format them as desired. The reason, I think, is that the field have the same name in the two Content Types, thus I do not seem to be able to address either directly.

I did try a PHP control to try to see what was happening. I basically created variables for each of the five outputs I want and printed them. Each date resulted in two calls to the print statements: the first print shows nothing for the Panel variables and has the proper values for the Presentation variables, whereas the second print shows nothing for the Presentation variables and has the proper values for the Panel variables. (What puzzles me is that I was only expecting a single print due to the grouping...)

I would appreciate your providing me with some guidance.

Thank you.

  • 1
    if fields have the same machine name, it means it's the same field, just in two content types. So by design you are unable to distinguish them at field level. I wonder why you have chosen design like this. I mean, if I want to show a meeting, I make content type "meeting". If I want to attach something to it, I use entity reference, or make the attached things fields / field groups. Exactly to have it easier to work with views and similar tools. Why have you chosen to group them by date only, with no logical entity to describe a meeting itself? – Mołot Dec 27 '13 at 7:33
  • Molot, Thank you for the reply. I will look up Entity Reference and see if that will help. I was mistaken in my previous post - the description field is named differently. However, the Title field is the Node title and there is no way to change the name of that field, so the problem stands. – GRoston Dec 28 '13 at 22:41
  • Molot - thanks for the reply. I added the Reference module and was able to get this working. – GRoston Jan 1 '14 at 23:24
  • If you'll post self-answer about how exactly you did it, I'll be glad to upvote it :) – Mołot Jan 2 '14 at 7:38
1

In response to Molot:

There are several ways to skin this cat. I believe that the approach I took is the easiest, though there is one remaining issue (more below).

Steps:

  1. Add the References module (other options include using the Entity Reference module and one other similar module)
  2. On Admin->Modules, under Fields, enable References and Node Reference, and click Save Configuration.
  3. For the 'parent' entity type (in my example above, Panel) add a new field of type Node Reference. In the settings for this field, select the content type(s) that can be referenced (for my example above, I chose Presenter).
  4. In the patent entity type, chose Manage Display. For the Referenced Node, you can choose 'Rendered Node' as the Format of the child node (and you can define this to be the default view, the Teaser view, etc.)
  5. For each entity of the parent type, in the newly created reference field, start typing the title of the field to be referenced, then click the proper one.

As noted above, I am still having one problem - see Configuring View output with multiple related nodes for details.

I hope you find this helpful.

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.