Closed (fixed)
Project:
Autocomplete Node Finder
Version:
6.x-2.0
Component:
Documentation
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Sep 2008 at 11:46 UTC
Updated:
9 Feb 2009 at 02:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
danielb commentedOh man that's cool :D Hadn't seen that before.
I've accidentally put HTML into the autocomplete suggestions and it worked, so yes this easily possible, just not implemented.
The question is what kind of options do I give people about what they can do? The easiest thing for me would just be to create a hook so they can theme their own autocomplete suggestions or so that someone can build a function/module to make it easier for people to do a few preset layouts.
The only worry I have is that hooks implemented in other modules may not be called properly when I do the javascript callback ? Hopefully it's all fine.
PS if you want to have a go at hacking the module yourself for your own purposes look in the function autocomplete_node_finder_autocomplete() for $matches[$the_match] = $the_match; and try changing it to $matches[$the_match] = "
"; and styling the div somehow - if that works, try adding a html link in there to see if you can override the click-to-fill-form functionality with just a simple clicked link to go to another page. If that doesn't blow up then you can do anything.
Well actually not everything, because the call to the function that returns the results actually doesn't ask for matching Node IDs (instead, this is asked for after the form submit) so you have limited options for generating links (such as to purchase the product etc...).
So I'd actually have to provide another option for returning suggestions as unique nodes, not unique terms for this to work.
Any other ideas, or how you see this working, and how you'd like to configure it?
Comment #2
danielb commentedmy code examples were eaten by the filter but it doesn't matter since you don't have the nids anyway
Comment #3
susheel_c commentedDaniel,
It feels like you've got a lot of enthusiasm for this project ... and what you've already contributed is brilliant.
Me, on the other hand - I'm actually a complete noob when it comes to drupal. I'm just getting my feet wet, but I really like the feeling of sand between my toes (if you know what I mean). :)
I'm wondering whether it would be possible to eventually bring up some content designed specifically for this purpose... Meaning, when the node is created, if we could look at specifying a couple of fields just for search (maybe an item description field, a thumbnail image, and a couple of links.)
Or maybe we can create a separate list of items, and then link them to relevant nodes? but then is that going away from what you've intended in your project, because you are interested in finding the nodes, in the end, right?
Looking through my comment, I'm beginning to wonder whether my expectations are a bit far-fetched...?
Either way, great work so far... and I hope you continue to keep it coming.
Cheers!
PS: Do pardon my lack of drupal lingo... I'm just beginning to acquire it.
Comment #4
susheel_c commentedI just realised that I'd mistakenly marked version 6.x - 2.2 in my first comment. I'm actually on 5.x-2.1.... Is there hope?
;)
Comment #5
danielb commentedYeah I'll make sure to update 5 if we put this in. I think the best way now actually is to give the option to display suggestions as a view - that is pretty much all that list is.
Comment #6
susheel_c commentedWoo Hoo!
Comment #7
danielb commentedHave a look at 5.x-3.1, you can theme the autocomplete suggestions in that one.
Create a theme function like this:
return false/null to remove the suggestion
You can make it more complicated to get it to display what you want.
This is all experimental at this point, so no guarantees, but I've definitly seen it work!
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #9
preper commentedhow can we change the position and theme of the A.N.F? i want to use different shape and different search buttons? and also i want to change the color of suggestions and categorize the suggestions.. i am sorry for this simple question but i am new user...
Comment #10
danielb commentedpreper - all of that can be done with basic CSS techniques.
For example, to change the button
Might get some good help for specific ideas you have in the theming forums on drupal.org
Actually styling the autocomplete suggestions was a bit difficult though, because of the default styles. Start with this:
Another tip is also to remove margins from
<p>tagsTo categorize the suggestion you might need to write a module that hooks into this one and manipulates the results. It is probably difficult and will slow down the results too much. I think the block config page gives some tips on how to hook into the module, if you can't do what you need - put a feature request up as a new issue.
Comment #11
preper commentedthanks daniel!!!
you are great!!!
Comment #12
preper commenteddaniel one more quetion;
I want to make a search theme like drugs.com.. but i could't because I can't adjust the shape of the box,area of the submit button and the hidden words in search box when rollover on it.. i want to adjust them seperately but i don't know the names of them.. can you advise me something? or can you give me the names of all contents of Autocomplete node finder separately?
Comment #13
danielb commentedI don't understand your question exactly, but the autocomplete lists appear like this
next to the form input (as a sibling)
Comment #14
preper commentedsorry I could't explain exactely, for example there are different contents of A.N.F like;
autocomplete-node-finder-keywords-0
autocomplete-node-finder-submit
autocomplete_node_finder-0
autocomplete-node-finder-keywords-0-wrapper
i couldn't solve for which one i must write css code to change only the submit buton or only the serach box.
For example i want to change the shape and color of the search box only, sould I write ;
#autocomplete-node-finder-keywords-0 {
color:#00000;
background: url (images/xxx.gif);
}
what should i do to separate these parts and change (with css codes) every component of A.N.F separately?
(not:I have attached a picture to show which parts I want to change and customize separately)
Comment #15
danielb commentedThe autocomplete field is at :
#block-autocomplete_node_finder-0 input.form-autocomplete
The default autocomplete ring image is defined in my system.css like this:
html.js input.form-autocomplete {
background-image:url(../../misc/throbber.gif);
background-position:100% 2px;
background-repeat:no-repeat;
}
html.js input.throbbing {
background-position: 100% -18px;
}
dude get Firebug for Firefox.
Firefox getfirefox.com
Firebug getfirebug.com
learn how to use that it will tell you all this stuff
Comment #16
bhuddle commentedSorry if I missed this - thanks for the code examples and suggestions for tweaking it, but what file does this code appear in? Sorry - I'm completely new at all this. And is there any detailed documentation for ANF? Or is it just a spit-and-bailing-wire module?
Comment #17
mitchell commented@danielb: Please make this into a documentation page; many of us have trouble implementing snippets and would really enjoy the help turning the output into something like the project page's screenshot.
Comment #18
mbeenon commentedhello!
..so i've placed that function (above) in my template.php file.
but suggestions still look the same. i know Ive got to do something more.. what would that be? (in order to display the teaser)// thank you tremendously
Comment #19
danielb commentedMight need to visit the theme page to clear your theme cache?
Comment #20
mbeenon commentedI've Placed :
at the top of my template.php file in my theme folder, renamed the "YOUR-THEME-NAME" to the name of my theme, and expected my auto complete node finder suggestions to appear as teaser, but they do not.. even after emptying my cache. if i add a couple of characters in the function, a message is displayed when i use the nodefinder, so i know its doing something.
any other steps i may be missing? thanks you greatly for you time.
Comment #21
danielb commentedNo idea. You could try debugging it like so:
something like that - should tell you what the theme function is thinking as it's running.
If you never get the debug messages while trying to use the finder then the theme function is not being called when it needs to be.
Comment #22
mbeenon commentedYea, so I beleive i am getting the debug, but, in regards to the autocomplete suggestions, i get this error :
any idea?
Comment #23
danielb commentedThis means you pressed something while the ajax was in progress and interrupted it. That error is built into drupal's javascript - bit annoying.
Comment #24
upupax commentedSame issue as #20: adding the function to my template doesn't display teaser in results.
Trying the debug code generate the same error as #22.
Comment #25
danielb commentedI don't know why that is. Either it's in the wrong place, not called the right thing, or you haven't emptied your theme cache.
Comment #26
upupax commentedI've seen that the same code is commented in the module itself: I've tried to uncomment it, to clear drupal cache, browser cache, run cron, but I still can't see teaser in my suggestions..
the only way to see something changing is to comment out the "if ($match['form'] == 'autocomplete')" statement.. In this way I can finally see the teaser..
Comment #27
danielb commentedYou will have to upgrade to 2.18, there was a bug. Or you can just leave out that 'if' statement.
Comment #28
danielb commentedhttp://drupal.org/node/364168