Hello,

Is there any way to force user to add links (Manual links) when submitting?

Thanks in advance

Comments

dawehner’s picture

write a custom hook_form_alter which looks like this

<?php

/**
 * Implementation of hook_form_alter().
 */
function hook_form_alter($form_id, &$form) {
  if (user_access('add related links') && isset($form['type']) &&
    ($form['type']['#value'] .'_node_form' == $form_id)) {
      if (!in_array($node->type, variable_get('relatedlinks_node_types', _relatedlinks_node_get_types(TRUE)))) {
        return;
      }
      // force the user
      $form['relatedlinks_fieldset']['relatedlinks']['#required'] = TRUE;
      $form['relatedlinks_fieldset']['keywords']['#required'] = TRUE;
  }
}?>
Zen’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.