MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Dec 04, 2008, 12:44 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search via SMF
or Google:
modx forums
all of modxcms.com
web
MODxCMS.com
Forums
Help
Login
Register
News
:Read
Frequently Asked Questions (FAQ)
MODx Community Forums
»
Add-ons, Extensions & Elements
»
Module, Plugin & Snippet Usage
(Moderators:
zi
,
PaulGregory
)
»
[Snippet] AjaxSearch
Pages: [
1
]
2
3
...
6
Go Down
« Previous topic
Next topic »
Print
Author
Topic: [Snippet] AjaxSearch (Read 21271 times)
0 Members and 1 Guest are viewing this topic.
kylej
Coding Team
Posts: 738
[Snippet] AjaxSearch
«
on:
Mar 18, 2006, 03:07 PM »
With all of the AJAX talk going around I thought it was time to add some to my site. This snippet turns the FlexSearchForm snippet into an AJAX site search. The results from the search are loaded right in the page for the user. If the user does not have javascript enabled, the snippet will use the default searching of the FlexSearchForm snippet.
The javascript code is based off of the example by Steve Smith of orderedlist.com.
If you would like to see this in action you can go to my site here:
http://www.muddydogpaws.com/notebook/ajax-search-snippet.html
The instructions for installing and setting up this snippet are in the FSFAjax_readme.txt file in the zip.
Enjoy,
Kyle
Updated: 05/18/2006 - I have added the code from Thomas (Shadock) to the main snippet to allow for live searching (i.e. results as you type). There is a new parameter that goes along with this. If you add the parameter &ajaxSearchType=`1` you will turn on the live search. I have also updated the scriptaculous effects to run in succession so the effects look better.
Updated: 04/03/2006 - To make the search even better, I have added the search highlighting code from Marc (MadeMyDay). The updated code can be found in the download. You need to update all of the files excluding the images for this to work correctly.
Updated: 03/20/2006 - After receiving some feedback I have modified the snippet a little. There is now a button that appears to close the search box after a search. Also I have made the snippet output the parameters set in the snippet to a bit of javascript so that I can use them in the ajax call. So you do not have to update the file ajaxSearch.php for your search settings. A thank you goes out to sottwell for these great ideas.
*******Update: 03/19/06***********
I added a button to close the seach box after you run the search. Great idea Susan. I have updated the zip here and on my site. The only file I had to change was the javascript file, so that is the only one you need to update.
Mod note: File removed: ajaxSearch.zip (19.93 KB - downloaded 76 times.)
Please visit the
AjaxSearch Repository entry
for downloads.
«
Last Edit: Aug 22, 2006, 08:10 AM by PaulGregory
»
Logged
::
Download Modx
::
Add-on Repository
::
Documentation
::
Bug Tracker
::
Donate!
::
My Site - www.muddydogpaws.com
::
::
Wayfinder
::
AjaxSearch
::
FileDownload
::
DittoCal
::
TvTagCloud
::
davidm
Marketing & Design Team
Posts: 6,777
The best way to predict the future is to invent it
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #1 on:
Mar 18, 2006, 05:46 PM »
I just love the livesearch, very nice one !
Just a problem : the archive above is corrupt can't download it... Got it from your website though, and will try it tomorrow...
Thanks a lot for this one
Logged
.:
nodeo.net
: Pour un web libre, moderne et ouvert ! ::
david-molliere.net
:
Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web
:.
***
Forums modxcms.fr
Participez à l'élaboration du site MODx francophone !
***
! Nouveau !
En live, ne manquez pas les news de modxcms.fr sur Twitter
! Nouveau !
MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.
Config :
Apache 2.2.8 - MySQL 5.0.45 - PHP 5.2.6 | Debian 4.0 (Etch)
Réalisations sous MODx :
|
pargade-notaires.fr
|
soleil.info
|
gican.asso.fr
|
michelez-notaires.com
|
amadom.gerondicap.com
|
jocelyne-violet.net
doze
Coding Team
Posts: 3,237
....Boom!
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #2 on:
Mar 18, 2006, 05:50 PM »
Yes, great work again Kyle! I like it alot, and will definitely use. Thanks!
Logged
MODxWiki
|| Please, list wiki worthy material
here
!
kylej
Coding Team
Posts: 738
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #3 on:
Mar 18, 2006, 06:04 PM »
I have updated the file for download above.
Logged
::
Download Modx
::
Add-on Repository
::
Documentation
::
Bug Tracker
::
Donate!
::
My Site - www.muddydogpaws.com
::
::
Wayfinder
::
AjaxSearch
::
FileDownload
::
DittoCal
::
TvTagCloud
::
garryn
Coding Team
Posts: 1,181
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #4 on:
Mar 18, 2006, 07:10 PM »
Cool snippet!
I will definitely give this one a try.
Logged
Search
|
Download Latest Release
|
General Support
About MODx
|
Documentation
|
Bugs/Wishlist
|
FORUM RULES
Garry Nutting
— http://www.immerse.me.uk - My Playground
|
My Amazon Wishlist
|
XBOX 360 Gamertag: webnerd
Mark
Coding Team
Posts: 3,247
Ditto Developer
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #5 on:
Mar 18, 2006, 08:02 PM »
That is
waaaaaaaaay
cooler than the Etomite one I ported a while back... (never released due to various issues)
«
Last Edit: Mar 19, 2006, 12:14 AM by Mark
»
Logged
Documentation
TRAC (Bugtracker)
Forum
How to get help
User Wiki
Credits
SVN Server
Ditto HQ
Stable Download
Development Download
Dr. Scotty Delicious
Coding Team
Posts: 1,172
Dr. of Fine Pirate Arts
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #6 on:
Mar 18, 2006, 11:56 PM »
I love it. Thanks for sharing this man. It is in use at my site now (see the sig). Very clever piece of scripting.
-sD-
scotty Delicious
Logged
We pillage, we plunder, we rifle and loot. Drink up me 'earties, Yo Ho!
We kidnap and ravage and don't give a hoot. Drink up me 'earties, Yo Ho!
Yo Ho, Yo Ho! A pirate's life for me.
sottwell
Documentation Team
Posts: 8,170
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #7 on:
Mar 19, 2006, 12:04 AM »
Excellent! The only 'quibble' I could have is that it would be nice to be able to close the boxes. Maybe a button with something like this:
Code:
onclick="Effect.Fade(this)"
Logged
sottwell.com has moved to a lovely Solaris 10 server!
Log in
username guest, password guestuser.
Templates are now becoming available at
http://sottwell.com/templates.html
kylej
Coding Team
Posts: 738
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #8 on:
Mar 19, 2006, 09:03 AM »
Quote from: sottwell on Mar 19, 2006, 12:04 AM
Excellent! The only 'quibble' I could have is that it would be nice to be able to close the boxes. Maybe a button with something like this:
Code:
onclick="Effect.Fade(this)"
I have posted an updated version with this functionality included, great idea.
Logged
::
Download Modx
::
Add-on Repository
::
Documentation
::
Bug Tracker
::
Donate!
::
My Site - www.muddydogpaws.com
::
::
Wayfinder
::
AjaxSearch
::
FileDownload
::
DittoCal
::
TvTagCloud
::
sottwell
Documentation Team
Posts: 8,170
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #9 on:
Mar 19, 2006, 09:22 AM »
Quote
# Open ajaxSearch.php and set the options for your search.*
Hmm...is there perhaps some way the snippet could generate a bit of javascript that loads an array of these values into the javascript scope, then they could be passed via the AJAX call as params?
Logged
sottwell.com has moved to a lovely Solaris 10 server!
Log in
username guest, password guestuser.
Templates are now becoming available at
http://sottwell.com/templates.html
kylej
Coding Team
Posts: 738
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #10 on:
Mar 19, 2006, 11:58 AM »
That sounds like it could be possible, Ihadn't thought of doing it that way. Has anyone used a snippet to do this before? If not I will have to look into doing it. I think it sounds like a good idea.
Logged
::
Download Modx
::
Add-on Repository
::
Documentation
::
Bug Tracker
::
Donate!
::
My Site - www.muddydogpaws.com
::
::
Wayfinder
::
AjaxSearch
::
FileDownload
::
DittoCal
::
TvTagCloud
::
rthrash
Foundation
Posts: 9,575
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #11 on:
Mar 19, 2006, 01:54 PM »
Out of curiosity, what happens if someone happens to have JS turned off with this... does it degrade and work like a regular old search form?
Logged
MODx
is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you
help us help you
,
read the wiki
, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @
Collabpad
work
productively.
work
intelligently.
work
together.
MODx
Current
|
Dev
|
SVN Root
|
JIRA (Bugs)
|
Confluence (097 Wiki)
|
Fisheye SVN Browser
doze
Coding Team
Posts: 3,237
....Boom!
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #12 on:
Mar 19, 2006, 02:11 PM »
Quote from: kylej on Mar 18, 2006, 03:07 PM
If the user does not have javascript enabled, the snippet will use the default searching of the FlexSearchForm snippet.
Looking at this quote from the first post, I would guess "yes"..
Logged
MODxWiki
|| Please, list wiki worthy material
here
!
kylej
Coding Team
Posts: 738
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #13 on:
Mar 19, 2006, 04:23 PM »
Yep, it works just like the old search form. I use javascript to change the functionality of the form, so if there is no javascript, it does the original form action.
Logged
::
Download Modx
::
Add-on Repository
::
Documentation
::
Bug Tracker
::
Donate!
::
My Site - www.muddydogpaws.com
::
::
Wayfinder
::
AjaxSearch
::
FileDownload
::
DittoCal
::
TvTagCloud
::
rthrash
Foundation
Posts: 9,575
Re: [Snippet] - FlexSearchForm with Ajax
«
Reply #14 on:
Mar 19, 2006, 10:52 PM »
And then some days, you just don't read...
Logged
MODx
is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you
help us help you
,
read the wiki
, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @
Collabpad
work
productively.
work
intelligently.
work
together.
MODx
Current
|
Dev
|
SVN Root
|
JIRA (Bugs)
|
Confluence (097 Wiki)
|
Fisheye SVN Browser
Pages: [
1
]
2
3
...
6
Go Up
Print
« Previous topic
Next topic »
Jump to:
Please select a destination:
-----------------------------
Announcements
-----------------------------
=> Important News
=> Security Notices
-----------------------------
Commercial Support
-----------------------------
=> [CS] About Commercial Support
-----------------------------
Development & Coding
-----------------------------
=> Commercial Inquiries & Bounties
=> Core Code
===> MODx Next
===> xPDO
=> Module, Plugin & Snippet Creation and Modification
=> In Development
=> Templates
=> Internationalization
===> Bulgarian
===> Chinese
===> Czech
===> Dutch
===> French
===> German
===> Irish
===> Italian
===> Japanese
===> Polish
===> Portuguese
===> Russian
===> Slovak
===> Spanish
===> Swedish
===> Persian - فارسي
-----------------------------
Support
-----------------------------
=> Release Support
===> 0.9.6.2
===> 0.9.6.1
===> 0.9.6
===> 0.9.5 and earlier
=> General Support
===> MODx 101
===> E-Commerce, E-Marketing, Analytics & SEO
===> Hosting Experiences
===> IIS / Windows Hosting Issues
=> Documentation, Tips & Tricks
===> Documentation Suggestions & Corrections
-----------------------------
Add-ons, Extensions & Elements
-----------------------------
=> Module, Plugin & Snippet Usage
=> General Repository Items Support
=> Navigation & Tagging/Taxonomy
===> Wayfinder & DropMenu
=> Creating & Repurposing Content
===> Ditto
===> Jot
===> QuickEdit
=> Users, Authentication & Personalization
===> WebloginPE
===> WebLogin, WebSignup and WebChangePwd
=> Rich Text Editors & File Browser
===> TinyMCE
===> FCKeditor
===> MCPuck File Browser
=> Forms, Form Processing & Anti-Spam
===> eForm
=> Search
===> AjaxSearch
=> E-business
=> Polls, Calendars, Address Book and Community
=> Third-party integrations
=> Images, Videos & Podcasts
===> MaxiGallery
=> Manager, Parser & the Core
===> Backup & Versioning
===> Doc Finder
===> ManagerManager
===> PHx
=> Templates
-----------------------------
General Discussions
-----------------------------
=> General MODx Discussions
=> Web Design and Development
=> Wishlist
=> You and Your Sites
=> modxcms.com Discussions and Suggestions
=> Off-topic
-----------------------------
Czech Community
-----------------------------
=> Oznámení
===> Důležitá oznámení/novinky
===> Bezpečnost
=> Podpora
===> FAQ (často kladené otázky)
===> Instalace
===> Moduly, pluginy, "snippets & code" (šablony zdrojových kódů)
===> Design & Šablony
=> Dokumentace, tutoriály (návody) a překlady
===> Dokumentace
===> Tutoriály (návody)
===> Překlady (lokalizace)
=> Komunita
===> Oznámení
===> Představte se, prosím
===> Ukázky práce
===> Různé aneb cokoli co se jinam nehodí
-----------------------------
Bulgarian Community
-----------------------------
=> Поддръжка
===> Често задавани въпроси
===> Инсталация
===> Модули, Плъгини, Снипети и код
===> Дизайн и Шаблони
=> Документация, Ръководства и Превод
===> Документация
===> Ръководства
===> Превод
=> Общество
===> Съобщения
===> Представете се
===> Представете сайта си
===> Дискусии извън MODx
-----------------------------
Dutch Community
-----------------------------
=> Ondersteuning
===> Veel gestelde vragen
===> Modules, Plugins, Snippets & Code
===> Design & Templates
=> Documentatie, Tutorials en Vertalingen
===> Documentatie
===> Tutorials
===> Vertalingen
=> Community
===> Aankondigingen
===> Stel jezelf voor
===> Site Showcase
===> De stamkroeg
-----------------------------
Finnish Community
-----------------------------
=> Tuki
===> UKK
===> Asennus
===> Moduulit, liitännäiset, koodinpätkät
===> Ulkoasu/Sivustopohjat
=> Dokumentaatio, oppaat ja käännökset
===> Dokumentaatio
===> Käännökset
===> Oppaat
=> Yhteisö
===> Tiedotteet
===> Esittele itsesi
===> MODx sivustosi
===> Kahvihuone
-----------------------------
Filipino Community
-----------------------------
=> Suporta
===> Kadalasang tanong
===> Instalasyon
===> Moduler, Maidadagdag, Karagdagang mga Code
===> Desenyo at Templates
=> Dokumentasyon, Mga Turo, Mga Salin
===> Dokumentasyon
===> Mga Turo
===> Mga Salin
=> Kumunidad
===> Anunsyo
===> Ipakilala ang sarili
===> Ang Galing ng pinoy
===> Tsismisan atbp
-----------------------------
French Community
-----------------------------
=> Support
===> FAQ
===> Installation
===> Module, plugin, snippets
===> Design/Templates
=> Documentation, Tutoriels et Traductions
===> Documentation
===> Traduction
===> Tutoriels
=> Communauté
===> Annonces
===> Présentez vous
===> Vos sites
===> Le Bistrot Français
-----------------------------
German Community
-----------------------------
=> Support (de)
===> FAQ (de)
===> Installation (de)
===> Module, Plugins, Snippets & Code (de)
===> Design & Templates (de)
=> Dokumentation, Tutorials und Übersetzung
===> Dokumentation
===> Tutorials (de)
===> Übersetzung
=> Community (de)
===> Ankündigungen
===> Stellt Euch vor
===> Beispielseiten
===> Off Topic / Verschiedenes
-----------------------------
Irish Community
-----------------------------
=> Tacaíocht
===> CC Ceisteanna Coitianta
===> Breiseáin (cláir bhreise), Snippets & Comhaid
===> Suiteáil
===> Dearadh & Teimpléid
=> Doiciméid, Teagascóireacht agus Aistriúchán
===> Doiciméadú
===> Teagascóireacht
===> Aistriúchán
=> Pobal
===> Fógraí
===> Cuir Tú Féin in Aithne
===> Gailearaí an Láithreáin
===> Caifé / An Tábhairne / Ábhar Cainte Eile / Ilghnéitheach
-----------------------------
Italian Community
-----------------------------
=> Supporto
===> FAQ
===> Installazione
===> Moduli, Plugin, Snippet e altro codice
===> Web Design e Template
=> Documentazione, Tutorial e Traduzione
===> Documentazione
===> Tutorial
===> Traduzione
=> Comunità
===> Annunci
===> Presentazioni
===> Siti in vetrina
===> Chiacchiere in libertà
-----------------------------
Japanese Community
-----------------------------
=> サポート
===> 良くある質問
===> インストール
===> モジュール・プラグイン・スニペット・本体
===> デザインやテンプレート
=> マニュアル・テュートリアル・翻訳
===> マニュアル
===> 事例集、テュートリアル
===> 日本語化
=> コミュニティ
===> お知らせ
===> MODxサイト展示場
===> 自己紹介
===> 雑談
===> 国産リソース
-----------------------------
Persian Community
-----------------------------
=> پشتيباني
===> راهنما
===> نصب
===> ماژول , پلاگین ها , کد ها و جزییات
===> طراحی و قالب ها
=> مستند سازی , آموزش ها و ترجمه ها
===> مستند سازی
===> آموزش ها
===> ترجمه ها
=> انجمن ها
===> اخبار
===> معرفی کردن خود
===> نمایش دادن سایت ها
===> بحث های عمومی و سایر موضوعات
-----------------------------
Polish Community
-----------------------------
=> Wsparcie
===> FAQ
===> Instalacja
===> Moduły, pluginy, snipety i kod
===> Wygląd i szablony
=> Dokumentacja, tutoriale i tłumaczenie
===> Dokumentacja
===> Tutoriale
===> Tłumaczenie
=> Społeczność
===> Ogłoszenia
===> Przedstaw się
===> Twój serwis WWW
===> Hyde Park
-----------------------------
Portuguese Community
-----------------------------
=> Suporte
===> FAQ - Dúvidas Frequentes
===> Instalação
===> Módulos, Plugins, Snippets e Código
===> Design e Templates
=> Documentação, Guias e Traduções
===> Documentação
===> Guias
===> Traduções
=> Comunidade
===> Anúncios
===> Apresente-se!
===> Bar da esquina (fora de tópico)
===> Portfólio de Sites
-----------------------------
Russian Community
-----------------------------
=> Поддержка
===> ЧАВО (FAQ)
===> Установка
===> Модули, плагины, сниппеты и код
===> Дизайны и шаблоны
=> Документация, Уроки, Перевод
===> Документация
===> Уроки
===> Перевод
=> Сообщество
===> Объявления
===> Представьтесь публике
===> Галерея сайтов
===> Диван
-----------------------------
Scandinavian Community
-----------------------------
=> Support
===> Frågor och svar
===> Installation
===> Moduler, plugins, snippets och kod
===> Design & sidmallar
=> Dokumentation, guider och översättningar
===> Dokumentation
===> Guider
===> Översättningar
=> Webbgemenskap
===> Meddelanden
===> Presentera dig själv
===> Visa upp dina webbsidor
===> Ordet fritt
-----------------------------
Spanish Community
-----------------------------
=> Soporte
===> FAQ
===> Instalación
===> Modulos, Plugins, Snippets & Código
===> Diseño y plantillas
=> Documentación, Tutoriales y Traducciones
===> Documentatción
===> Tutoriales
===> Traducciones
=> Comunidad
===> Anuncios
===> Presentaciones personales
===> Muestra de sitios
===> El Café
-----------------------------
TÜRKÇE (Turkish)
-----------------------------
=> Destek
===> SSS
===> Kurulum
===> Modüller, Pluginler, Snippetlar & Kodlar
===> Dizayn & Temalar
=> Belgeleme, Eğitmenler ve Çeviri
===> Belgeleme
===> Eğitmenler
===> Çeviri
=> Topluluk
===> Duyurular
===> Kendinizi Tanıtın
===> Site Vitrini
===> Konu Dışı