Filter K2 content by extra fields: tags, category, item text, and many other fields at the same time.
Description
Description
Compatible with Joomla 3.x and the latest K2 version.
This module can filter your K2 content by several extra fields, tags, category, item text and a lot of other fields in the same time. It is very flexible to use.
This module consists of two parts:
- module part (mod_k2_filter);
- plugin part that provides a search function.
With the module purchase, you will get one year free support and updates. Unlimited domains use!
- Github repo with latest version - https://github.com/molotow11/joomla-k2filter
- Joomla 4 / PHP 8 version from Krassimir - download
Quick preview:
Features
Features
- Display search fields as text field, drop-down select, multi-select, slider, slider with range value select, radio, tag (ability for multiple tags select), category, item title (text and A-Z), item text, item rating, item creation/publish dates;
- Restrict search to specific category (static by category ID(s) and auto by the category you are viewing);
- Order search fields; Display search fields in several columns;
- Order search results by some extrafield value;
- Display search results in category view (category template);
- Auto-submit function;
- Function to allow search only if all the fields are selected;
- AJAX search results;
- Chained (dependent) fields (connected fields);
- Multi-language support.
Changelog:
Feb 2021
* Added J2Store price filter - search by J2Store products (extra plugin for J2Store for link it for K2 items)
Feb 2019
* Added compatibility with Inceptive K2 Multiple Categories plugin
Nov 2018
* Added All/Any Filter match field type
Oct 2018
* Added ui style selector for default template
Sep 2018
* Added a parameter for Auto fetch extrafields filters list based on current category
Aug 2018
* Added new module template style based on selectize.js
* filter.css style moved to template's folder
* Added Keyword suggestions from tags and items title
19.08.2017 Compatible with K2 2.8.x
Compatible with Joomla 3.7.x, 3.8.x
v.1.5.5 2017-02-10
Bug fixes;
PHP 7.1 compatibility.
2016-03-20
Compatible with K2 2.7.x;
v1.5.4 2016-01-11
* Template changes;
* Some other improvements.
v1.5.3 2015-10-30
* Template changes;
* Added new fields connection mode.
v1.5.1 2015-05-03
* Added new function - Dynamic values in select boxes;
Useful only with ajax search. Updates all values in the filters based on selected value in some other field;
* Changed filters manager into the backend and now it is easier (You need to re-configure your filter fields!).
Now it is single select box - "Select filter fields", which combines 'Filter type', 'Select extra field' and 'Order' params.
* Ajax search now updates url with history.pushState();
* Added new param for change ajax results container;
* Responsive filter module layout, by default now. 'Number of cols' param should be set to '0';
* $json->decode function replaced with native php function json_decode (increase a speed).
19.04.2015 It is a live and compatible with the latest K2 and Joomla versions.
21.12.2014 Compatible with K2 2.6.9
Docs
Install instruction:
- Backup your site;
- Install the package file via Joomla installer;
- Adjust the module parameters;
- Change "Ajax container" parameter accordingly to your site's template, for get search results shown on specific position.
Setup:
- Assign the module to specific position and enable it.
- Select what extrafields you want to show in "Select filter fields" parameter.
- Select filter type for extrafields fields.
- Drag and drop selected value for change fields ordering.
Change search results view options:
In case if you use 'Generic' template for search results, you can change it in K2 generic parameters section 'Layout & view options for Search & Date listings'.
Also, you can manually edit template file - plugins\system\k2filter\K2Filter\templates\filter.php You can override this file as standard k2 template file in your_template/html/com_k2 folder.
Also, you can use category template, see 'Search results template' module parameter. It will also require to fill 'Category Id' parameter for get template parameters from this category. In this case it uses your category template files.
How to setup Chained Fields (Field connection)
How to add AND/OR condition selector between the values in tag multiple select filter
Known issues:
- sh404sef compatibility:
If you use sh404sef at your website, you need to add new condition in /components/com_k2/sef_ext/com_k2.php
* From version K2 2.7 you need to modify this file - /plugins/sh404sefextplugins/k2/adapters/com_k2.v2.php
Find the following block :
case 'search' :
$title[] = 'search';
if (!empty($searchword))
$title[] = $searchword;
break;
And place new block after it:
case 'filter' :
$title[] = 'filter';
if (!empty($searchword))
$title[] = $searchword;
break;
Then, you need to clear sh404sef links cache.
- How to show search ordering box, when category template enabled:
You need to add it manually to your k2 category.php template file. You can find the code here - plugins/system/k2filter/K2Filter/templates/filter.php
Find the block <div class="k2filter-toolbox" ............ (it is between <!--added K2FSM -->)
You need to copy the whole block and put it into your category.php template file with a condition:
<?php if(JRequest::getVar("task") == "filter") { ?> .... block code here .... <?php } ?>
Then, you can find and remove some extra ordering options.
If you need more support, you can contact us here