Forums » customize advanced search

RSS feed for this topic

Info

  1. I am trying to customize the advanced search page so that values input for the tag field appear 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

Reply

You must log in to post.