Hi,

I would like to use this module for a seminar view (showing different sessions, sorted by date). I've followed the instructions (and am using default queries) and no Prev / Next buttons show up on the nodes clicked into from the view. Tried on both a page and block view.

I'm wondering if there's something missing in the view not described - looking through the module there doesn't look like any dependencies.

Comments

gaëlg’s picture

Status: Active » Postponed (maintainer needs more info)

How are the links to the nodes in your view? Do they contain GET parameters? It should look something like http://mysite.com/node-path-or-alias?vnc=SOME-HASH&vnp=X.
If they don't look like that:

  • Did you clear your cache?
  • How do you get links to node? I forgot to mention but the module currently only works with the fields view format, not the content one. I'll add it to the description.

If they already look like that:

  • Did you try to use the default theme? Your node page template may hide the node links.
chernetsky’s picture

I had the same problem until switched my view to fields view format.

But some kind of problem still remains: I have these good 'complex' links (../node/NODE_ID/vnc=d_cQK_Vp3Y-E_AIMjJlQoXlN35Ca0kSkM8GU7P8KqJE&vnp=1) only on titles. But if I add node image field to display and choose "Link image to content", these links remain 'simple' (../node/NODE_ID).

Also I get 'simple' links if I add to display Content: Path field.

The first solution in my mind: to write my custom module to manualy extract proper paths from Titles and use them where I want...

gaëlg’s picture

Status: Postponed (maintainer needs more info) » Needs work

It's a problem in views_navigation_views_data_alter(). It only changes the link url if the field handler is "views_handler_field_node". I'll look further ASAP, but image field and path field may use a subclass of views_handler_field_node.

chernetsky’s picture

Title: No buttons showing once view has been edited » Working Content: Path
Category: bug » feature

I managed Content: Path field.

In file views_navigation.module file changed function views_navigation_views_data_alter():

/**
 * Implements hook_views_data_alter().
 * Replace views field handler class with our own subclass.
 */
function views_navigation_views_data_alter(&$data)
{
  foreach ($data['node'] as &$item) {
    if (isset($item['field']) && isset($item['field']['handler'])) {
      switch($item['field']['handler']) {
        case 'views_handler_field_node':
          $item['field']['handler'] = 'views_navigation_handler_field_node';
          break;
        case 'views_handler_field_node_path':
          $item['field']['handler'] = 'views_navigation_handler_field_node_path';
          break;
      }
    }
  }
}

Added into views_navigation.info file:
files[] = views/views_navigation_handler_field_node_path.inc

Created new file views/views_navigation_handler_field_node_path.inc with this content:

class views_navigation_handler_field_node_path extends views_handler_field_node_path
{

  function render($values) {
    $nodeUrl = parent::render($values);
    $nid = $this->get_value($values, 'nid');

    if (isset($this->view->views_navigation_cid)) {
      $nids = array();
      foreach ($this->view->result as $result) {
        $nids[] .= $result->nid;
      }
      $index = array_search($nid, $nids);
      $nodeUrl .= '?vnc=' . $this->view->views_navigation_cid . '&vnp=' . $index;
    }

    return $nodeUrl;
  }
}

After these changes I can use 'Content: Path' path in my view to rewrite links in following fields or something like that.

gaëlg’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Needs work » Fixed

Thank you chernetsky. I refactored it a bit and added other handlers. Fixed in dev by commit 9e83e2d.

gaëlg’s picture

Released in beta3.

Status: Fixed » Closed (fixed)

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