Using Zen Theme for 6.6, and using the instructions for modifying the STARTERKIT folder to subtheme to my needs, I'd like to move the search_box to the header div. My (ignorant) impulse was to override page.tpl.php by copying it from zen into my subtheme folder and moving the search_box code, which works fine. However, when I tried to turn off the search_box #title text with a block title specification of "" I was unable to affect the search_box I moved. If, using blocks, I configure the search_box to appear in the header, the title override works but then I have TWO search_box objects: #search_box and block-search-0. This would seem to suggest that I really want to hide the #search_box div and format the block-search-0 div, but I'm scratching my head here.
What is the best practices approach for positioning a theme's search_box? I started out just wanting to turn off "Search this site: " by the way, the stringoveride module doesn't work on the #search_box object and I have no clue why.
Thanks in advance!
Comments
Extending the soliloquy
OK, thanks to the "nice menus" module, I'm inferring that the best practice is to work with the div placed by the theme designer and not the block inserted via the block configuration. That seems to be a best practices approach -- but, outside of setting the selector for the search_box label to display: none, how can I set the #title text to "" (or none)?
turning off display with css
to turn off visibility of page elements, you can use: display:none;
display: none
Much thanks for your reply. That's what I'm doing now to disable the label -- but it is not my ideal solution.
...
Since you ask about "best practice", I'd have to say using display: none; could well be considered best practice. The reason is accessability. Sure you can remove the label entirely but then you also reduce the accessabiltly of the form.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Excellent point
I hadn't considered that, thanks for the fresh perspective.
Veto
Sorry for my interfering - talking about accessiblity, display:none is not best practice. The reason is that some widely used screen readers are said to follow the "not show idea", thus not reading out display-none elements.
If you want to keep accessibility for the label tag, better use
visibility:none (element's width and height are preserved) or
position:absolute; left:-10000px;