Implement check boxes for filters in category items view

More
13 years 2 months ago #14147 by kharmer
Hi all,

I have a need to implement check boxes instead of select boxes for filters on the category items view (or globally really).

Having played around with the code in the view I can output checkboxes easily enough. And I changed my custom fields so I only have one value per field (i.e. NULL or 1).

This waorks but the active filter appears to be persistent and so when I uncheck it, the filter remains in place!

Could anyone suggest a more robust way of implementing filters as check boxes please?

Best regards,
K...

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

More
13 years 2 months ago #14148 by micker
hello
did you desactived joomla cache and gzip fonction ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
13 years 2 months ago #14149 by kharmer
Hi Micker,

Thanks for the reply.

Yeah, I tried disabling cache and gzip compression.

Actually, the filters by default work fine with Joomla gzip compression active. Only when I try to implement check boxes instead of select dropdowns does the problem occur.

In the category items template I see the line:
Code:
echo $filt->html;

I've replaced this with:
Code:
$checked = ""; if($_POST['filter_'.$filt->id] == 1) $checked = "checked=\"checked\""; echo("<input type=\"checkbox\" id=\"filter_".$filt->id."\" name=\"filter_".$filt->id."\" value=\"1\" onchange=\"document.getElementById('adminForm').submit();\" ".$checked." />"); echo("<label for=\"filter_".$filt->id."\">".$filt->label."</label>");

...in oder to have select boxes instead.

Maybe there's a better way to implement select boxes for filters?

Best regards,
K...

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

More
13 years 2 months ago #14150 by kharmer
OK, I noticed that, even though my cutom fields are check boxes, they always display as select (drop downs) as filters.

So, looking at the checkbox plugin I can see the filter output here is hardcoded to output select (drop downs).

Is there a reason for this that I'm not aware off?

Best regards,
K...

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.265 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