Filter Advanced Class Question ;)

More
12 years 8 months ago #17818 by ViveLeFlexicontent
Hello dear flexicontent friends,

I have a wish I would like to see realized and am wondering how to get it done..

- I want to change the code so when someone selects a filter option it will open in a new window and the filter will be added to the url name.

- or better yet: static pages for the seperate filter options/selections, and leave the normal filter page as it is.

So if there were 10 filter options like colors.
I would like a seperate though dynamically created page.
If allthecolors/ = parent and has the filter options
then allthecolors/red = child which only shows the red ones, and doesn't have the filter option, and so on for the other 9.

Now how to do this..

Am thinking myself of adding code like: window.open(url); and target="_blank" do you guys think this would work? Or anyone have an idea on how to go about this..

Please help, this would make my day(s)

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

More
12 years 8 months ago #17850 by ggppdk
If you do it with:
window.open(url);
you will have to write javascript code, to append to url all form field data normally sent be POST method.

Maybe this would be better:

1.One NEW configuration parameter to any field for adding custom html tag parameters when field acts as a filter, and
2. Then inside this new configuration parameter we could write:

onchange='this.form.target="_blank"; this.form.submit();"
and
onchange='this.form.target="_self"; this.form.submit();"

for all other field when they act as filters.

OR to make it more simple to the user but less powerful, we could add a new radio configuration parameter for the field "Where to submit filtering form" with options:
a. same page
b. new page


But this is too advance to show to average users and confuse them. Not sure thinking ...


-- 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
12 years 8 months ago #17865 by ViveLeFlexicontent
thanks you so much for your thoughts on this. will give it a try and do some tests tomorrow, and let you know how it went.
I really want to do this for seo purposes, and having allot of extra pages wont hurt either :mrgreen:
thanks, have a great weekend :!:

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

More
12 years 8 months ago #17867 by ggppdk
You think you know what code to change, i did not say what files need changing for this, because i was just thinking.

Do you really need this ? why not same page?

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...

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

More
12 years 8 months ago #17868 by ViveLeFlexicontent
yeah I think it's the in code in the blog template, category-items.php am I correct?
well as I have 200+ filter options for one field, and they are very important to my site, if I have separate pages for them I can give each page its own meta title, meta description. Which will be a big plus.
Back end code:
Code:
<?php if ((($this->params->get('use_filters', 0)) && $this->filters) || ($this->params->get('use_search')) || ($this->params->get('show_alpha', 1))) : ?> <form action="<?php echo $this->action; ?>" method="post" id="adminForm"> <?php if ((($this->params->get('use_filters', 0)) && $this->filters) || ($this->params->get('use_search'))) : ?> <div id="fc_filter" class="floattext"> <?php if ($this->params->get('use_search')) : ?> <div class="fc_fleft"> <input type="text" name="filter" id="filter" value="<?php echo $this->lists['filter'];?>" class="text_area" onchange="document.getElementById('adminForm').submit();" /> <button onclick="document.getElementById('adminForm').submit();"><?php echo JText::_( 'FLEXI_GO' ); ?></button> <button onclick="document.getElementById('filter').value='';document.getElementById('adminForm').submit();"><?php echo JText::_( 'FLEXI_RESET' ); ?></button> </div> <?php endif; ?> <?php if (($this->params->get('use_filters', 0)) && $this->filters) : ?> <div class="fc_fright"> <?php /* echo '<span class="filter">'; echo 'Saison: ' . $this->filters['field24']->html; echo '</span>'; */ foreach ($this->filters as $filt) : echo '<span class="filter">'; echo $filt->html; echo '</span>'; endforeach; ?> </div> <?php endif; ?> </div> <?php endif; ?>
Front end code looks like:
Code:
<span class="filter"> <select id="filter_19" onchange="document.getElementById('adminForm').submit();" name="filter_19">

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

More
12 years 8 months ago #17869 by ggppdk
mmm good idea to do it at the the template.

Here it is what to do:
1. if you want all you filters to open in new page the go to the form and put target="_blank":

<form id ="adminForm" ... target="_blank" ...>

2. if you want some of your filters to open in new page and some in same page
Then do a regular expression replace on the html code of your filters:
Code:
// FOR ALL filters you want in new page do: $filt->html = preg_replace('/onchange="[^"]*?"/', "onchange=\"this.form.target='_blank';this.form.submit();\"", $filt->html); // FOR ALL filters you want in same page do: $filt->html = preg_replace('/onchange="[^"]*?"/', "onchange=\"this.form.target='_self';this.form.submit();\"", $filt->html);

Note: you must do both statements as each filter will set the target html parameter of the html form tag ...

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...

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

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