0

I have a site that uses Entity Reference to link exercises with guitar lessons (these are two content types). I created a view (both content pane and block, identically configured), of display type Display Suite, which filters on exercises, uses a relationship with referenced entity, and contextual filter of content node id which corresponds to the lesson node id. In preview all looks fine,a lesson is displayed as well as its associated exercises, and I saved the view.

In Display Suite I managed the display for exercises and lessons and added the view I created to be managed by Display Suite.

So I thought all would be fine on my site, but when a guitar lesson page is loaded, it only displays the lesson fields as managed by Display Suite, but it does not display the exercises associated with the lesson, which I thought would work based on the view.

Now if under Structure->Blocks I attach the block view to Content, then the exercises display with lessons. But I thought Display Suite allows one to not think about blocks and instead use views and content panes to control display. Since the view has a content display type, and since the lesson and exercise content types are configured to display fields in DS-arranged content layouts, why on earth would the content pane view not be displaying?

I am new to drupal and I have no idea how clear I have described this issue, but I can clarify as needed.

Any troubleshooting tips to figure out what is going on?

I also have Page Manager and Panels installed, but I disabled the panels I had created previously and I don't see how Page Manager would be interfering since I don't have it managing any of my pages.

Regards

1 Answer 1

1

Unless I'm missing something I think you might be confusing the functionality of Display Suite with that of Panels. Views content pane displays can be accessed from the Panels UI and added to a page but I've never seen that functionality within Display Suite. Are you using any additional modules to add this functionality?

There's various ways you can do this but a really quick and easy approach is to use EVA. Here is it's project page description.

"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 placement of the view in the entity's content can be reordered on the "Field Display" administration page for that entity, like other fields added using the Field UI module.

In addition, the unique ID of the entity the view is attached to -- as well as any tokens generated from that entity -- can be passed in as arguments to the view. For example, you might make a View that displays posts with an 'Author ID' argument, then use Eva to attach the view to the User entity type. When a user profile is displayed, the User's ID will be passed in as the argument to the view magically.

That's right: magically.

Basically, create an EVA variant of your view, there's a couple of settings to say what entity type (node) and bundle (Guitar lesson) to attache it to. save this and go to the manage display page of your content type and the view will be there.

It will work with Display suite turned on or off.

5
  • I am basically following an example of how Display Suite and Views work together. See [here]( drupalize.me/videos/display-suite-views-displays?p=1141) Display Suite can manage views and display them. So I instructed DS to display the content pane view (lesson with exercises), and assigned the view to the layout. Should work (in preview mode view renders correctly), hence I am so puzzled... Sep 8, 2015 at 18:26
  • The video you link to is about modifying the display output of a view using display suite, but following these steps alone will not make the view appear on your lesson pages. To achieve that you are probably best off using either EVA (above), drupal.org/project/views_content_ds or display suite dynamic fields. You may already be using one of these in which case we need to know which one in order to help you further. If not then do you see the view as an option in your content type's manage display form? Sep 9, 2015 at 8:55
  • I got this working using views_content_ds, but now I am wondering about why I even chose content pane. Maybe page is what I am really after? I need to read up on dynamic fields. I have to figure out what one writes in the field editor. Sep 9, 2015 at 16:23
  • ok, I've never actually used views_content_ds so but it looks like it's pretty similar to EVA. In which case, it would be good to rule out a couple of things. Firstly, does the view appear in you "Manage display" screen for your content type. A screenshot of this page would help. If it does and it's set up correctly there then another possible issue would be that the nid contextual filter is not getting through. A way to test this is to edit the contextual filter and make sure the value of the "When the filter value is NOT available" is "Display contents of "No results found"" Sep 10, 2015 at 10:23
  • ...Then add a text area under "No results behaviour" and enter some text you'll recognise later. save and go back to your node page. If you see the text you entered then the view is inserted in the page correctly but the contextual filter is not getting the correct value. In that case it should work if you set the contextual filter's "When the filter value is NOT available" value to "Provide default value" and set "Type" to "Content ID from URL" Sep 10, 2015 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.