[development] Sort nodes based on their position on a menu (views_handler_sort_menu_hierarchy?)

Andrew Fowlston Andrew at pedalo.co.uk
Tue Jan 4 14:53:28 UTC 2011


Hi all,

I'd like to sort a view of nodes by the position of the nodes within the primary links menu. I found reference to a method that used computed field to calculate a weight. I'm not dead-set against using that, but thought this might be a good chance to write my first sort handler. I turned to the views docs and promptly found views_handler_sort_menu_hierarchy. I haven't delved much further except to triple-check that I don't see anything in the Views UI that seems to correspond to this sort handler. A quick grep of the class name indicates it's probably for books (which makes a lot of sense), though I can't think why it wouldn't also be open for other content types.

So my questions are:

1. Any comments from folk about the best way to achieve ordering of nodes by their position in the menu?
2. Has anyone used views_handler_sort_menu_hierarchy? Can someone explain why it's not available by default (at least for a 'general' content type)?

Thanks in advance,

Andy

. . . . . . . 
Andy Fowlston
+44 (0)20 8747 5068
andrew at pedalo.co.uk
Skype: andy.pedalo
www.pedalo.co.uk

This email is intended only for the above named addressee/s. This email may be confidential or legally privileged. If you have received this email and you are not a named addressee, you must not use, copy, distribute or disclose the email or any part of its contents or take any action in reliance on it. If you have received this email in error, please email the sender by replying to this message and delete it from your system. All reasonable precautions have been taken to ensure no viruses are present in this email. 

pedalo limited cannot accept responsibility for loss or damage arising from the use of this email or attachments and recommends that you subject these to your virus checking procedures prior to use. Any views or opinions presented are solely those of the author and not necessarily those of Pedalo Limited

Please consider the environment before printing this email


More information about the development mailing list