I almost got my first drupal site done.

I create a few categories for "story",
- PHP tips
- CSS tips
- Javascript Tips

I create a page view to show all stories. I also want to give readers choice to only pick certain category to show articles only for that category. I can create another page view to do that, but i m curious if theres a better way to do that, I dont want to create a new page view everytime I add a new category.

link:
articles --> for all stories
articles/php --> only php stories
articles/css --> only css stories
articles/javascript --> only javascript stories.

Comments

feelexit’s picture

thanks for ur help.

Jeff Burnz’s picture

Well, taxonomy does that by default.

If you know the term alias for each term, build navigation items that point to those URL's, otherwise if not, they are always viewable at:

yoursite.com/taxonomy/term/tid where tid is the term id for each term.

no need for views at all - although you can always over ride the default drupal behaviour with the taxonomy_term view.

feelexit’s picture

thanks, I will try that tonite.

feelexit’s picture

thanks, yoursite.com/taxonomy/term/tid works. but here's another problem.

you need to hardcode tid in your code. if you add another term in your category, then you need to go back to your code modify that.

another issue is if you deploy it to another server term tid might changed, that gonna cause alot problems. I am wondering if we can give it a name instead of tid.

Jeff Burnz’s picture

You need to go back to basics and start reading some of the handbooks (documentation) and learn how to build a basic drupal site - there are many such tutorials here on this site and others.