Display Taxonomy Terms Like this

sumitshekhawat7331 - October 11, 2008 - 09:28

hello..

I want to create a Directory site for Gifts.

In this i want to do....

On Index page in left side bar The main Categories are Displayed like this...

Christmas Gift
Birthday Gifts
Valentine Day Gifts
Fathers Day Gifts
Mothers Day Gifts

suppose user click on Christmas Gifts category when the new page loads then it will shows only those sub category which are related to selected category like we have select " Christmas Gifts" then when page loads it will show.(not other)

Christmas Birthday gifts
Christmas Marriage Anniversary Gifts
Christmas Marriage Gifts etc

again when user click on Christmas Birthday Gifts again when page loads it will show only those sub categories which comes under this selected sub category like this

cake
flower
ring

Is this possible with drupal if yes please suggest your views that which modules are useful for this

Thanks

You can do this with the

-Anti- - October 11, 2008 - 10:30

You can do this with the default core taxonomy and menu modules.

One way of doing the taxonomy is:

'gifts' as a containing vocabulary

Christmas <-- parent term (term1)
- cake <-- child terms (term2)
- flowers (term3)
- jewellery (term4)
- card (term5)
- hamper (term6)

Birthday <-- parent term (term7)
- cake <-- child terms (term8)
- flowers (term9)
- jewellery (term10)
- card (term11)

etc

When creating content, you'll see these taxonomies listed and will choose the correct tag for the gift you're creating. The cool thing about Drupal is that you could tag certain items in more than one category; for instance some jewellery could be tagged as valentines *and* mother's day.

So to view a teaser-list of *all* christmas gifts, you'd go to /taxonomy/term/1
To view a teaser-list of only christmas cakes, you'd go to /taxonomy/term/2
To view a teaser list of *all* birthday gifts, you'd go to /taxonomy/term/7
To view a teaser-list of only birthday flowers, you'd go to /taxonomy/term/9

You can create url aliases, so that /taxonomy/term/1 becomes /gifts/christmas-gifts
and /taxonomy/term/2 becomes /gifts/christmas-gifts/cakes

Now the menu. You'd basically just re-create the taxonomy structure in a menu.
The menu items will simply point to /taxonomy/term/[N] or your aliases.

One very smart thing is that, if a customer follows a link from elsewhere to /taxonomy/term/7, the menu will automatically open to that level and highlight the menu item, so the user can easily see where they are within the site's navigation.

Another smart thing is that you could make a menu link called 'all jewellery', and point it to:
/taxonomy/term/4+10+16+22 to view a teaser list of jewellery from each parent category.

Hope that all makes sense. If you're new to drupal, you may have to read the docs section on taxonomy and menus to understand what I'm talking about.

hi thanks for reply but the main problem is...

sumitshekhawat7331 - October 11, 2008 - 12:23

hi thanks for your reply....
i have tried whatever you said... i understand how to link menu and taxonomy term.

But the problem is still there suppose if user click on Christmas Gifts..... the its sub category will display on same page.. means like this...

Christmas Gifts
Sub Gift 1
Sub Gift 2
Sub Gift 3

Birthday Gifts

But i want to display only sub category gifts of selected category. like in this manner...

Sub Gift 1
Sub Gift 2
Sub Gift 3

In this site i have used another module name taxonomy_theme for switching the theme on based of term.

thanks

> But the problem is still

-Anti- - October 12, 2008 - 14:16

> But the problem is still there suppose if user click on Christmas Gifts

Taxonomy:

christmas gifts (term1)
- cake (term2)
- jewellery (term3)
- flowers (term4)

Menu:

christmas gifts (taxonomy/term/1)
- cake (taxonomy/term/2)
- jewellery (taxonomy/term/3)
- flowers (taxonomy/term/4)

Clicking 'christmas gifts' in the menu displays *all* christmas gifts.
Clicking 'cake' in the menu displays only 'christmas -> cakes'.

I don't understand which behaviour you don't want, because to me this behaves exactly like your description, and also makes perfect sense for an online shopping category - if someone is looking for a christmas gift but doesn't know what they want exactly, they click on 'christmas gifts' to show all of them. If they know they want a cake, then they open 'christmas gifts' in the menu and then click on 'cake'.

If this is what you want and it isn't working, are you sure you are creating parent/child items in the taxonomy and menu, and not just all 'parents'?

hi...i understand what you said...but

sumitshekhawat7331 - October 13, 2008 - 06:32

hi thanks for reply..
i understand what you said... and it works..
But i want that my front page display...

Main Categories like

Christmas Gifts
Birthday Gifts
Valentine Gifts

when user click on Birthday Gifts then the new theme will load and that page display only sub categories of Birthday gifts...

Don't display any name or data related to Christmas and Valentine Gifts.

And all this should be display in sidebar thats it.

Hope you understand what i want to know.

Thanks

 
 

Drupal is a registered trademark of Dries Buytaert.