Skip to content

Instantly share code, notes, and snippets.

@markhalliwell
Forked from lanoxx/bootstrap_subtheme.theme
Last active October 29, 2016 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markhalliwell/ba307a352d75fa9fdfe3303c2d402005 to your computer and use it in GitHub Desktop.
Save markhalliwell/ba307a352d75fa9fdfe3303c2d402005 to your computer and use it in GitHub Desktop.
Support placing the navbar into the top navigation
<?php
namespace Drupal\bootstrap_mobildata\Plugin\Form;
use Drupal\bootstrap\Annotation\BootstrapForm;
use Drupal\bootstrap\Utility\Element;
use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_FORM_ID_alter().
*
* @BootstrapForm("search_block_form")
*/
class SearchBlockForm extends \Drupal\bootstrap\Plugin\Form\SearchBlockForm {
/**
* {@inheritdoc}
*/
public function alterFormElement(Element $form, FormStateInterface $form_state, $form_id = NULL) {
parent::alterFormElement($form, $form_state, $form_id);
$form->addClass(['navbar-form', 'navbar-right']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment