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

fabianderijk’s picture

Assigned: Unassigned » fabianderijk

Nice idea! I will see what I can do, but it shouldn't be a problem I think.

promes’s picture

I 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.

fabianderijk’s picture

Status: Active » Fixed

This 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

philbar’s picture

Good 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.

fabianderijk’s picture

Status: Fixed » Needs work

Ok, 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.

promes’s picture

I 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.

fabianderijk’s picture

The 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.

fabianderijk’s picture

Status: Needs work » Needs review
philbar’s picture

I 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.

fabianderijk’s picture

Status: Needs review » Fixed

You can probably add the rel attribute to a link with rel="lightbox" or something. The lightbox module itself provides good documentation about that.

philbar’s picture

Status: Fixed » Needs work

I 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?

philbar’s picture

Status: Needs work » Needs review

Here is my page-search-inline_ajax_search.tpl.php file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html id="html" xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language; ?>" xml:lang="<?php print $language->language; ?>">

<head>
  <title><?php print $head_title; ?></title>
  <?php print $head; ?>
  <?php print $styles; ?>
  <!--[if IE 7]>
    <?php print $ie7_styles; ?>
  <![endif]-->
  <!--[if lte IE 6]>
    <?php print $ie6_styles; ?>
  <![endif]-->
  <?php if ($local_styles): ?>
  <?php print $local_styles; ?>
  <?php endif; ?>
  <style>#html{background:none;}#inline_ajax_search_container{padding:10px}</style>
</head>

<body class="<?php print $body_classes; ?>">
<div id="inline_ajax_search_container">
<h2>Quick Search</h2>
	<form id="inline-ajax-search-form" method="post" accept-charset="UTF-8" action="<?php print $inline_ajax_search->formurl; ?>">
    <input type="text" name="inline_ajax_search" id="inline_ajax_search" title="<?php print t('type a keyword'); ?>">
    <div style="display:none" class="searchthrobber IAS_block_throbber"></div>
    <div id="inline_ajax_search_results"></div>
  </form>
</div>
  
  <?php print $scripts; ?>
  
  <?php print $closure; ?>
</body>
</html>
fabianderijk’s picture

When 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*".

philbar’s picture

No 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?

fabianderijk’s picture

Hmm 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

fabianderijk’s picture

I've just added the target option to the next nightly build.

fabianderijk’s picture

Status: Needs review » Fixed

Fixed in the new 6.x.3.7 build

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.