When the search module is enabled, the form is automatically added above left sidebar (or right, if left is empty).

This is unnecessary, as the block provided can be placed in any region. Placing this block does not disable the automatically added instance.

This patch removes the automatic instance and ∴ requires the block to be placed like any other.

CommentFileSizeAuthor
garland_search.patch717 byteszeta ζ

Comments

zeta ζ’s picture

Does maintenance-page.tpl.php need to be updated in a similar way, or do these (installation and update) pages need a default placement for the search form? NB. The search module is disabled by default.

dvessel’s picture

The search form can be disabled by ticking off the search box in the theme config page. Do you see a problem with that still?

zeta ζ’s picture

Version: 6.0-rc4 » 6.x-dev

http://drupal.org/node/220093 has spent 4 days on this.

It’s non-standard, unnecessary now the search form block only shows one search box (two in 5.x), restrictive and misleading, suggesting that other boxes should just appear when the module is enabled. Also, placing in the right sidebar (by removing everything from the left) doesn’t work on the blocks page.

Using this patch would simplify the page.tpl.php and the theme config page (If the option were removed) making the process of configuration by users more consistent. Do you see a problem with this yet?

dvessel’s picture

Title: Difficult to control placement of search form » Provide better UI for enabling and configuring search forms.
Version: 6.x-dev » 7.x-dev
Component: Garland theme » other
Status: Needs review » Needs work

I think the problem is more due to how the configuration is laid out. Simply cutting it out does not do a good job of fixing the problem.

zeta ζ’s picture

Title: Provide better UI for enabling and configuring search forms. » Difficult to control placement of search form
Version: 7.x-dev » 6.x-dev
Component: other » Garland theme

I think changing how the configuration is laid out will do little to address the issues I have mentioned, though I agree such changes should be in 7.x.

Removing the code that treats a search box differently to other blocks does fix the issue, and brings the handling of search-boxes into line with the rest of drupal. I also think this approach could be snuck-in to 6.0, solving the confusion users face with this special treatment, while a longer-term approach is sought for 7.x.

