How to list from a certain "nid" ?

cmrabet - September 30, 2009 - 14:31
Project:DraggableViews
Version:6.x-3.3-beta2
Component:User interface
Category:support request
Priority:critical
Assigned:Unassigned
Status:closed
Description

So far you have to list an entire content type (in Views you filter by content type and then all the view records are sorted in the tree fashion).

But what if you wanted to list just from a certain node in the structure?

I am using this module to show a Bill Of Materials, where all the nodes are the same type (cck_assembly). Each one represents a part in a certain mechanical assembly, and also each assembly can be child of another one, and so on..So far I have to list all them (filter content type=cck_assembly).

I would like to list only from a certain assembly (a certain parent node nid).

Is this possible now?

Thanks and regards,

#1

sevi - September 30, 2009 - 17:59

Unfortunately this will not work out of the box. You can use taxonomy to limit the listed nodes.

#2

sevi - September 30, 2009 - 18:04

If you use only 2 hierarchy levels you can use a CCK-field as the parent field in combination with the CCK handler (see 1 - Using CCK handler) for the parent field. So you can use it as a views argument (Familiar with views arguments? It's very well documented).

Greetings,
sevi

#3

cmrabet - October 4, 2009 - 10:05

Well I managed to do it.

I added new fields to my nodes:

a) The root node nid of the tree, all the nodes of the tree stores this data, so you can know which tree they belong
b) Parent node nid, the immediate parent node
c) Level, the depth level, for me is 10, 100, 1000, 10000, etc.. (1st, 2nd, 3rd, etc..)

So when I want to show a tree from a certain node I pass to the view the node of the nid (parent node), its root node (the tree node), and its level.

Then the view lists all the nodes whose root is argument (arg:root), and level argument is higher than (arg:level). The drag gable views then builds the tree taking into account the parent and node number.

:=)

#4

cmrabet - October 5, 2009 - 12:52
Status:active» closed

This point is solved for me. I have other problems.

 
 

Drupal is a registered trademark of Dries Buytaert.