I recently got the go-ahead to make this drupal site publicly accessible:

http://knowledge.ilign.com

It's a software knowledge-base site. We built the site about 8 months ago, but it was private-access-only until a couple of weeks ago. This site hasn't got a large user-base - yet ;)

There's still lots of improving and tweaking going on with this site. Your comments about the site are very welcome.

These points might interest people who are thinking of creating a similar site with drupal:

--Theme design was easier than I thought--
The site has a custom theme, based on bluemarine. For a start I changed bluemarine's tables to floated divs, and then tweaked almost every style. I found the bluemarine stylesheet very user-friendly to work from.

There's a lot that can be changed with the stylesheet, but I soon found myself looking further - at the template files - to see what else I could change. I'm more a designer than a developer, but with some help I got into the php templates and made some simple changes to the site's html structure. As a newbie-developer, I was starting to feel pretty clever! I discovered php-snippets, and with more help I wrote some custom php to list new/fav/recent nodes on the site's front page. The good thing about php template is all the changes to the site are in one directory (mostly in one file), so I felt that the changes I made were lightly done, and easily undone.

--Customised the taxonomy_context module--
Most of our site's users visit the site with a goal in mind, for example with a question about how they can use the software's reports. We customised the taxonomy_context module so our users can refine their browsing. For example, go to Questions and refine the list by clicking Reporting on the filter menu. It also works for other taxonomies, for example Tutorials for project managers.

----------
My contribution to this site had been content and theme development, layout design, html and css.

Styro contributed by designing information structure, drupal installation and maintenance, php coding and refactoring, and customised the taxonomy_context module.

Comments

zumichu’s picture

Hey, cool site. thanks for sharing the information. I'm wondering if your experiences with filtering taxonomy can help me with what I'm trying to do.

I posted a forum topic at:
http://drupal.org/node/54631

So far nobody has helped.

If I could get more info on the changes you made to the taxonomy module and how that it ties in with your theme, that might help me out a lot.

Thank you very much.

styro’s picture

(It doesn't really sound much like what you want to do though)

Our modifcations to taxonomy_context don't show up on the front page anywhere. For the front page we use the front_page module and a bunch of PHP functions we adapted from PHP snippets in the handbook.

We were originally using taxonomy_context for the way it rendered the terms descriptions at the top of the listings. If we were to do this again now we would probably use the Category module and maybe also the Views module for that functionality.

Our changes to the taxonomy_context module were basically:

  • Adding extra fields to the admin/settings/taxonomy_context page so that for each vocabulary, you could choose an optional secondary vocabulary to filter against.
  • Then when viewing a listing from a term in one of those vocabularies, you would get a list of terms from that second vocabulary. That list would just contain link using the form /taxonomy/term/x,y which gets you an intersection set of nodes that are tagged with both terms.

The code is a bit of a ugly hack tailored to this site, and my first attempt at altering a module. I had thoughts of redoing it as a standalone module that created a block, but never got around to it. I think these days with 4.7 I'd probably take a much different approach anyway.

I could post a patch on the web somewhere I suppose, but bear in mind that it would be against an earlier version of taxonomy_context than what is current for 4.6.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal

boris mann’s picture

Could you post your taxonomy_context changes as a patch? It would be much appreciated.

styro’s picture

This patch was taken against 1.36.2.1 (note the funnily named copy I just wgetted from cvs.drupal.org that I ran the diff against). I wasn't sure how to diff the two files any cleaner than that (I don't use cvs).

I see 1.36.2.2 has come out recently with some of the 4.7 goodies backported - I'm not sure the patch will work against that.

If you guys can wait until tomorrow, I'll find a spot on our webserver to post the patch and our version of the file.

(oh yeah, having hierarchical vocabularies will probably cause it some trouble)

--- taxonomy_context.module?rev=1.36.2.1        2006-03-22 17:26:50.781254904 +1200
+++ taxonomy_context.module     2005-09-18 21:01:59.000000000 +1200
@@ -151,6 +151,12 @@
     }
     $term->image = $image;
     $term->links = $links;
