Guest
12 Sep 2013 16:20

I am trying to make a new mod_filter template. For my end user I just want them to enter text to search. However I would like to pass a hidden value to the filter which is a category ID. How can I do this?

Here is my current template, how can I pass a hidden value?


<form action="<?php echo JRoute::_('index.php');?>" method="post" name="filterform" id="filter-form"> <?php if($params->get('filter_search', 1)):?> <div class="row-fluid <?php echo ( $state->get('records.search')? ' active' : NULL)?>"> <input type="text" class="span7" name="filter_search" value="<?php echo $state->get('records.search');?>" /> <button type="submit" class="btn btn-primary btn-large" id="directorySearch">Search</button> </div> <?php $cat_id = 9; ?> <input type="hidden" name="option" value="com_cobalt"> <input type="hidden" name="view" value="records"> <input type="hidden" name="section_id" value="<?php echo $section->id;?>"> <input type="hidden" name="cat_id" value="<?php echo $cat_id;?>"> <input type="hidden" name="user_id" value="<?php echo ($user_id ? $user_id.':admin' : 0);?>"> <input type="hidden" name="view_what" value="<?php echo $vw;?>"> <input type="hidden" name="task" value="records.filters"> <input type="hidden" name="limitstart" value="0"> </form>

As you can see I tried setting the $cat_id by hand, but that does not work. It will do a text search, but the category is not limited.

Thank you.

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
13 Sep 2013 08:52

What if you navigate into this category through link and then search in it with Cobalt standard search field. Not module? Does it behave the same?

I would check 2 parameters. Records mode and Filter Mode. Both are in first tab of section edit form.


Sergey
Total posts: 13,748
15 Sep 2013 02:21

Filtering mode is a parameter just under records mode.

Powered by Cobalt