Filter Advanced Class Question ;)

More
14 years 6 months ago #17886 by ViveLeFlexicontent
So I just have this code left..
with the echo filt->html line it creates a duplicate of the filters.. so it shows each filter twice in the front end. but only 1 is working, the other one doesn't
Code:
$pattern = '/onchange="[^"]*?"/'; $replacement = "onchange=\"this.form.target='%s';this.form.submit();\""; foreach ($this->filters as $filt) : echo $filt->html; echo preg_replace( $pattern, sprintf($replacement, $targ), $filt->html ); echo '</span>'; endforeach;
without the echo filt->html it works like it normally should but nothing extra.
front end it shows
Code:
<select id="filter_19" onchange="this.form.target='';this.form.submit();" name="filter_19">
Maybe it would be better/easier if I fetch the items with mysql, so I can create seperate pages for the items containing the fields.
Don't know what do you think? Create sql or continue to get this to work..
200+ options per field, and each item belongs to min 1 field and max 200, so per category 200 pages each showing the items seperately.

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

More
14 years 6 months ago #17888 by ggppdk
I only said to output the original filter SO THAT you will be able to compare the html.

The code i provided will allow you to choose some filters to be submit THE FILTERING form in new window and some other to submit THE FILTERING form in same window.

Regards


-- 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 review. Thanks!

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

More
14 years 6 months ago #17931 by ViveLeFlexicontent
ow ok sorry, misunderstanding..
here is the code
Code:
<select id="filter_19" onchange="document.getElementById('adminForm').submit();" name="filter_19"> <select id="filter_19" onchange="this.form.target='_blank';this.form.submit();" name="filter_19"> </span> <span class="filter"> <select id="filter_37" onchange="document.getElementById('adminForm').submit();" name="filter_37"> <select id="filter_37" onchange="this.form.target='_self';this.form.submit();" name="filter_37">
this one I set the changed filter target to name in the array, to test it, it opened in a new window too, but no changes in the url
Code:
<select id="filter_19" onchange="document.getElementById('adminForm').submit();" name="filter_19"> <select id="filter_19" onchange="this.form.target='name';this.form.submit();" name="filter_19">
should it add something to the url? do you think its an acesef setting then? as much as I like flexicontent I dislike acesef :|
thanks for your patience and help

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

More
14 years 6 months ago #17937 by ggppdk
Exactly, the code that i provided does not change the destination url.

But it addresses your question about opening the filter in new window.

What is the point of opening a different destination url, if your destination cannot handle the POSTed form?

If you have some FC items or other pages you want to open automatically by the drop down select box, then you can do it by creating a Javascript array for this field. So that you can map each filter option to one destination URL, and then creating a Javascript function to use this array. This function you would call by using the onchange event of the select drop down filtering field.

These fields are meant for filtering the category view. I understand the usefulness of what you want,
but to provide this code, it would mean to do custom development for you it is no longer a simple howto.

Best Regards


-- 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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
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
Save