Views navigation doesn't work if you render your views items with display suite.
Thanks

Comments

gaëlg’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

This is not always true. It's a tricky problem but I made something that should work in this commit: https://www.drupal.org/commitlog/commit/51720/607394a95de57332a60fd2faf0...

It might need improvement to work in some special cases though. Please provide info about how to reproduce this on simplytest.me.

gaëlg’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No answer for 2+ months. Closing.

heine’s picture

Title: doesnt work with view redered with view modes (display suite / rendered entity) » doesnt work with view rendered with display suite
Status: Closed (cannot reproduce) » Needs review
StatusFileSize
new2.42 KB

Display suite is a render plugin distinct from "Rendered entity". Attached patch adds an override handler.

Depends on the patch from #2498573-2: Fix incorrect links by moving replacement to #postrender

heine’s picture

Title: doesnt work with view rendered with display suite » Add support for view rendered with display suite
gaëlg’s picture

The code changed in the meanwhile. The attached patch seems to work for me. Can you please confirm?

BarisW’s picture

Issue summary: View changes
Status: Needs review » Needs work

Patch works fine, thanks.

The only thing I found is that the preg matching fails when using a language prefix in the path (eg /en/name-of-my-node).

And one minor performance improvement:

+++ b/views/views_navigation_plugin_ds_entity_view.inc
@@ -0,0 +1,18 @@
+      foreach ($this->entities as $entity) {
+        module_load_include('inc', 'views_navigation');
+        _views_navigation_replace_href_in_html($return, $entity, $this->view);
+      }

Minor fix: the module_load_include can be placed above the foreach

BarisW’s picture

Status: Needs work » Needs review
StatusFileSize
new5.95 KB

Here's a patch that fixes my comments in #6.
It also adds the replace_html logic for the entity_views_plugin_row_entity_view class and implements a new one for the entity_views_handler_field_entity.

BarisW’s picture

StatusFileSize
new5.95 KB

Same patch with a small improvement, that takes the domain into account. This is useful for sites that use the subdomain module icm with views navigation.

gaëlg’s picture

workplaysleep’s picture

This patch worked for me, but I had to remove the language prefix. My project is in a single language (dutch), the node paths have no language i them (normal for single language), but the pattern made in '_views_navigation_replace_href_in_html' contains '/nl' zo I had to comment out these 3 lines to make it work.

I (mis)use _views_navigation_replace_href_in_html in hook_views_pre_render to add a extra link field to the views row. I use this field to wrap each views row in a href. Probably not the cleanest solution, but I wanted to reduce the markup made by views and the rows template seemed the best location to wrap a link around the teaser, any thought on a better solution are welcome ;)

workplaysleep’s picture

I ended up directly calling '_views_navigation_build_url' form 'hook_views_pre_render' to create the link, so need for the patch, but my previuous comet might be useful for others.

  • BarisW committed 064f44e on 7.x-1.x authored by Heine
    Issue #2316483 by BarisW, GaëlG, Heine: Add support for view rendered...
BarisW’s picture

Status: Needs review » Fixed

I committed this to dev. Couldn't reproduce the comment in #10. If this is still an issue, please open a new issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.