Drupal theming list Views to display like menus


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. function THEMENAME_views_view_list_VIEWNAME($view, $nodes, $type) {
  3. foreach ($nodes as $node) {
  4. $output .= "<li class='leaf'>" . l($node->node_title, "node/$node->nid") . "</li>\n";
  5. }
  6.  
  7. if ($output) {
  8. return "<div class='menu'>\n<ul>\n" . $output . '</ul></div>';
  9. }
  10. }
  11. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.