Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am trying to move the meta tags form to its own primary tab using the following:
function graphtek_seo_menu() {
$items = array();
$items['node/%node/seo'] = array(
'title' => 'SEO',
'description' => 'Manage SEO',
'page callback' => 'drupal_get_form',
'page arguments' => array('metatag_form'),
'access arguments' => array('use page manager'),
'theme callback' => '_node_custom_theme',
'type' => MENU_LOCAL_TASK,
'weight' => 4,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
);
,
but I cannot simply do that, since metatag does not implement hook_form.
It creates the FAPI array using metatag_metatags_form, but in order to even call that function metatag_field_attach_form has to be called first, and then metatag_form_alter calls metatag_metatags_form with the appropriate parameters. I read this was implemented this way due to http://drupal.org/node/1284642, but does anyone know of a hack I can use to move the form to its own tab?
Comments
Comment #1
DamienMcKennaYou might need to use an after-build callback ($form['#after_build']) and then modify the 'metatag' array, but I haven't personally tried it.
Comment #2
DamienMcKennaPlease feel free to reopen if you need more help getting this to work.