For a simple website i needed to same functionality as block_edit, but with a '[Add content]' link as well.
It would be a neat feature to invoke a hook so other modules can add links to the block-edit as well.

CommentFileSizeAuthor
#1 block_edit.patch852 bytessvdhout

Comments

svdhout’s picture

StatusFileSize
new852 bytes

I've created a patch that provides this functionality.
There are 2 hooks invoked:
hook_block_edit_node_links => this hook has $node (as in preprocess) as an argument,
hook_block_edit_block_links => this hook has $block (as in preprocess) as an argument.

To add a new item to the block_edit div you can write the follow code in your custom module:

function cust_block_edit_node_links($node) {
  return array(
      'title' => t('Add Content'),
      'href' => "node/add/" . $node->type,
      'query' => drupal_get_destination(),
    );
}
joelstein’s picture

Status: Active » Closed (works as designed)

This is already possible. If you notice in your patch, drupal_alter() is used to expose the links to be changed. Just invoke hook_block_edit_links and hook_node_edit_links and you're all set. They should receive an array of links, which you can add to or alter at your discretion.

function hook_node_edit_links(&$links, &$vars) {}