Search field autocomplete / predictive
Search field autocomplete / predictive
How could I make search field work like Google Search (autocomplete, predictive search)?
Re: Search field autocomplete / predictive
Thanks Alex!
I think we need some AJAX also, but I don't know how this is done with CMSMS in a right way.
Re: Search field autocomplete / predictive
I think you should make a page template only containing {content}
Create a hidden page using that template
Receive parameters sent by your ajax call
Create a UDT and call that on the page using the received parameters
The UDT should then:
- sanitize input
- query for words based on input (LIKE?) in search module tables in database (you might consider checking for extra used options like 'modules')
- build and return the output expected by the auto complete tool you use
Create a hidden page using that template
Receive parameters sent by your ajax call
Create a UDT and call that on the page using the received parameters
The UDT should then:
- sanitize input
- query for words based on input (LIKE?) in search module tables in database (you might consider checking for extra used options like 'modules')
- build and return the output expected by the auto complete tool you use
Re: Search field autocomplete / predictive
Thanks Velden!
This was what I was a bit afraid of. Not so simple.
If I understood correctly, the search is predictive in CMSMS 2.0 or is it just the back end search?
This was what I was a bit afraid of. Not so simple.
If I understood correctly, the search is predictive in CMSMS 2.0 or is it just the back end search?
Last edited by urheat on Tue May 26, 2015 5:48 am, edited 1 time in total.
Re: Search field autocomplete / predictive
I'm thinking to create such a UDT for demo puposes.
Promise to buy Rolf a large cup of coffee and I'll prepare a blog post together with him.
If you need it fast consider sending me a PM (but it would cost you a restaurant meal for two )
BTW: talking about the core Search module.
Promise to buy Rolf a large cup of coffee and I'll prepare a blog post together with him.
If you need it fast consider sending me a PM (but it would cost you a restaurant meal for two )
BTW: talking about the core Search module.
Re: Search field autocomplete / predictive
Haha! I definitely owe you both meals. Hopefully we meet someday and I can pay my debts Great news!velden wrote:I'm thinking to create such a UDT for demo puposes.
Promise to buy Rolf a large cup of coffee and I'll prepare a blog post together with him.
If you need it fast consider sending me a PM (but it would cost you a restaurant meal for two )
BTW: talking about the core Search module.
Re: Search field autocomplete / predictive
Tutorial:
https://cmscanbesimple.org/blog/search- ... tocomplete
Demo:
https://demo.cmscanbesimple.org/search- ... tocomplete
https://cmscanbesimple.org/blog/search- ... tocomplete
Demo:
https://demo.cmscanbesimple.org/search- ... tocomplete
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -