Create a classified ad section

Last modified: January 5, 2008 - 16:09

This is a recipe on how to get Classifieds in Drupal 4.7.

Demo of classifieds using these instructions.

Overview: This recipe uses these (up to date) items:

  • Drupal 4.7
  • Views.module
  • flexinode.module
  • style.css (for your theme)

1) The first thing you need to do is create a custom flexinode. Create the fields that you want people to be able to enter. Some recommendations are: Title, Description, Name, Email, Phone Number, Price, and Pictures. Do not create fields that you would want people to be able to filter the classifieds by (state, category etc).

2) Create Categories (taxonomy) with the terms you want people to choose from and assign your flexinode as "type". I would suggest having at least:

  • Regions (state, country etc)
  • Category (Real estate, clothes, cars, trailers etc...)
  • Type of ad (for sale, wanted, rent, etc)

3) Create a custom template.php file in order to use a custom node-flexinode-n.tpl.php file.

4) Customize your node-flexinode-n.tpl.php file where n is your flexinode number. Be sure to add your taxonomy "categories" to the node in a way that will make sense to the end user.

(If you need help with steps 3 and 4, refer to the handbook pages on Customising flexinode layouts.

5) Create a custom "view" using views.module. Make it a "Page" and "table view." Next, choose the "fields" you want shown on the classified table view. Next, choose the filters you want the type to be able to be filtered by. Choose which filters you want to "expose" to the end user. Next modify all the permission and misc view settings to get it to appear the way you want.

6) Next, edit your style.css file to get the classifieds to look the way you want them to. You can adjust the tabs, colors, padding, etc...

7) Visit "access control" and make sure you set role permission for creating your classified ads.

8) That's about it!

This is my first attempt at creating a "recipe" for drupal. If you have any questions or if I'm not clear enough on a point, please let me know.

 
 

Drupal is a registered trademark of Dries Buytaert.