Commit 52cb19ed authored by c_archer's avatar c_archer Committed by Kingdutch

Issue #2610674 by c_archer, szt, kingdutch: display as vertical tab in edit mode

parent 0ab7ffe1
......@@ -50,5 +50,15 @@ function yoast_seo_admin_settings_form() {
'#markup' => $metatag_description,
return $form;
// Allow the Real-Time SEO Module to be displayed in a tab at the bottom of
// the edit page.
$form['yoast_seo_vertical_tab'] = array(
'#type' => 'checkbox',
'#title' => t('Display in vertical tab'),
'#description' => t('Put Real-Time SEO Module in a vertical tab on content edit forms.'),
'#default_value' => variable_get('yoast_seo_vertical_tab', FALSE),
// Let Drupal save our checkbox as a system variable.
return system_settings_form($form);
......@@ -100,6 +100,13 @@ function yoast_seo_configuration_form(array &$form, $instance, array $options =
'#tree' => TRUE,
// Put Yoast in a vertical tab if setting is set.
$yoast_seo_vertical_tab = variable_get('yoast_seo_vertical_tab');
if (!empty($yoast_seo_vertical_tab)) {
$form['yoast_seo']['#type'] = 'fieldset';
// Only support vertical tabs if there is a vertical tab element.
foreach (element_children($form) as $key) {
if (isset($form[$key]['#type']) && $form[$key]['#type'] == 'vertical_tabs') {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment