0

I have a content type called services_list_page that is used to create a landing page that people can then use to navigate to child pages using the content type service_details. The relationship between these pages is only defined by a menu and no where else currently.

Program Service (services_list_page)
-- Cat1: (not a page, just a category type thing in menu)
  -- child 1 (service_details)
  -- child 2 (service_details)
-- Cat2
  -- child 3
  -- child4
  -- and so on..

I need to have these child pages not only listed in the menu but also dynamically within the content in lists (ul li) one list per child page "category". I have overridden the node template file for these content types. What would the best way to do this with either a module or some code within the template file to pull this data dynamically?

Cory Baumer
  • 397
  • 3
  • 16
  • 1
    This might sound like a ridiculous question, but are you familiar with the Views module? – jerdiggity Sep 29 '13 at 22:32
  • Yes, and I suppose I could put a view block into a region defined in the node template for the parent page, but I think that would be sloppy and I dont know how I would dynamically find the categories that need to be shown on that parent page (that page title "Program Services" has a sibling, and the categories below it need to be assigned to one of the two somehow, I was hoping the same mechenism could be used for the menu) – Cory Baumer Sep 30 '13 at 17:08

2 Answers2

1

you can define your custom page in hook_menu() and print whatever content and links to child nodes you want.

here is an example (slovak) of how I did it, its an newspaper archive http://hnonline.sk/archiv http://hnonline.sk/archiv/2013/10/3

if you need furher help, just ask

Tomáš Tibenský
  • 811
  • 11
  • 20
  • 1
    This would have worked for me, bt I found the menu block method first. Up voted you, but its not the solution I stuck with. Thanks! – Cory Baumer Nov 06 '13 at 17:58
0

Found an easy solution So at first I found a way to get by but it was messy and the in page menus did not get updated when the left nav sub menu was updated. Then I found the menu block module.

  • Install Menu Block Module https://drupal.org/project/Menu_Block
  • add new menu block, configure as needed. starting level set to second level
  • Add the following code to template file to invoke the menu block

You can get the number, in here its 1, from the url when you click configure for the menu block on the block page, so admin/structure/block/manage/menu_block/1/configure becomes:

$block = module_invoke('menu_block', 'block_view', '1');
print render($block['content']);
  • Optional Create template for the menu by creating template file "menu-block-wrapper--1.tpl.php". you can get the menu data by looping through the array called $content
Cory Baumer
  • 397
  • 3
  • 16