+
+    $term->vid = taxonomy_context_get_term_vocab($tid);
+    $term->foreign_vid = variable_get("taxonomy_context_vocab_" . $term->vid . "_filter_term", 0);
+    if (variable_get("taxonomy_context_filter_terms", 0) && $term->foreign_vid) {
+      $term->filters = taxonomy_context_get_filter_list($term);
+    }
     return theme("taxonomy_context_term", $term);
   }
 }
@@ -367,7 +373,7 @@
  */
 function taxonomy_context_vocab_first_child_terms($vid) {
   $terms = array();
-  $result = db_query(db_rewrite_sql("SELECT n.tid FROM {term_hierarchy} t, {term_data} n WHERE t.tid = n.tid AND n.vid = %d AND t.parent = 0 ORDER BY n.weight, n.name"), $vid);
+  $result = db_query(db_rewrite_sql("SELECT td.tid FROM {term_hierarchy} th, {term_data} td WHERE th.tid = td.tid AND td.vid = %d AND th.parent = 0 ORDER BY td.weight, td.name", "term_data", "tid"), $vid);
   while ($term = db_fetch_object($result)) {
     $terms[] = $term->tid;
   }
@@ -464,6 +470,50 @@
   return $output;
 }

+/**
+ * Based on the terms vocabulary, finds the first child terms from the foreign
+ * vocabulary to be used as secondary filters on the taxonomy display page.
+ *
+ * @param $term
+ *   The term object
+ *
+ * @return
+ *   an array of links for secondary filter terms.
+ */
+function taxonomy_context_get_filter_list($term) {
+
+  $filters = array();
+
+  $url_ids = explode('/', str_replace("taxonomy/term/", '', $_GET['q']));
+  $url_terms = explode(',', $url_ids[0], 3);
+
+  if ($term->tid == $url_terms[0]) {
+    if (count($url_terms) == 1) {
+      $filter_term = 0;
+      $filters[0] = "<strong>" . t('All') . "</strong>";
+    }
+    else {
+      $filter_term = $url_terms[1];
+      $filters[0] = l(t('All'), 'taxonomy/term/' . $term->tid);
+    }
+
+    $foreign_term_ids = taxonomy_context_vocab_first_child_terms($term->foreign_vid);
+
+    foreach ($foreign_term_ids as $foreign_tid) {
+      $foreign_term = taxonomy_get_term($foreign_tid);
+      $foreign_term_name = $foreign_term->name;
+      if ($foreign_tid == $filter_term) {
+        $filter_output = "<strong>" . $foreign_term_name . "</strong>";
+      }
+      else {
+        $filter_output = l($foreign_term_name, 'taxonomy/term/' . $term->tid . ',' .$foreign_tid);
+      }
+      array_push($filters, $filter_output);
+    }
+  }
+  return $filters;
+}
+

 /**
  * Hook implementations
@@ -574,6 +624,26 @@
       $nodetypes[$type] = node_invoke($type, 'node_name');
     }
     $output .= form_select(t('Breadcrumb content types'), 'taxonomy_context_breadcrumb_node_types', variable_get('taxonomy_context_breadcrumb_node_types', array('story','page','book')), $nodetypes, t('Which content types should include terms in breadcrumbs?'), 0, 1);
+
+
+  $output .= form_select(
+  t("Enable filtering by foriegn terms"),
+  "taxonomy_context_filter_terms", variable_get("taxonomy_context_filter_terms", 1),
+  array(t("Disabled"), t("Enabled")),
+  t("This enables a filter menu on the taxonomy term view that allows the user to...(finish this description later)"));
+
+  foreach ($vocabs as $vid => $name) {
+    if ($name != 'none') {
+      $varname = "taxonomy_context_vocab_" . $vid . "_filter_term";
+      $output .= form_select(
+        t("Choose the filter vocab for the $name vocab"),
+        $varname, variable_get($varname, 0),
+        $vocabs,
+        t("When viewing a term from the $name vocabulary, this vocabulary will be used for the drill-down filter links."));
+
+    }
+  }
+
   return $output;
 }

@@ -606,11 +676,21 @@
   if ($type != "term") {
     $output .= "   <h2 class=\"title\">" . l($term->name, "taxonomy/term/" . $term->tid) . "</h2>\n";
   }
+
+  if ($term->filters) {
+    $output .= "  <div class=\"filters\">" . theme("item_list", $term->filters, t("Filter by:")) . "</div>\n";
+  }
+
   $output .= "   <div class=\"description\">" . $term->description . "</div>\n";
   $output .= "   <div class=\"links\">" . theme("links", $term->links) . "</div>\n";
   $output .= "  </div>\n";
+
+
   $output .= "</div>\n";
   $output .= "<div class=\"clearit\"></div>\n";
   return $output;
 }
-?>
\ No newline at end of file
+
+
+
+?>


--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal

boris mann’s picture

The right way to post a patch would be to upload it as an issue (a feature request, which you're actually fulfilling with the patch) against the taxonomy_context issue tracker.

The developer may decide to incorporate it directly into the module.

styro’s picture

but decided against it. It wasn't really a taxonomy_context specific feature so much as a general taxonomy add-on, and it wasn't flexible enough for general use.

I was going to rewrite it as a standalone module that used a block for the list, but never got around to it. Hearing about the upcoming Views and Category modules etc, I thought I wait to see how they pan out before taking it much further.

I'll check out the new functionality of taxonomy_context first before ruling out submitting a better patch though :)

Anyway if anyone wants to try this stuff:
http://misc.ilign.com/drupal/taxonomy_context.module
http://misc.ilign.com/drupal/taxonomy_context.patch (taken against 1.36.2.1)
Note: hasn't been tested with hierarchical vocabularies.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal

styro’s picture

Here is an early release of a standalone version of the filtering functionality mentioned in previous comments. No hacks to taxonomy_context required, and although I haven't tested it yet it should work with the taxonomy_context module as well as the core taxonomy module (which I have tested).

http://misc.ilign.com/drupal/taxonomy_filter.module

I should probably go apply for a CVS account...

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal

boris mann’s picture

Nice work...

styro’s picture

I'm quite happy with my first attempt at 4.7 stuff - the forms API looks really powerful.

I've applied for the CVS account :)

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal

sepeck’s picture

That's really nice. About the only thing I would think is on http://knowledge.ilign.com/implementation page. The links on the right sidebar... perhaps alias them with a path if htat owuld be do-able. Kind of a surprise to see the aliases for some and taxonomy3,4 for others.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

styro’s picture

I linked to above does respect url aliases and will use them in the menus if available.

We probably aren't going to do much improvements to the old 4.6 hacks we did - onwards and upwards with 4.7! After it gets released of course :)

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal

sepeck’s picture

That of course makes perfect sense.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

styro’s picture

The taxonomy_filter module is now a contrib module:

http://drupal.org/node/59060

(not sure why the /project/taxonomy_filter alias doesn't work though)

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal

cel4145’s picture

I really like your solution. Nicely done!

Now I'm thinking out loud here, but I could see this approach as extremely useful for the Drupal handbooks. They are now over 1000+ pages, and the book nav TOC and Drupal search engine alone could be enhanced by your solution.

We've been recently starting to tag handbook pages with version numbers. Suppose we also added in a freetagging vocab for keywords. Authors/editors and moderators could work together to supply some keywords for each node.

Then the keyword links on each page would go to the display listing like you have here:

http://knowledge.ilign.com/taxonomy/term/12

If I'm understanding how that module works correctly, the taxonomy_filter module you have created would work great for then filtering that list by Drupal version number.

What do other people think? I could see this as being a giant plus for Drupal handbook usability as long as doc team members will work to maintain some minor consistency with keyword choices.

styro’s picture

I think filtering the handbook pages by Drupal version would be an excellent idea.

But as you're probably already aware, this probably wouldn't be a drop in solution. I'm not 100% on this but I don't think the book module supports this kind of dynamic filtering based on terms yet. I think this is the kind of thing Jeremy's Category module was intended for - ie combining the book and taxonomy type functionality. We're considering using the Category module for a future retrofit of our site for this reason.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal

cel4145’s picture

"I don't think the book module supports this kind of dynamic filtering based on terms yet"

Nope. But puti's taxonomy_filter module used to build the KM solution does. Just guessing, but I think we'd need it to work with the views module to create the same solution.

dmf-1’s picture

Just wanted to leave my thanks for sharing your example knowledgebase and its useful module.

styro’s picture

We've updated the site massively in the last week or two. It's now a combined corporate product brochure type site and knowledge base with a very different look than when this thread started. The old knowledge base site (http://knowledge.ilign.com) is now the support section of the new 'corporate' site (http://ilign.com/support).

Once I get time I'll write up a new showcase post explaining a bit more about it :)

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

dmf-1’s picture

Nice of you to offer an update. I'm personally looking forward to read more of what you share on this topic because I think your implementation is very nice indeed.

styro’s picture

A new larger version of the site is out now, it's not just a knowledge base anymore - here is the updated showcase: http://drupal.org/node/126687

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

onlineguy’s picture

I just visited your site's knowledgebase, the URL for which is apparently now http://ilign.com/support/knowledge_base, and it's nice. I like the way you've organized the page (and presumably the taxonomy behind it).

Since your original post was ~ four years ago, would you consider posting an update about the methods you settled on in Drupal for those of us just starting into this challenge?

Thanks for sharing (sincerely)

styro’s picture

The current site is a bit of a neglected mess at the moment. Lots of old obsolete content has been deleted and quite a few features switched off.

We're in the middle of a large complicated redesign/redevelopment involving a Drupal 6 upgrade, a redesign of the Information Architecture, adding CCK/Views, splitting existing content into multiple node types, switching the community stuff to Organic Groups, migrating just about every contrib module to a different contrib module etc. Organic groups will be used for public user groups, partner blogs, and private customer portals for CRM type stuff. There's also 5 subthemes, and a lot of custom modules tweaking just about everything.

The knowledge base part of the site will be of less importance this time around, and will be simplified. There will be a smaller number of articles. We will be simplifying the taxonomy design - getting rid of some vocabs and shrinking others. We won't be using taxonomy_filter in Drupal 6 despite the substantial work I did rewriting it to make it fully extensible in Drupal 6. Note: taxonomy_filter is in good hands with a new maintainer though - you should still check it out if you want "intersections" between multiple vocabs.

Some lessons:

  • Keep it as simple as possible (this can be quite hard depending on who is calling the shots or the scope of the project)
  • Don't fall into the trap of having more content than your or your team can easily keep up to date
  • People don't use knowledge bases as much as you think they will
  • You have to keep reminding your content creators to find and edit existing content whenever possible instead of creating new content
  • Try to avoid having to implement themes based on intricate PSDs that don't take Drupals architecture into account
  • Only put timeless information into a knowledge base - eg information that always applies and gets overwritten/edited/replaced to keep it up to date. This content should always be written as if it is current NOW. Separate time based content that expires, or will happen in the future, or content that fades out of relevance (eg notices or announcements) out into a different channel like a blog.

The site was first set up with Drupal 4.4 (yikes), and has already been through upgrades to 4.5, 4.6, 4.7 and 5. There is quite a bit of accumulated cruft, and outdated modules. Once we've finished the Drupal 6 upgrade and it has settled down we'll probably do another showcase. The overall goal is to do things in a very Drupal 7 compatible manner, so a future upgrade will hopefully be much smoother.

To be honest though, I think I would've been better off just rebuilding it from scratch in a Python MVC web framework. And I probably will end up doing that some day instead of upgrading to Drupal 8 (or even 7 maybe). The business requirements have got a lot more complex, and it there comes a point where it is easier to just create something custom rather than constantly overriding and altering already existing generic code.