Monday, September 08, 2008

Drupal CCK Search

So you've added a custom content type, you've added CCK fields to it. Now you want to create some pages, to provide search result lists for your custom content type.

If your using Drupal 6, make sure the CCK Module, the Views Module, and the Advanced Help module are installed.

Then within the drupal admin, go to "Views". This is where you can create your custom search result pages. The advanced help module, will help you make sense of things, and the "Views" module itself is great in that it tells you the exact SQL that will be used to generate your search results. You can use any thing related to your node to help filter your results; be it CCK, Taxonomy or many other options.

4 comments:

Anonymous said...

Please provide an example.

Anonymous said...

I would also like to see an example if its posible. Thanks

Anonymous said...

In my experience using Views for custom search is all well and good if you don't have a lot of content and your site isn't heavily trafficked, otherwise it's an open invitation to db-related performance issues.

koobmeej said...

Views is nice cause it can show you the actual sql used. Which is great when your using various 3rd party Drupal Modules.
You can then take the sql, and code up a none views solution.