Posted by emackn on March 8, 2007 at 3:47pm
| Project: | pathmenu |
| Version: | 4.7.x-1.0 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Any plans or timetable on when this might be available for Drupal 5. If there are none, I wouldn't mind giving it some time.
Comments
#1
Not really. I actually work only under Drupal 4.7, that's why there is no Drupal 5 version of pathmenu.
You're welcome. It shouldn't be that hard (though I don't know for sure) since the module is quite simple in its Drupal interaction. If there's anything I can do, just ask for it !
#2
I've had a go at updating this for drupal 5.1, but can't seem to make it work. My updates so far:
1. added the .info file
2. commented out hook_help
3. updated the menu (for the settings page)
4. updated the form validate and submit functions
I'm working in function _pathmenu_execute_rules() and the phpcode seems to be generated and does evaluate, just no result in the site. I have a few pointers and questions in this function:
Shouldn't this
$url=$_SERVER['REQUEST_URI'];if(substr($url,0,4)=='/?q=') {
$url=substr($url,4);
}
...be this
$url = drupal_get_path_alias($_GET["q"]);I also am failing to see how the pathmenu_add_menu does anything, and what the array_merge in the menu hook is doing. The only thing the stored php code is doing is calling menu_set_location. I don't see how any values are being returned to the menu hook.
My rule:
nodetype(biography)->parentpath(about/team)The resulting phpcode to be evaluated:
if($nodetype==\'biography\'){menu_set_location(array(menu_get_item(NULL,\'about/team\'),array(\'path\'=>\'$url\',\'title\'=>\'Nothing\',\'type\'=>MENU_VISIBLE_IN_BREADCRUMB)));return TRUE;}return TRUE;... or cleaned up
if($nodetype=='biography'){menu_set_location(
array(
menu_get_item(NULL,'about/team'),
array(
'path'=>'$url',
'title'=>'Nothing',
'type'=>MENU_VISIBLE_IN_BREADCRUMB
)
)
);
return TRUE;
}
return TRUE;
I even tried hardcoding the phpcode instead of using eval, still no go. I haven't looked into any of the other functions or files, but I'm assuming they are just for generating the phpcode that is stored in the db and eval'd from the menu hook.
I'm attaching my modified module.
#3
I think you're right (and it's way more elegant). I will look at it.
pathmenu_add_menu works in two ways :
The aim of this function is to use the fact that pathmenu_menu (hook_menu) returns an array of items to add to the menu system. Thus the line
<?php$items=array_merge($items,_pathmenu_execute_rules($phpcode));
?>
merges the menu items from the pathmenu module with the possible menu items generated by the actions.
It should work as expected. I assume you will have biography nodes and you want the breadcrumb to show "home >> about >> team" for each of these nodes. Am I right ?
Don't forget that the generated PHP code is meant to be executed within an environment (for example it assumes $nodenid, $nodetype and $nodeterms are predefined).
That's exactly how it is.
#4
Hi,
Is there a drupal 5 version please?
Thanks a lot for considering this!
greetings,
Martijn
#5
Subscribe