If you want to improve the UI for configuring search forms, please open another issue (and close this as won't fix if you want).

I’m sure you are busy with critical issues, so I don’t expect a long discussion about this.

disturbedsaint’s picture

+1 for this one.

Although I didn't have to search for 4 days like the person mentioned in post nr.3 it took me some time to figure out how to disable the search box.

It should just be a regular block, just like everything else.

cburschka’s picture

+1 on making search box a block.

Since some themes place their search box in a place that normally is not accessible to blocks, I would suggest making this other place a new block region.

zeta ζ’s picture

Search already provides a block – though in 5.x it looks wrong: this has been fixed in 6.x, so I see no reason to have the box. As Arancaytar says, themes can provide new regions to give flexibility.

We would need to adjust the admin page to delete this option, so it is a bigger change than I’d originally planned. Can anyone help, to get this RTBC?

catch’s picture

Version: 6.x-dev » 7.x-dev
Component: Garland theme » search.module

There's already a bunch of D6 sites using Garland which may well have $search_box configured, and the search block switched off - so removing this now would break all those sites.

So, I'm bumping this to D7 - if $search_box is going to go, then that should be done consistently - there's been talk of changing primary/secondary links to themed blocks/regions rather than the special handling we have now, so it'd work well with that.

zeta ζ’s picture

Assigned: zeta ζ » Unassigned
Status: Needs work » Active

So assigning a block that already exists (if search module is enabled) to left or right sidebar is too difficult for someone technically savvy enough to have deployed a release candidate?

This was intended to make search consistent with the treatment of other blocks: And to be a stop-gap solution, removing one source of support requests for the next year.

I’ll leave this at 7, but it is now a different issue. » Task ?

catch’s picture

Title: Difficult to control placement of search form » Consolidate search block and search form theme function
Category: bug » task

Yes task is good. Also retitled - are we talking about removing the theme function entirely and maybe adding a new region?

zeta ζ’s picture

My view is that we don’t need the search box – just the search block. If it is manually placed in left or right sidebars at weight -10 (do we still have weights as well as drag&drop?) the current appearance will be preserved. Garland doesn’t need an extra region, but this approach will make it less confusing to use other regions available in any theme.

We would also need to remove any configuration of the search box from the admin pages. I assume dvessel was referring to the check-box in toggle display, in #4. This defaults to on when the module is enabled, so the box just appears, and the user doesn’t know why. Controlling it becomes a ‘search & destroy mission’ (no pun intended)

I assume the search form is what produces the contents of the search box or block? I don’t know if anything needs to change here.

All this makes me wonder about the concepts of box and block and the subtle differences between them. If every box were provided as a block instead, what problems would this create? ATM the theming can be controlled with separate templates. Other boxes would require new regions. Mission, primary/secondary menus? I think this would provide too much flexibility.

Suggestion:

It seems to me that the concept of box allows themes like Garland to give more control to the designer and less to the user. This is no bad thing, so long as the user can over-ride in an intuitive way.

I would suggest that enabling the module search provides a block which is automatically placed by the theme as now, but block – not box. This is disabled if the user actually places the block in a region. This would give intuitive control to the user and the theme designer could give a helpful suggestion to the user. Removing the block entirely would be accomplished by disabling the module. To avoid further confusion, the blocks admin page would have to say ‘< theme default >’ instead of ‘< none >’.

Both these changes could be implemented by the theme declaring a ‘pseudo-region’ intended only for the output of the search block, if it is not placed in a real region.

cburschka’s picture

I agree. I've never understood why the search box is not a block. The only thing it is used for is when a theme designer positions the search box somewhere normal blocks can't go. That could be done just as well by putting a block region into that spot.

In D7, +1 for taking away the search box's special status and making it a normal block.

dvessel’s picture

I still don't think it should be removed. What about primary links? Should that depend on blocks too? I'd consider the search box integral to navigating the site so letting the theme designer position it is more important. Depending on blocks isn't ideal. There are too many things that can change like when you want search box precisely place but since regions are generic, anyone could try pushing something in there it wasn't designed to accommodate.

So, a big -1 from me.

dave reid’s picture

Issue tags: +Usability, +UBUserTesting2009

This is now a big usability issue that was discovered at the University of Baltimore testing. Users did not expect that a search form would be automatically enabled for them. They went and enabled the search block before discovering that they now had two search forms on every page.

See http://www.drupalusability.org/node/5

xano’s picture

I don't know about the primary and secondary links, but the search bar should definitely be a block. It's not that hard to make a migration path that enables the search bar as a block for core themes having it embedded.

dvessel’s picture

Don't get me wrong. I'd like to make it easier for everyone but simply removing it can make it difficult for some themes. If there was a way of "handing ownership" of search so it doesn't show up as a block when the theme takes care of it, it could cut down on the confusion. Maybe we could have that determined by the theme features checkbox. If search box is checked, disable the block. If not, hand over control to the user through blocks. This way, you'll never get two search fields. I'm not sure Drupal can handle that though. How Drupal handles block settings scare me a bit.

And don't forget search permissions. I imagine that's another hurdle most get caught up on. I think it defaults to being disabled for anonymous. What are the most reasonable defaults here?

damienmckenna’s picture

I'd also suggest having a bare search box that didn't run through the FormsAPI but instead was just a call to a theme function that built a non-intelligent form which submitted to the default search location.

Rationale:

  • The search box doesn't need to display the search query again as the search module presents another search box on its page.
  • We'd save a chunk of server processing, in one case on a production site the server spent 1/4 of the entire page creation time building this one form.
sun’s picture

Status: Active » Closed (duplicate)

1) The search theme form/variable was already dropped in favor of the search block.

2) The search form is a form. Guess what? Forms can be altered, and there are contributed modules that alter the heck out of this search block form.