Active
Project:
Favorite Nodes
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Sep 2007 at 15:51 UTC
Updated:
3 Sep 2007 at 17:14 UTC
Hi,
it would be kind if you could assign a specific key to the $links entry of the favorite nodes module ( '$links['favorite_node']' in the function favorite_nodes_link() ). This tiny change would be a huge help for everyone using e.g. hook_link_alter() to define conditions when and where this link should be displayed.
With this specific key I could use this function in a custom module e.g. to hide the 'add to favorite' link on the user's own nodes:
function linkchanger_link_alter(&$node, &$links){
global $user;
if($node->uid == $user->uid){
unset($links['favorite_node']);
}
}
At the moment, the key for the $links entry of favorite nodes is simply '0' and therefore could cause problems in case the order of the $links elements will change.
Thank you!
Comments
Comment #1
olio commentedInstead of long explanation, this is how the function favorite_node_links() could look like after the changes I described in my previous post:
Now the links generated by the favorite node module could be easily called and manipulated to fit the specific needs of the user.
Thanks!