I think it'd be neat if you could have the option to do the Exposed Filter of the Node Title as an autocomplete - on the other hand, this may make more sense to have it as an exposed filter of the Node nid, since the final result submitted might be the nid? Just a suggestion for the future, and if I have the spare time I may try to do a patch on this myself.

Comments

moshe weitzman’s picture

Organic groups would make happy use of this auto-complete.

Xabi’s picture

Subscribing! This would be a great feature for an exposed filter!

thommyboy’s picture

subscribing! absolutely!

dawehner’s picture

Version: 6.x-2.0-rc5 » 6.x-2.x-dev

Sure this quite a cool feature.

It would be also quite easy to write, but not as abstract as it should, here are some thoughts of a more abstract thing.

The auto-completion is for a certain filter, so a method of this handler should be called, to generate the autocompletion.
This is called from a page callback defined in hook_menu of views.
This should be build similar to views_ajax, but not render/execute the view, but call a method of the specific handler.

Perhaps someone could post to this ideas

momper’s picture

subscribe

peterjmag’s picture

I'm not actively using it, but I've had this bookmarked for a while, and it may help: http://drupal.org/project/finder

dagmar’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev

As dereine said, this feature is not so simple to implement. Lets see if we can put this in views 3 in a near future.

nodecode’s picture

Not sure if this is the way to go about this but it looks like someone has done this before by creating their own Module to override some of the Views code. Maybe this can be used by the Views developers: http://drupal.org/node/179922

dawehner’s picture

As i said above, its not the question about doing it, its the question of how to write it as abstract as needed.

YK85’s picture

+1 subscribing

Bilmar’s picture

+1 subscribing - dereine mentioned this is similar request to one I just opened for taxonomy: term id auto-complete filter #743668: "Limit list to selected items" option for taxonomy term id autocomplete. I feel this would be greatly beneficial for users of Drupal + Views and hope it will make it into Views 3 =) Thank you

Starvin15’s picture

This would be great to have. Currently the only way I found to do this is through autocomplete on taxonomy term and assigning each of my nodes the taxonomy term equal to the node title. This is most certainly a very inefficient way of going about this.

operations’s picture

Subscribed..

I have a view that displays a cck exposed filters, to let the users do search on some fields like title, category, phone .. etc.
So, I need an autocomplete on some of the cck exposed fields. I tried the following modules:

http://drupal.org/project/finder
http://drupal.org/project/autocomplete_widgets

For the finder module I integrated it to work for the view. It worked in a brilliant way, but when I filled the database with 30,000 record or above.. it became slow and then throws the error (Allowed memory of ... exausted .. ), though I'm using a shared server and I guess for a dedicated it will work but not efficient.

For the autocomplete_widgets module, I'm unable to pull out the autocomplete method for the exposed fields, it can be used only when creating a node (adding autocomplete widgets for CCK fields of type).

Any suggestions? Help please!! I need to finish this within less than 1 week :)

Mohannad

operations’s picture

Status: Active » Fixed

Hi all,
I read this topic and did some coding and my autocomplete search worked perfectly:

http://web2make.com/content/drupal-autocomplete-node-title-and-image

Here is what i did,
In template.php i added this code:

function bp_preprocess_views_exposed_form(&$vars, $hook) {
	
	$general_v = 'views-exposed-form-Search-View-page-2';
	$advanced_v = 'views-exposed-form-Search-View-page-1';
	
        // only alter the search view exposed filter form
	if ($vars['form']['#id'] == $general_v || $vars['form']['#id'] == $advanced_v)
	{	
		// Change the text on the submit button to Search
		$vars['form']['submit']['#value'] = t('Search');
		unset($vars['form']['submit']['#printed']);
		$vars['button'] = drupal_render($vars['form']['submit']);
	}
	if($vars['form']['#id'] == $general_v)
	{
                // This code is for quicktabs module to keep the searched tab active (you can avoid if you don't use tabs for your search)
		$vars['form']['gen_name']['#prefix'] = '<div class="form-item" id="edit-quick-tab-wrapper">
			<input type="hidden" name="quicktabs_2" id="quicktabs_2_target" value="0" class="form-text" /></div>';
                //
		
		//print_r($vars['form']['gen_name']);die;
		//Add autocomplete functionality to the name textbox
		$vars['form']['gen_name']['#autocomplete_path'] = 'finder_autocomplete/autocomplete/2/3';
		unset($vars['form']['gen_name']['#printed']);
		$vars['widgets']['filter-title']->widget = drupal_render($vars['form']['gen_name']);
	}
	else if($vars['form']['#id'] == $advanced_v)
	{		
                // This code is for quicktabs module to keep the searched tab active (you can avoid if you don't use tabs for your search)
		$vars['form']['adv_name']['#prefix'] = '<div class="form-item" id="edit-quick-tab-wrapper">
			<input type="hidden" name="quicktabs_2" id="quicktabs_2_target" value="1" class="form-text" /></div>';
                //

		//Add autocomplete functionality to the name textbox
		$vars['form']['adv_name']['#autocomplete_path'] = 'finder_autocomplete/autocomplete/2/3';
		unset($vars['form']['adv_name']['#printed']);
		$vars['widgets']['filter-title']->widget = drupal_render($vars['form']['adv_name']);
		
		//Add autocomplete functionality to the category textbox
		$vars['form']['cat']['#autocomplete_path'] = 'finder_autocomplete/autocomplete/2/5';
		unset($vars['form']['cat']['#printed']);
		$vars['widgets']['filter-field_category_value']->widget = drupal_render($vars['form']['cat']);
	}
}

By the way you can know the finder path as below:
After you create a finder and add an element to it (such as autocomplete Name field), go to the path of the finder (ex:- /finder/1).. search for any word, open the console in firefox.. then you will find the path of the ajax call (ex:- finder_autocomplete/autocomplete/2/3/word). ommit the /word and use the rest path.

Hope it will help :)
Mohannad

operations’s picture

Status: Fixed » Needs review
dagmar’s picture

Status: Needs review » Active

As a support request, this should be marked as fixed.

But, as a feature request, there is no patch here, and therefore, status is active.

patcon’s picture

+1 subscribing

mstrelan’s picture

+1 subscribing

held69’s picture

subscribing

Isostar’s picture

+1

Exploratus’s picture

WOW! +1

Exploratus’s picture

Will this work on the 2.x branch?

dzescsd’s picture

subscribe

drupalnesia’s picture

Version: 6.x-3.x-dev » 6.x-2.12

Will this autocomplete should provided on Views 2?

dawehner’s picture

Version: 6.x-2.12 » 6.x-3.x-dev

Nope. Views2 is currently on a stable state, so new features get's only added to views3

vasike’s picture

please check http://drupal.org/project/views_autocomplete_filters

maybe also will be integrated in views in a better way

dawehner’s picture

Status: Active » Fixed

There is a module for it, so this issue is fixed.

Status: Fixed » Closed (fixed)

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

emosbaugh’s picture

Status: Closed (fixed) » Active

http://drupal.org/project/views_autocomplete_filters only works for views 2. see code

if ('2' != substr(views_api_version(), 0, 1)) {
// Only continue for Views 2.x
return;
}

dagmar’s picture

Status: Active » Closed (fixed)

@emosbaugh: What are you trying to say with that?

Please fill an issue in the http://drupal.org/project/views_autocomplete_filters issue queue.

emosbaugh’s picture

nevermind. i now see this is posted in the views issue queue. my mistake

merlinofchaos’s picture

This queue is not responsible for whether or not contrib modules are updated. You can file an issue against that module.