klox7 VIP
Total posts: 914
14 Март 2013 15:34

Hello,

I'm playing with filter module in Co8 and so far great. I just can't figure it out how to remove "Select filter condition" from frontend module and make it preconfigurable with "record has any of selected values". I also don't know what option "Content type" in filter module's general option does? Can we search within different content types in same filter module?

Regards

Последние изменения: 02 Март 2014


Sergey
Total posts: 13,748
15 Март 2013 00:32

I also don't know what option "Content type" in filter module's general option does?

This option only for multi type sections. If you have more that one content type in a section you can filter by type.

I also don't know what option "Content type" in filter module's general option does?

Can we search within different content types in same filter module?

yes but only one at a time. I mean only if there is one content type you will se filters. In other words it will show content type selector. Only after that it will show filters of that chosen type.

I also don't know what option "Content type" in filter module's general option does?

Can we search within different content types in same filter module?

I just can't figure it out how to remove "Select filter condition" from frontend module and make it preconfigurable with "record has any of selected values".

his you can do only within field filter template.


klox7 VIP
Total posts: 914
18 Март 2013 07:47

klox7: Can we search within different content types in same filter module?

yes but only one at a time. I mean only if there is one content type you will se filters. In other words it will show content type selector. Only after that it will show filters of that chosen type.

Do I have to use multiple submit types in section for this?


Sergey
Total posts: 13,748
18 Март 2013 08:33

No you dont. I was saying that if you use then it works this way.

Do you use multiple type section or not?


klox7 VIP
Total posts: 914
18 Март 2013 08:38

No I don't use multiple type section. I just don't know how to enable content type selector.


klox7 VIP
Total posts: 914
18 Март 2013 09:28

For anyone who is interested in custumizing filters module template go to components/com_cobalt/fields and select field you wish to edit (ex. checkbox/tmpl/filter/...). If you want to remove filter condition options "Record has any of selected values" and "Record has all selected values" go to checkboxes.php (ex.), copy template end edit it. Remove or comment

<?php if($this->params->get('params.total_limit') != 1):?>

<select name="filters[<?php echo $this->key;?>][by]" data-original-title="<?php echo JText::_('CSELECTFILTERCONDITION')?>" rel="tooltip">

    <option value="any" <?php if($this->value && $this->value['by'] == 'any') echo 'selected="selected"';?>><?php echo JText::_('CRECORDHASANYVALUE')?></option>

    <option value="all" <?php if($this->value && $this->value['by'] == 'all') echo 'selected="selected"';?>><?php echo JText::_('CRECORDHASALLVALUES')?></option>

</select>

<br>

<?php endif; ?>

There is an option in field if you want to show number beside value how many records have this value.

In "Field" - "Filtering - Field Specific" - "Filter box show nums" you can select yes or no. If you select yes everything is OK. But if you select no then in frontend the number is gone (which is OK) but the background (badge) stays.

If you want to remove background when option is set to "no" just look for

<span class="badge"><?php echo ($this->params->get('params.filter_show_number', 1) ? $value->num : NULL);?></span>

in your field filter template and replace it with

<?php if($this->params->get('params.filter_show_number') == 1):?>

<span class="badge"><?php echo ($this->params->get('params.filter_show_number', 1) ? $value->num : NULL);?></span>

<?php endif;?>
Работает на Cobalt