Update SearchForm.php
This commit is contained in:
parent
134e8aa4aa
commit
0b71b649fc
1 changed files with 4 additions and 4 deletions
|
|
@ -34,7 +34,7 @@ class SearchForm extends FormBase
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$block = \Drupal\block\Entity\Block::load("search");
|
$block = \Drupal\block\Entity\Block::load($this->block_id);
|
||||||
|
|
||||||
if ($block) {
|
if ($block) {
|
||||||
$settings = $block->get('settings');
|
$settings = $block->get('settings');
|
||||||
|
|
@ -45,8 +45,8 @@ class SearchForm extends FormBase
|
||||||
'#type' => 'textfield',
|
'#type' => 'textfield',
|
||||||
'#title' => (!empty($settings['search_textfield_label']) ? $settings['search_textfield_label'] : ''),
|
'#title' => (!empty($settings['search_textfield_label']) ? $settings['search_textfield_label'] : ''),
|
||||||
'#attributes' => [
|
'#attributes' => [
|
||||||
'placeholder' => $this->t($settings['search_placeholder']),
|
'placeholder' => isset($settings['search_placeholder']) ? $this->t($settings['search_placeholder']) : $this->t("Search collections"),
|
||||||
'aria-label' => $this->t($settings['search_placeholder']),
|
'aria-label' => (isset($settings['search_textfield_label']) ? $this->t($settings['search_textfield_label']) : $this->t('Enter Keyword'))
|
||||||
],
|
],
|
||||||
'#theme_wrappers' => []
|
'#theme_wrappers' => []
|
||||||
);
|
);
|
||||||
|
|
@ -67,7 +67,7 @@ class SearchForm extends FormBase
|
||||||
*/
|
*/
|
||||||
public function submitForm(array &$form, FormStateInterface $form_state)
|
public function submitForm(array &$form, FormStateInterface $form_state)
|
||||||
{
|
{
|
||||||
$block = \Drupal\block\Entity\Block::load("search");
|
$block = \Drupal\block\Entity\Block::load($this->block_id);
|
||||||
if ($block) {
|
if ($block) {
|
||||||
$settings = $block->get('settings');
|
$settings = $block->get('settings');
|
||||||
$view_machine_name = $settings['search_view_machine_name'];
|
$view_machine_name = $settings['search_view_machine_name'];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue