It seems like the view omits the displaying the current node. Is there a way to change that easily?

Comments

TheGecko’s picture

Same issue here.

Using Viewfield to display a GMap view in a node and all the nodes are displayed except the current node.

Not really any idea where to go with this, but would like it to be displayed as I want the current node to be displayed as it's the main reason why the view is being shown on the node.

vperr’s picture

I am having a similar problem but even worse. I have created a view (a page view) that take as argument the $nid to display the node on a map. The view works fine when I tested it alone by passing nid manually but when I include the view as a field in a node nothing is displayed, not even the map!
This module is great but if it does not work with GMap than it is a really pity!

stormsweeper’s picture

It's explicitly done in the code, I presume to prevent an infinite loop:

/** 
 * Implementation of views_query_alter
 *
 * Prevent views from loading the node containing the view.
 */
function viewfield_views_query_alter(&$query, &$view, $summary, $level) {
  global $viewfield_stack;
  if (!empty($viewfield_stack)) {
    $query->add_where('node.nid NOT IN (' . implode(',', $viewfield_stack) . ')');
  }
}
heydere’s picture

subscribing. I need to display views information about the current node as well.

darren oh’s picture

Version: 5.x-1.2 » 5.x-1.x-dev
Category: support » feature
Priority: Normal » Minor
Status: Active » Closed (works as designed)

This is by design. However, it would be possible to include the current node in its own viewfield if the viewfield were excluded from the view. That doesn't mean anyone's planning to work on it.

darren oh’s picture

Status: Closed (works as designed) » Closed (duplicate)

Duplicate of issue 165321.