5

I want to display the Node Reference Select List (usually a long list of nodes, unordered and generally quite long) as an ordered bunch of nodes, that replicate the structure of the menu system.

The whole idea, is for a user to be able to choose another Node, but as there are so many nodes already on the website - it can be difficult to find the correct one in the select list. I have attached a screenshot to show a random example of how I would like this to look. This is just a quick mock-up image that I hope can be achievable.

The new "menu style" select list makes it easier to find the particular nodes you want, as they mirror the menu system of the website.

enter image description here

I looked into using Views to replicate the structure of the menu in Drupal, but this doesn't seem possible either. If this was possible, I could simple use the "Advanced - nodes that can be referenced" and just list out the pages by the menu with the order - but it doesn't look possible to integrate Views and the drupal menu system.

Any help would be excellent with this. Thanks, Garry.

1

You can use view to display all node you want and use expose filter to search for a specific node or to display as tree I guess there is a module to display taxonomy as a tree reference to make it like parent and child so you can convert your node to be taxonomy to easy make it as a tree or change the module structure to display nodes

|improve this answer|||||
  • I'm not using taxonomy and won't be implementing it either as CCK is much better. – Garry Feb 6 '12 at 14:55
  • look I think that taxonomy is a perfect solution to parent child relation and sure cck is much better, try to use draggable view I don't know if it can help – Ahmed Feb 6 '12 at 22:45
1

Using a view on the reference field and:

I have used

http://drupal.org/project/views_hierarchy

or views tree

http://drupal.org/project/views_tree

Could help you.

|improve this answer|||||
1

Most of the suggestions are for the display of hierarchy on the front end, however this requirement is to be able to get that on a Reference view, to be used for selecting a value in a nodereference field.

My solution was the following, which is dependent on path aliases reflecting the menu structure:

  1. On the reference view add the field "Content: Path"
  2. Install the module Views PHP or do a template override
  3. Output the path of the node using the Global: PHP field like that below

    nid); print substr($static, 0, strrpos($static, '/')).' - '. $row->title; ?> The above giving you a list of node titles prepended by the menu path.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.