Current Node Not Displayed

webavant - February 1, 2008 - 01:12
Project:Viewfield
Version:5.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:minor
Assigned:Unassigned
Status:duplicate
Description

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

#1

TheGecko - March 13, 2008 - 16:47

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.

#2

vperr - March 26, 2008 - 00:54

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!

#3

stormsweeper - April 18, 2008 - 17:42

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) . ')');
  }
}

#4

heydere - April 22, 2008 - 17:32

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

#5

Darren Oh - April 29, 2008 - 17:02
Version:5.x-1.2» 5.x-1.x-dev
Category:support request» feature request
Priority:normal» minor
Status:active» by design

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.

#6

Darren Oh - April 30, 2008 - 16:00
Status:by design» duplicate

Duplicate of issue 165321.

 
 

Drupal is a registered trademark of Dries Buytaert.