eZ Community » Forums » eZ Publish 5 Platform » Autocomplete with eZFind in new stack
expandshrink

Autocomplete with eZFind in new stack

Autocomplete with eZFind in new stack

Sunday 06 July 2014 10:59:22 pm - 4 replies

Hi, 

I would like to implement a autocomplete system with eZ Find in a eZ 5 project. In eZ 4, I made ​​a template like this: https://github.com/ezsystems/ezfind/blob/master/design/ezwebin/templates/page_header_searchbox.tpl but eZ  5 with a twig template, what is the right how to implement this system? 

Do you have a concrete example? 

I am also looking to do autocomplete on a single attribute in a class. Is it possible to easily?

Thank you in advance for your answers.

Tuesday 08 July 2014 8:30:51 pm

Nobody has ideas?

Wednesday 09 July 2014 9:15:49 am

Hi Jonathan,

the autocomplete server script is a legacy ezjscore module (https://github.com/ezsystems/ezfi...asses/ezfindservercallfunctions.php). You should be able to call it at a URL like http://www.mysite.com/ezjscore/call/ezfind::autocomplete::<search query>::<limit>?ContentType=json (you should check the URL as I typed it from memory)

Then you'll have to create a JS script to call that service while the user types in the search input and display the autocomplete terms list. There's a YUI module in ezfind (https://github.com/ezsystems/ezfind/blob/master/design%2Fstandard%2Fjavascript%2Fezajax_autocomplete.js) but it requires a few dependency and is IMHO a bit heavy for such a simple feature.

Modified on Wednesday 09 July 2014 9:16:13 am by Benjamin Choquet

Wednesday 09 July 2014 9:27:18 am

Hi. Apart from what Bejamin said, maybe you can find this post i wrote useful

http://share.ez.no/blogs/carlos-revillo/ez-find-with-symfony-controller-and-twig-templates

It doesn't cover the ajax part but at least it covers how you can use ezfind from a symfony controller and twig templates. This is possible usign this dual aproach eZ offers.

Monday 14 July 2014 7:49:33 pm

Thank you to you two for your help. @Carlos: Very good bundle happy.gif Emoticon.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from