06.05.2013 Views

Drupal 6 JavaScript and jQuery - Ebook-Cours.com

Drupal 6 JavaScript and jQuery - Ebook-Cours.com

Drupal 6 JavaScript and jQuery - Ebook-Cours.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

[ 289 ]<br />

Chapter 9<br />

Our plan<br />

For our implementation, we will add auto<strong>com</strong>pletion to the search field in the search<br />

module's block. But rather than running a search for each auto<strong>com</strong>pletion request,<br />

we will build a scaled-down list of terms that we will define. Only that list of terms<br />

will be used for auto<strong>com</strong>pletion.<br />

If this were a book on PHP development, I would suggest writing some server-side<br />

code to collect <strong>and</strong> analyze search engine data, <strong>and</strong> then use that information to<br />

pre-populate an auto<strong>com</strong>pletion field. But we can't readily get that information.<br />

So we will try another approach.We will use a <strong>Drupal</strong> taxonomy as the source for<br />

our suggestions.<br />

Taking this approach, we will allow content creators to add keywords to articles.<br />

Those keywords will then be used for auto<strong>com</strong>pletion.<br />

First step: creating the taxonomy<br />

We are going to use a taxonomy to seed our search terms. <strong>Drupal</strong> taxonomies are<br />

collections of terms that are sometimes structured (such as a hierarchy of categories)<br />

<strong>and</strong> sometimes unstructured (such as user-entered tags). Using taxonomies you<br />

can add keywords, categories, <strong>and</strong> tags to the content on your site. But there<br />

are many other uses for taxonomies. Ours will be used for providing our search<br />

auto<strong>com</strong>pletion with a list of suggestions.<br />

On occasion, <strong>Drupal</strong> uses the term vocabulary instead of taxonomy.<br />

Sometimes, a tenuous distinction is made (a taxonomy is made up of<br />

vocabularies, which are in turn made up of terms). Practically speaking,<br />

the term 'vocabulary' is a synonym for taxonomy.<br />

This material is copyright <strong>and</strong> is licensed for the sole use by Richard Ostheimer on 18th June 2009<br />

2205 hilda ave., , missoula, , 59801

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!