0

I have a custom module in which I am using hook_form_alter to remove the formatting options/help text for the body and comment fields:-

function mymodule_form_alter(&$form, &$form_state, $form_id) {
// We don't want the format options displaying
if (isset($form['body_field']['format'])) {
    $form['body_field']['format']['#access'] = false;
}
if (isset($form['comment_filter']['format'])) {
    $form['comment_filter']['format']['#access'] = false;
}
}

This works fine. However, I also need to remove the same formatting options/help from a CCK field. I've tried to use the same technique but can't isolate where in $form the formatting options are being included. Is it not possible to removed them using the same method as above?

We want to remove this information as it is not relevant to the user as the WYSIWYG editor provides them with all the tools they need and nothing more. We don't want to hide these with CSS, they need removing from the output.

1

Found that this can be handled in the theme's template.php file:-

function phptemplate_filter_tips_more_info() {
return '';
}
function phptemplate_filter_tips($tips, $long = FALSE, $extra = '') {
return '';
}

Which then overrides all filter tips from forms.

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.