[Solved] List of currently active filters

More
10 years 2 weeks ago - 10 years 1 week ago #46307 by Michaelw
Hello,

I have several filters on category page. It works perfect.

Is it posible to get at this page some legend with list of active filters?

For exempel - www.template-land.com/joomla-templates?filter_41 []=free&filter_42[]=bonusthemes

It is 2 active filters "Type of purchase = Free" and "Provider = BonusThemes"

List of active filters should look like thise:
<h5>2 items found with activ filters:</h5>
<ul>
<li>Type of purchase = Free[x]</li>
<li>Provider = BonusThemes[x]</li>
</ul>
<a ...>Remove all filters



Sorry for my english (my native is russian).


P.S. template-land.com is not my site, but it is good exemple. My site in russian language.
Last edit: 10 years 1 week ago by Michaelw.

Please Log in or Create an account to join the conversation.

More
10 years 2 weeks ago #46323 by ggppdk
Hello

no we do not have an option to print a list of "currently" active filters

if you are a developer, there is a simple solution to get them:
Code:
// 1. Get the ACTIVE filter IDs from the PHP $_GET ARRAY $active_filter_ids = array(); $varnames = array_keys($_GET); foreach($varnames as $varname) { if (strpos($varname, "filter_") === 0) { $varname = str_replace("filter_", "", $varname); $active_filter_ids[] = (int) $varname; } } // 2. Just make a map from: field_ID -to- filter DATA $_filts = array() foreach($this->filters as $filter) { $_filts[$filter->id] = $filter; } // 3. print the filters found to be active foreach ($active_filter_ids as $active_id) { echo "Active Filter:". $_filts[$active_id]->label ."<br/>\n"; }

if i have some syntax error above please correct it,
i have not tested the above

you can place the above e.g. at the top of your FLEXIcontent template file:
category_items.php
or
category_items_html5.php


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 1 week ago #46378 by Michaelw
Thank you. That's what I was looking for.

Please Log in or Create an account to join the conversation.

More
10 years 1 week ago #46379 by ggppdk
Hello

you may consider supporting FLEXIcontent project by posting a 5-star review at JED


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.275 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline