Exposed autocomplete filter on views-view--products--block-7.tpl.php

paradoxx's picture
paradoxx
Mon, 11/23/2015 - 04:32
#1
Exposed autocomplete filter on views-view--products--block-7.tpl.php

Hi,

I am somehow trying to add an exposed filter to this view to give the visitor the possibility to search (with autocomplete) on product name.
I would like to position this exposed filter (by applying position:fixed left:X right:Y css selectors) on top of the page where now my standard drupal site search is positioned : 

Image title

I was able to successfully add this new filter to the appropriate view : 

Image title

but it seems impossible to have this filter rendered inside views-view--products--block-7.tpl.php

Image title

I have the impression, this is somewhere customized within the md_orenmode template file : 

Image title

Could you point me out directions please how to enable/add my exposed filter inside your theme ?

Thanks upfront!

phuonght's picture
phuonght
Mon, 11/23/2015 - 04:50

Could you send us your site url, admin account and FTP account? We would like to have a check and help you.

Please remember to check "Private message' for security reason :)

phuonght's picture
phuonght
Mon, 11/23/2015 - 21:37

If you would like to place filter form at search form position, please take a look at following module: https://www.drupal.org/project/views_block_filter_block.

That module will create expose filters which display as blocks. You could drag drop block to region of search form and use CSS to style.

paradoxx's picture
paradoxx
Tue, 11/24/2015 - 02:25

Hi Phuonght, 
I already experimented with this module yesterday (before i posted this support ticket).

This module indeed enables an exposed block on Views display level, but unfortunately it contains all exposed filters as well as exposed sort criteria.

The result was that this orenmode customized block : 

Image title

also moved completely into the new template block region.
Of course this was not my intention.

From an earlier mail i received from your colleague Cindy apparently she mentions something about this customized filter/sort block :

Image title

So maybe i have to add an additional DIV on top of the coding inside md_orenmode/template/custom/commerce-product-expose--filter.tpl.php
and/or md_orenmode/template/custom/commerce-product-expose--Sort.tpl.php

But i have no idea where to start, to get this exposed autocomplete search form rendered.

So any advice would be greatly appreciated. Thanks

phuonght's picture
phuonght
Tue, 11/24/2015 - 02:57

At the moment, your views-view--products--block-7 is in region Content so when you create expose filter, it is placed in region Content of that view. If you would like expose filter display in another region, you need to create a block which has expose filter then assign it to region. 

paradoxx's picture
paradoxx
Tue, 11/24/2015 - 09:11

Hi, thanks for your response but i have given up trying to put the the exposed search from in another block. There's no way creating a block with only this 1 exposed filter separated from the rest in this view.

So here's what i came up with inside commerce-product-expose-sort.tpl.php :

Image title

After some styling it looks like this : 

Image title

One problem still i cannot seem to solve immediately : 

Once search filter is triggered, the path is set to "/?title=XYZ" instead of "/product-grid-sidebar?title=XYZ".

So i need to find a way to append the querystring ""/?title=XYZ" to the current URL as it is done with the other exposed sorts & filters below.

Where could this setting or hook be found ?

phuonght's picture
phuonght
Wed, 11/25/2015 - 04:51

Please take a look at the following, we think it can help you change url of form:


https://www.drupal.org/node/2542056

paradoxx's picture
paradoxx
Wed, 11/25/2015 - 08:53

Thanks for your reply. I tried your suggested approach but it didn't solve it.

This Views applied patch solved it partially. You can read my added comment here : 

https://www.drupal.org/node/1069966#comment-10605122

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.