I would like to be able to open Inline Ajax Search in a Modal Window (lightbox), rather than in a block, so search on my site acts similar to Quicksilver for Macs.
I imagine it functions like so:
* User clicks on a "Search" link in the menu.
* A Modal Window (such as Lightbox2) pop-ups with a Inline Ajax Search page.
* The user searches for words and listings are displayed in real-time
* The user can select one of the search listings or exit out of the Modal Window and continue viewing current page.
This would simple require creating a page in addition to the current block that has the Inline Ajax Search form.
I've trying hacking the block to display this way, but it would be much easier if I just had a ajax-search.php page to use.
Comments
Comment #1
fabianderijkNice idea! I will see what I can do, but it shouldn't be a problem I think.
Comment #2
promesI have a similar request. On several sites I don't have a search box but only a link in a menu to a searchpage. The default Drupal searchpage is: www.example.com/search [/node].
I like to change the searchoption of these sites as well.
I like this module allready very much.
Comment #3
fabianderijkThis problem is fixed in the new 6.x.3.5 version of the module, there is a new module you can enable which enables the search page at search/inline_ajax_search, also take a look at the extra config page for page specific configuration
Comment #4
philbar commentedGood work, but I was hoping to have a page with no theme. I will take a look at the code and see what I can do to add an option for this.
At least there should be something added to the body tag so I can hide everything but the search form using CSS. A lightbox would look pretty weird with a header and blocks from the current theme.
Comment #5
fabianderijkOk, adding the class to the body class is a easy thing, that can be done. Because I wanted the page to be a independent search page which you can also link to, not only add to a lightbox it is a completely themed page.
The css tag added to the body will be done within the next few days.
Comment #6
promesI did give the new searchpage: search/inline_ajax_search a try, but it reacts like the normal search page, except: after entering for searchresults I get a "Access denied" on www.example.com/search/inline_ajax_search/xxxx (xxxx = searched word).
I am glad you did respond so quick on my request.
Comment #7
fabianderijkThe body class is added in the next nightly build. On page's that show the search block the class "inline-ajax-search" is added, and on the search page the class "inline-ajax-search-page" is added.
Promes, the way you are searching with this module isn't the way this module works. Why show ajax results when you search the way you are? You can use the core search for this. The path only exists to show a page with the search form on it.
Comment #8
fabianderijkComment #9
philbar commentedI was actually talking about adding an id on the
<body>tag.It's fine though. I finally learned how to use theme tpl.php files. It was much easier than I thought.
Now I just need to figure out to tell Lightbox2 to open the menu item in a modal window.
Comment #10
fabianderijkYou can probably add the rel attribute to a link with rel="lightbox" or something. The lightbox module itself provides good documentation about that.
Comment #11
philbar commentedI used the Menu Attributes module to add the rel="lightframe".
I stripped down the inline_ajax_search page and now the form doesn't work:
http://dev.bioworldusa.com/search/inline_ajax_search
Any clue why that would happen?
Comment #12
philbar commentedHere is my
page-search-inline_ajax_search.tpl.phpfile:Comment #13
fabianderijkWhen I search for "home" I get results, but when I search for "hom", I don't. Do you use the search lucene API? This module makes it possible to search with wildcards, so if you search for "hom" it actually searches for "hom*".
Comment #14
philbar commentedNo I haven't configured Lucene API yet.
For this to work, I really need use "lightmodal". If I use "lightframe", then all search results are opened in the lightbox when they should open as a full page.
Unfortunately "lightmodal" disables javascript so it's not working right now. #754462: JavaScript in lightmodal?
Comment #15
fabianderijkHmm maybe I will embed a option for the search page where you can choose which target the links have to have, for instance in your case iot should be target=top
Comment #16
fabianderijkI've just added the target option to the next nightly build.
Comment #17
fabianderijkFixed in the new 6.x.3.7 build