2

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!

2 Answers 2

2

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;
    }
  }
}
0
0

There is a new sandbox Simplify Extra which has integration with Fieldable Panels Panes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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