Sunteți pe pagina 1din 1

7 - Alter Fieldable Panels Pane form - Drupal Answers

1 of 1

Alter Fieldable Panels Pane form


Im using Panopoly, and have created a new Fieldable Panels Pane (FPP) bundle for a specific
content type.
I notice that all preset Panopoly FPP's have a check box labelled 'Make title a link' inside a
fieldset called 'General Options', which is also automatically added to my new bundle, and I
can't for the life of me work out how to disable it!
For reference, this field is visible through the Panels IPE as well as the traditional /admin
/structure/fieldable-panels-panes/manage/BUNDLE-NAME/add.
Does anyone know how I can isolate and disable this option on a per-bundle level?
Thanks!
1 Answ er
Almost all Drupal forms can be edited using hook_form_alter() , specifying the form using its
id:
Hide "Make title a link" for all fieldable panels panes:
/**
* Implements hook_form_alter().
*
* Simplify form for fpp.
*/
function your_module_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'fieldable_panels_panes_fieldable_panels_pane_content_type_edit_form') {
$form['link']['#access'] = FALSE;
}
}

Hide "Make title a link" for all fieldable panels panes of the type "your_bundle":
/**
* Implements hook_form_alter().
*
* Simplify form for 'your_bundle' fpp.
*/
function your_module_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'fieldable_panels_panes_fieldable_panels_pane_content_type_edit_form') {
if ($form['#bundle'] == 'your_bundle') {
$form['link']['#access'] = FALSE;
}
}
}

http://drupal.stackexchange.com/questions/125771/alter-fieldable-panel...

9/2/2014 5:29 PM

S-ar putea să vă placă și