Hello,
I’m trying to customize the advanced-search form to include dropdown menus to select certain search filters and I think I’m in a little over my head.
I’ve used the “Hide Metadata” plugin to hide the item types that I don’t want to see in the menu and that has worked well. What I would like are additional drop-down menus based on particular elements in the metadata. I.e. in the example below, I would like the dropdown to list all of the different “Branch of philosophy” entries that exist and allow the user to select one to limit their search.
I’ve tried adapting what I saw in other sections of “search-form.php” such as:
<?php echo $this->formLabel('item-type-search', __('Record Type')); ?><?php echo $this->formSelect( 'type', @$_REQUEST['type'], array('id' => 'item-type-search'), get_table_options('ItemType') ); ?>
My failed adaptation is the code snippet below,
<?php echo $this->formLabel('branch-type-search', __('Branch of Philosophy')); ?><?php echo $this->formSelect( 'branch', @$_REQUEST['branch'], array('id' => 'branch-search'), get_table_options(metadata('Item Type Metadata', 'Branch of philosophy')) ); ?>
which causes Omeka to generate the following error:
Omeka_View_Exception
A current item_type_metadatum variable has not been set to this view.
I’ve also tried reading the documentation for Omeka and Zend for more information on formSelect() and get_table_options() but I’m still not understanding how to fix this/ make this work. What is $this calling? Are formLabel and formSelect setting variables or looking for something defined elsewhere?
Any help you could provide would be greatly appreciated! Thanks,
Bryan