Posted by apasaja on December 12, 2008 at 4:40am
Jump to:
| Project: | Related links |
| Version: | 5.x-2.2-beta |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Hello,
Is there any way to force user to add links (Manual links) when submitting?
Thanks in advance
Comments
#1
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;
}
}?>
#2
#3
Automatically closed -- issue fixed for 2 weeks with no activity.