0

I have two group content types (I use OG groups) which are still under development. I created dummy content types so that these links will appear in the group content creation links.

But they are not ready yet. Instead i would like to redirect the user when he clicks on the link to an article which basically describes what the functionality is and is under development.

I googled and searched drupal answers for this but could not find anything that fits my problem. Please let me know if someone knows how to redirect node creation links in a group context to a static article page. Thanks.

1

You can use hook_menu_link_alter() to hide those links. For example:

/**
 * Implements hook_menu_link_alter().
 */
function MYMODULE_menu_link_alter(&$link) {
  if ($link['link_path'] == 'node/add/dummy-type')) {
    $link['hidden'] = 1;
  }
}

Or can use hook_menu_alter() to redirect to other URL. For example:

/**
 * Implements hook_menu_alter().
 */
function MYMODULE_menu_alter(&$items) {
  $items['node/add/dummy-type']['page callback'] = 'drupal_goto';
  $items['node/add/dummy-type']['page arguments'] = array('node/1');
}

You can also use hook_menu_alter() to hide the links:

/**
 * Implements hook_menu_alter().
 */
function MYMODULE_menu_alter(&$items) {
  $items['node/add/dummy-type']['access callback'] = FALSE;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.