symphonycms / docs.getsymphony.com

The official repository for the Symphony CMS documentation site
2 stars 2 forks source link

Search input feature #9

Closed bernardodiasc closed 9 years ago

bernardodiasc commented 9 years ago

As suggested in #8, a search input would be a very nice feature to have.

bernardodiasc commented 9 years ago

@johnpuddephatt the search input works!

https://symphonycms.github.io/docs.getsymphony.com/

used this reference http://thornelabs.net/2014/05/12/instant-search-with-twitter-bootstrap-jekyll-json-and-jquery.html

its just a draft still, filtering only titles. :)

bernardodiasc commented 9 years ago

Ready. I've replaced the main navigation for a while. Until we have enough content to fill that much places for navigation will be ok like this.

screenshot-symphonycms github io 2015-01-25 02-27-52

Closing this issue, anyway, suggestions are welcome.

johnpuddephatt commented 9 years ago

Awesome!

In search.js on line 52, it might be worth changing:

if ($input.val() != '') { to if ($input.val().trim().length > 2) {

This will stop the search from triggering until at least three characters have been entered. There's little point showing a list of results when a single character has been entered...

johnpuddephatt commented 9 years ago

I've just made the previously mentioned change so that it can be reviewed/tested

bernardodiasc commented 9 years ago

Nice, thanks!

If we need that space again for main menu, this search box can be moved to the left-side column. Or somewhere else. Design thinking is definitely not my strong point. :)

johnpuddephatt commented 9 years ago

Sounds good!

nitriques commented 9 years ago

+1 :shipit: