It seems confusing that the search block can be enabled by the theme system and the blocks system. It makes more sense (to me) to have the search block governed by the block system only, and that we remove search block from the theming system altogether.
This eliminates confusion as to why the search block is appearing on the page when it is clearly disabled under blocks administration.
In IRC, @webchick said today "I think the idea is if you don't do this, when you first click on search module it does nothing."
There are two solutions to this:
1 - Set a message alerting admin to enable the search block if search is enabled and the block is not.
or
2 - Have search block enabled if search module is enabled.
or
3 - Have search module and search block enabled by default upon installation. (It's easier to turn off something you don't want, which in this case would be very rare, imho, than to turn on something in 2+ places just to get it enabled.)
What do you all think?
Comment | File | Size | Author |
---|---|---|---|
#35 | remove-search-box-again-550742-35.patch | 1.38 KB | David_Rothstein |
#32 | drupal.toggle-search.patch | 2.12 KB | sun |
#25 | 550742-2.patch | 678 bytes | douggreen |
#18 | 550742-search-install-message-D7.patch | 903 bytes | Dave Reid |
#17 | 550742-search-install-message-D7.patch | 904 bytes | Dave Reid |
Comments
Comment #1
Zarabadoo CreditAttribution: Zarabadoo commentedI agree. It seems silly to have it there.
The issue of having it as a block will be a hard one to overcome. Setting a message is possible, bust messages most often get ignored from my experience. Enabling it when activated is tricky in the fact we do not have a region specifically for it to go to. The best option is to have it active by default since I would expect a search functionality out of the box in a CMS.
Comment #2
jake88 CreditAttribution: jake88 commentedI agree as well. I believe that the search box should be a block, in the blocks administration page, rather than just built into the theme.
Comment #3
douggreen CreditAttribution: douggreen commentedThis sounds right to me... If the Usability team approves it, I'll write the patch.
Comment #4
douggreen CreditAttribution: douggreen commentedAdding "needs usability review" tag.
Comment #5
dchris CreditAttribution: dchris commentedGood point,I would agree with that.Having the search box as a block is more appropriate then also including it in the themes.Saves us the hassle and gives us more total control over it under the block system.
Comment #6
yoroy CreditAttribution: yoroy commented- Yes, removing search as a theme setting makes a lot of sense. It's very confusing.
- Enabling search + search block in the default install profile sounds like a nice default for the 80% use case, too.
Comment #7
JohnAlbinYes, please.
Comment #8
douggreen CreditAttribution: douggreen commentedAttached patch removes the search_box from the theme. It adds the search box to the garland theme on the default install profile; it does not add the search box to the minimal profile, because search.module isn't enabled in this profile.
Please review the message in search_install(). This message is intended for when the minimal install profile is used, and then the search.module is enabled.
I chose not to add a conditional check before the message, which could be used to only display the message if a search block doesn't already exist -- it's possible for someone to install and uninstall ... unless of course, the system deletes all blocks when a module is deleted. Do we do this automatically? Or should we do this manually here?
Comment #9
JacineAwesome!
Just tested the patch and it looks good to me.
Only thing that could potentially be confusing is that the search block is actually called "Search form" on the blocks page. So, maybe this should be tweaked a little:
+ drupal_set_message(t('You can <a href="@url">add the search block</a> now.', array('@url' => url('admin/structure/block'))));
Maybe this would be better?
+ drupal_set_message(t('The search form block is now available on the <a href="@url">blocks page</a>.', array('@url' => url('admin/structure/block'))));
Comment #10
Dries CreditAttribution: Dries commentedLooks good. Committed to CVS HEAD. Thanks.
Re @Jacine in #9: feel free to follow-up with better wording still. Just re-open the issue when you have a patch.
Comment #11
Dries CreditAttribution: Dries commentedActually going to mark this as 'code needs work' because this requires an update to the upgrade instructions. Contributed themes might need to be modified.
Comment #12
douggreen CreditAttribution: douggreen commentedI added something here: http://drupal.org/update/theme/6/7
My comments were short, and hopefully will be wordsmithed by someone on the documentation team.
Is there anywhere else this should be added?
Comment #13
yoroy CreditAttribution: yoroy commentedAll necessary info is in there, made sense to me. Thanks.
Comment #14
JacineHere's a patch for install message wording ;)
Comment #15
yoroy CreditAttribution: yoroy commentedNicely specific and to the point.
Comment #16
Dave ReidThis was accidentally committed to HEAD, and now causes a fun message that pops up during the batch install process. User clicks that link, interrupts the batch process, and bingo, one messed up half-installed Drupal. Needs to be reverted. None of our other modules do a drupal_set_message() to let us know that we can add it's blocks, that's just kind of silly. This needs to be in an update function.
Salacious evidence: http://skitch.com/yoroy/nya82/picture-13
Comment #17
Dave ReidPatch to remove the message display during install process.
Comment #18
Dave ReidNow with 100% less trailing whitespace
Comment #19
sunComment #20
yoroy CreditAttribution: yoroy commentedfor reference:
Comment #21
yoroy CreditAttribution: yoroy commentedoops
Comment #22
mattyoung CreditAttribution: mattyoung commented.
Comment #23
Dries CreditAttribution: Dries commentedHow about we remove this message all together? We don't do something similar for other blocks. It just looks like an odd special case to me.
Comment #24
douggreen CreditAttribution: douggreen commentedI have no opinion on if we should have the message or not. Original issue from webchick says the following, so that's what I did:
But Less is better. I vote for no message.
Comment #25
douggreen CreditAttribution: douggreen commentedComment #26
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #28
dchris CreditAttribution: dchris commentedgood work..seems cool enough to me.. :-)
Comment #29
laura s CreditAttribution: laura s commentedThis is awesome! Thank you all!
Comment #30
c960657 CreditAttribution: c960657 commentedShouldn't the
toggle_search
theme setting have been killed as well?Comment #31
yoroy CreditAttribution: yoroy commentedGood question. I think it should have been yes. Can't talk about code implications so needs review from someone who does.
Comment #32
sunRemoved.
Comment #33
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
Comment #35
David_Rothstein CreditAttribution: David_Rothstein commentedThe toggle_search checkbox is actually still appearing in the UI and getting saved to the database.
I looked into this and it turns out that this is because Drupal has "theme features" which automatically get converted to toggles by prepending 'toggle_' in front of them (so it would have been missed if searching the codebase for 'toggle_search').
This patch removes the search theme feature and therefore actually gets rid of the toggle.
Comment #36
Dries CreditAttribution: Dries commentedNice catch. Committed to CVS HEAD. Thanks.