I am using the menu-block module (http://drupal.org/project/menu_block)
to generate 2nd level and 3rd level navigation blocks for my site. Everything is based off of Drupal's primary links and it's children.
I need to grab a custom CCK field I defined in the node associated with a menu-item and display it in the menu-block
So for example there is a top level navigation item "About Us" with 3 children. "Team" "Careers" and "Contact Us"
Within the Drupal admin I can see the nodes associated with each menu-item. Each one of these nodes has a CCK field called "menu_teaser"
I need to write out the "menu_teaser" field under the link in the menu-block generated.
Any help would be appreciated, let me know if I am posting this in the right place or if it should be module development
Thanks!
Comments
Figured it out
I ended up figuring this out myself and decided to put it up on here in case anyone else needs it.
I ended up starting by using the nice menus module instead of menu blocks.
Then I created a menu_teaser field for the content types that will be menu items.
I copied over the theme_nice_menu_build from the module to my template.php. Then just added in a function to grab the field with the nodeID if it exists.
Here is my template.php file
Thank you, this works great!
Thank you, this works great!
np
glad it helped :)
Hi, thanks for the code.
Hi,
thanks for the code. So, if I want to creat a block with cck field from the node. I can do it with following code?
Instead of menu_teaser I just put my field name? Do I need to get the nid? What does this $node_path does?
thanks
function c_menu_teaser($node_path) {
$thenode = node_load($node_path);
if (!empty($thenode->field_menu_teaser[0][value])) {
$menu_teaser = $thenode->field_menu_teaser[0][value];
return $menu_teaser;
}
}