Hi,

I want to implement an FAQ system using Drupal.

I would like a navigable tree structure of topics, e.g.:

Footwear
- shoes
- boots
+ ankle
+ short
* leather
* plastic
+ full

Clothing
- Trousers
- Shirts

etc.

I would like the user to be able to expand and collapse the tree as required. When they click on a topic they get taken to a list of articles that are associated with that topic.

Is this possible with Drupal? I've played with the "Category Browser" but that doesn't have the UI or behaviour I am looking for.

Any suggestions?

Thanks

D.

Comments

tenjin’s picture

Hi,

Actually, I've just noticed the "Drupal Handbook".

That would be perfect!

How do I implement that?

Cheers

D.

iraszl’s picture

Just switch on the book module in the admin/modules. Than you can create new book pages and for each you just select the parent. It's a great feature of Drupal.
---
http://creativebits.org

tenjin’s picture

Hi,

Thanks for the reply.

I'm a real newbie with Drupal, so could you tell me:

1. How I build the hierarchy of topics?

2. How do I get the hierarchy of topics to appear in the side bar, just like the Drupal Handbook?

Thanks

D.

peterx’s picture

I looked at the handbook as an example. Many of the pages are of the form node/nnnn. Some had pretty URLs of the form aaaa. I did not see any of the form aaaa/bbbb/cccc.

I just spent 4 hours trying to set up a page as aaaa/bbbb. I read about 20 different ways to do it. All did something but not the complete job. I found requests for a simple static page structure going back years with attached suggestions but many of the suggestions do not match the administration pages in Drupal 4.6.0.

Currently I have a book set up as recommended in one post but it does not work unless I manually assign URLs. When I manually assign /aaaa/bbbb, /aaaa/bbbb brings up “page not found”. /aaaa/bbbb does not work for pages or book pages. The url_alias table has the correct entries.

Is there something different about Drupal 4.6.0?

I found one site with Drupal and multiple level directories:
http://varnelis.net/projects/cathedralsofculture/industry.html

venkat-rk’s picture

A hierarchical structure for architecting one's site is probably Drupal's biggest irritation- it isn't there at the moment, although book pages come closest. Even in the site above, just try going a directory up and you will get 'page not found' errors.

There are workarounds. If you use taxonomy and manually set aliases for the terms and sub-terms, you can get nicely hierarchical site structures, but you will get stumped when you reach the vocabulary- you can't give it an index page yet.

peterx’s picture

Hello ramdak5000,
Do you have an example site showing /aaaa/bbbb working using the method you describe?

Could you explain the "it" in "you can't give it an index page yet.". Are you talking about placing an index page at /aaaa/ so that people can see an index of everything in /aaaa/?

Is there a point where I could alter code to do what is required? I am happy to run with non standard code until I have exactly what I want then request a change or work on a change that fits Drupal development.

I would like to make a change that fits the product architecture but I cannot wait 6 months. The entries in this forum suggest that many patches and modules were developed to fix this problem and they all work for page /aaaa but not when you have a hundred pages under directory /aaaa/. I am converting a site that already has hundreds of pages with paths up to /aaaa/bbbb/cccc/dddd.

rthelen’s picture

I understand your frustration with the hierarchy problem.

I solved it in two ways:

  1. I selected URL aliases for my pages using a hierachical naming convention
  2. I wrote a hierarchical module

(I also wrote some code so I could show you my code, you can view that code here.)

I have placed the documentation for using the module at my web site:
madscientistroom.org/drupal/About/Drupal/Using-the-hierarchy-module

Good luck!

boris mann’s picture

Get a CVS account! Contribute it here....

I love how you've used path alias to show the connections. It doesn't matter whether it is book/blog/story/image/whatever....the menu is based around the path alias.

Warrants some further thought. There is value in a structured hierarchy (e.g. book, which can do ordering), but this kind of "free hierarchy" (or derived hierarchy?) is very cool.

Combined with pathauto, makes an interesting combo.

And...nice work on fully documenting your module. Two thumbs up.

venkat-rk’s picture

Indeed!!

Although I haven't tested it yet, reading through the documentation, this seems like a godsend after all the wait of the last few months.

I will send more comments/thoughts after testing it out.

venkat-rk’s picture

Hi, I tried your module today and encountered some problems. On my test site, www.actfordharma.org/development/, I don't get the block (please look at the bottom right, below the statistics block).

