Recipe 71: Tweaking output with hook_link_alter
Note
Ingredients
Recipe 70, completed to at least Step 8
This recipe has two major goals. The first is to remove the link to the parent feed that appears under each node in Recipe 70. The second is to provide a slate for implementing the debugging strategies found in the next recipe, to help you to figure out how to make such tweaks on your own.
The
SimpleFeed module creates several links in the $links
array, which many people will find to be extraneous. The SimpleFeed documentation simply says "If you want to change or remove the links at the bottom of each feed node or feed item node, simply use Drupal's hook_link_alter to alter them", and it offers a link to the Drupal API page for the hook at http://api.drupal.org/api/function/hook_link_alter/5. Many Drupal users will feel a bit of a gulp in the throat when asked to implement such a hook. We actually need only a few lines of code.
Our link removal strategy has two basic steps: create a module...