Customize Advanced Search drop-downs

Hi everybody,

I was almost sure that I saw a similar post to this on the forums before but I've searched really hard and can't find it anymore!

So, apologies for the repetition, but I am trying to customize the Advanced Search form to limit the options available to users in the drop down for 'Narrow by Specific Fields', and 'Search by Item Type' fields.

I think that the post I saw before was answered with instructions on how to hard-code the options in the drop-down menus?

Any help much appreciated! Or perhaps if somebody could direct me to that previous post that would be great?

Thanks,

Dee

Hi all,

I found the post I was thinking of in the Omeka Dev group forum - where I am continuing the discussion - here:

http://groups.google.com/group/omeka-dev/browse_thread/thread/16ca2d476c532399/e5178def4f04c2a2?hl=en)&lnk=gst&q=customize+advnaced+search#e5178def4f04c2a2

Thanks,
Dee

Hi,

I also have a question regarding modifying the advanced search form. Apologies if this should be directed to the Omeka Dev group forum.

I am trying to customize the advanced search page so that the tag element appears as a dropdown menu. I thought I could do this by adding a function to FormFunctions.php and modifying advanced- search.php

This is the function I added to FormFunctions.php:

function select_tag($props = array(), $value=null, $label=null,
$search = array())
{
return _select_from_table('Tags', $props, $value, $label,
$search);
}

In advanced-search.php, I replaced the existing code

<div class="field">
<?php echo label('tag-search', 'Search By Tags'); ?>
<div class="inputs"><?php echo text(array('name'=>'tags','size' =>
'40','id'=>'tag-search','class'=>'textinput'),$_REQUEST['tags']);*?></
div>
</div>

with the following:

<div class="field"
<?php echo label('tag-search', 'Search By Tags'); ?>
<div class="inputs"><?php echo select_tag(array('name'=>'tag',
'id'=>'tag-search'), $_REQUEST['tag']); ?></div>
</div>

These changes generated the following error:

Error:Column pairs must be defined in order to use
Omeka_Db_Table::findPairsForSelectForm()!

I don't want to get in further over my head. First, it looks as though I should make a copy of application/views/scripts/items/
advanced-search.php in my theme under the items folder before I do anything else. Do you have any suggestions?

If this can be accomplished, I would also like to add subject as a dropdown menu option.

Thank you.
beth