In the faceted search page, keyword seach block (not the one on the sidebar) is displayed over the guided search block by default. However i'd like to reorder them or hide the keyword block completely so the guided search is prioritized. Is this possible for now or should be considered as a feature request?

CommentFileSizeAuthor
#2 reordering.jpg39.66 KBdrupaloSa

Comments

David Lesieur’s picture

I'm not sure to get the question right, but you could:

  • Hide the Keyword search block by disabling the block. To do so, uncheck "Provide Keyword search block" in your faceted search search environment's settings.
  • Show the Keyword search block under the Guided search block by adjusting the block's weight, in Administer > Site building > Blocks.
drupaloSa’s picture

StatusFileSize
new39.66 KB

It is hard to describe this by writing, so instead i've attached a screenshot.

David Lesieur’s picture

Aaah, I see! You could reorder (or remove) these through hook_form_alter() in a small module. Unfortunately, at the moment no other way has been designed for doing this.

More easily, you could completely hide the keyword search fieldset with CSS.

drupaloSa’s picture

Thanks David, i prefered to use css method as you suggested and added the following to faceted_search_ui.css:

.faceted-search-keyword {
  display:none;  
}
amcc’s picture

Theres a very easy way to do this as this area is helpfully themeable

stick this in your template.php - or create one in your theme folder if you don't have one yet. I'm using zen, but if you're not replace the word zen with the name of your theme.

function zen_faceted_search_ui_stage_select($search, $keyword_search_content, $guided_search_content) {
  if ($keyword_search_content) {
    $form['keyword'] = array(
    
    );
  }
  if ($guided_search_content) {
    $form['guided'] = array(
      '#type' => 'fieldset',
      '#title' => t('Guided search'),
      '#value' => $guided_search_content,
      '#weight' => 1,
      '#attributes' => array('class' => 'faceted-search-guided'),
    );
  }
  return drupal_render($form);
}
David Lesieur’s picture

Status: Active » Fixed

artfo's solution is great! You could even remove the whole if ($keyword_search_content) { } block.

drupaloSa’s picture

So is it also possible to reorder them by just changing their places in this function?

David Lesieur’s picture

Almost! You'd have to copy the original theme_faceted_search_ui_stage_select() function from faceted_search_ui.module into your theme's template.php, replace the "theme" word with your theme's name, and then just swap the weight values on the '#weight' => lines.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.