Also, it is not clear to me where pathauto comes in for this module (sorry, I am not a programmer). The pathauto functions seem independent of this module. The smartest thing- please correct me if I am wrong- about the module is that one automatically gets a block with the root and all the pages under it.

I am using Drupal 4.5.2

venkat-rk’s picture

Do you have an example site showing /aaaa/bbbb working using the method you describe?

You can see it in action here: www.ciosa.org.in/members/individuals and www.ciosa.org.in/programmes/networking, where individuals and networking are terms under the vocabs "Members" and "Programmes" respectively. I assume this is what you meant by /aaaa/bbbb/cccc

This pulls up all the nodes associated with the term 'individuals' and 'networking'. The site is very basic at the moment and I haven't added menus for the hierarchical sub-sections (networking and individuals). There are other sections for which aliases are set up, but don't have any nodes associated yet. Also, I haven't enabled any breadcrumbs. The bottomline is that aliasing for a hierarchical site structure works, but is an involved process in Drupal.

The "it" refers to the vocabulary term itself. In Drupal, *terms* in a vocabulary are automatically given a kind of index page that lists nodes under that term. This is how I was able to alias those pages to match them with the sub-sections. Unfortunately, the vocabulary itself (like programmes or members in my site above) does not get this kind of an index page. If you think of a vocabulary as the home page of a particular section in a hierarchical site structure, it seems reasonable to expect that this home page will aggregate the nodes relating to the terms under that vocabulary.

I have tried two options so far for this problem, each incomplete:

1.) The first is to create a manual alias for all your taxonomy terms for one vocabulary (taxonomy/term/1,2,3) by mapping it to that vocabulary (in my case, "members" or "programmes"). This *does* pull up all the nodes associated with the terms of that vocabulary. The only problem is that the title for the page is displayed as term_name1, term_name2, etc instead of the vocabulary name, as it ideally should. It seems you can hack through this by enabling the locale module, adding a new language (say, en-modified), searching for the term_name1, term_name2 etc., string. However, the last time I tried this, the string text field would not accept such a longish string. I also wonder whether this would change all instances of the term_name on the entire site- not a good idea since the terms need to have their own names on their own pages.

2.) Use the updated taxonomy_context module based on Jerermy Epstein's work at www.greenash.net.au (look at the taxonomy tutorials). The new module gives excellent, taxonomy based breadcrumbs and also a kind of index page for the vocabulary. My only problem is that it seems to functions like a master index page that just lists vocabularies instead of listing the nodes for a particular vocabulary. I could be wrong about this too.

To create a menu that points to your taxonomy terms, please look at http://drupal.org/node/21476#comment-37106

I am not an expert drupal user- this is just the result of my personal experimentation with trying to set up a hierarchical site.

Last but not the least, pathauto is probably one of Drupal's best modules. You can't do without it to create hierarchical sites. And, jwells, to answer your question, it was Mike Ryan who was trying to incorporate the index page functionality for vocabs into pathauto. Try looking at the issue pages for pathauto for the latest updates.

green monkey’s picture

Ram, you said "yet" .. are there plans to change this? especcailly for me, it would help with menu layout

Samat Jain’s picture

I manually set up the aliases. Doing this you can easily set up the hierarchy you want. You may want to check out http://www.bryght.com/ and look at their books (solutions, services, etc). AFAIK, they created theirs all manually (some pages there is no relationship between the node title and the URL).

There is the "pathauto" module, but in my opinion, it is not very good, and it won't create a hierarchy for books that you want.

kvarnelis’s picture

although i'm trying to get the site converted to drupal, by no means is all of it! the page you looked at is not run by drupal, but is legacy code. and yes, i'm going to be after this kind of navigation pattern...

boris mann’s picture

Yes, we manually set up aliases. Not hard for a limited number of pages typical on a "brochure"-style site.

I've actually found pathauto excellent. It still needs some tweaks, but it keeps improving. If it had something like [book-alias-path] as an option, it would be easy to use native book pages to create a hierarchy.

peterx’s picture

For anyone searching the forums for the message
page not found
associated with url aliases or url alias, I found the cause of one problem. I had "node/10" aliased to "/hardware/cpu" and ended up with a "page not found" message when I clicked on a link to /hardware/cpu. I changed "/hardware/cpu" to "hardware/cpu" and the links worked.