Creating a sidebar search bar?

esserius

Joined: 2010-12-03
Posts: 5
Posted: Fri, 2010-12-03 19:25

Are there any modules available to do this, or any explanations available on how to do this?

 
esserius

Joined: 2010-12-03
Posts: 5
Posted: Fri, 2010-12-03 20:32

So... I created my own. It's basic, but it works. Good for themes without searchbars. Requires Gallery's search module to be enabled to function, obviously.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2010-12-04 20:00

Thanks for your contribution!
I have created a codex page: http://codex.gallery2.org/Gallery3:Modules:searchbox
It should show up on http://www.gallerymodules.com/ soon.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
slart

Joined: 2013-11-11
Posts: 112
Posted: Tue, 2014-07-29 16:13

Hello,
i use this searchbox modul in the sidebar and i have a problem with german >>Umlaute<< and >>German ß<<
When write "ü - ä - ö - ß" in the sidebar searchfield and click "Go", it's in the searchsite searchfield this = "%C3%BC - %C3%A4 - %C3%B6 - %C3%9F" and no or false search records.
I have tested the searchbox modul in the sidebar with the default theme.
In the original gallery3 searchbox in the header, it's no problem with this letters.

 
slart

Joined: 2013-11-11
Posts: 112
Posted: Tue, 2014-07-29 18:53

*Puh!
fixed the only Basic Latin (Unicode block).

i have no idea why. when i copy & paste the php code from the original gallery3 searchfield in the searchbox module view php file, than is all fine.

modules/searchbox/views/searchbox_block.html.php:

Quote:
<?php defined("SYSPATH") or die("No direct script access.") ?>
<form action="<?= url::site("search") ?>" id="g-quick-search-form" class="g-short-form">
<ul>
<li>
<input type="text" name="q" id="g-search" class="text" />
</li>
<li>
<input type="submit" value="<?= t("Go")->for_html_attr() ?>" class="submit" />
</li>
</ul>
</form>

(i have delete the "if album or item" function from the original gallery3 searchfield.)

 
slart

Joined: 2013-11-11
Posts: 112
Posted: Wed, 2014-07-30 11:59

I have found an bug with IE. IE shows "NULL" from the database in the search box.
So it is better:

Quote:
<?php defined("SYSPATH") or die("No direct script access.") ?>
<form action="<?= url::site("search") ?>" id="g-quick-search-form" class="g-short-form">
<ul>
<li>
<label for="g-search"><?= t("Search for Photos ") ?></label>
<input type="text" name="q" id="g-search" class="text" />
</li>
<li>
<input type="submit" value="<?= t("GO")->for_html_attr() ?>" class="submit" />
</li>
</ul>
</form>

Additional, customize the searchfield and searchbutton (tested in gallery3 themes clean canvas).

The Search-Button greater:
edti "padding" in: themes/clean_canvas/css/screen_layout_base.css

Quote:
input,
select,
textarea {
display: block;
clear: both;
padding: .35em;
}

The width for searchfield:
edit "padding" and "width" in: themes/clean_canvas/css/screen_layout_base.css

Quote:
.g-short-form .textbox,
.g-short-form input[type=text] {
padding: .3em .6em;
width: 88%;
}