I've looked around for a good while to see if there is a way to accomplish this but it looks like it is a rather unique proposal.
Basically the idea is that I have my primary links which is the standard primary links navigation and then the secondary links which is populated with the terms present in all the nodes on the page.

That might sound a bit confusing so I'll try to sum it up through a diagram. For examples sake the Primary and Secondary links are as follows:

Primary Links: 1 2 3 4 5
Secondary Links: a b c d e f (these are based off terms within 2 categories, one a regular pick and choose category and the other a free tagging category)

------------------------------------------------------------------------------

Example 1:

1 2 3 4 5
|
|
a b c d

In this example 1 is the frontpage, the secondary links are those terms which are present in the nodes on the frontpage. A maximum amount of terms would be needed to stop the list from getting too big because of the free tagging. The list ideally, would be sorted in descending order from most present term throughout the page to least present (eg. the term 'a' is present in 5 nodes within the page so is at the start of the list while 'b' is present only 3 times and so is shown after 'a', etc).

------------------------------------------------------------------------------

Example 2:

1 2 3 4 5
|
|
b d e f

In this second example we are on the page listing for term 2. This is a standard taxonomy view for a term. The secondary links work the same as in Example 1. For this page though, the secondary links would need to automatically link not to the page listing for the term as usual, but to 'taxonomy/term/2,d'.

------------------------------------------------------------------------------

Example 3:

1 2 3 4 5

a b d

In the last example we are on a node page. No menu links are active because the node has multiple terms. Again this is standard Drupal behavior. The difference here is that the secondary links still show and again are based on the same behavior as the first two examples, in this case listing all the terms assigned to just the one node. The links for the terms will act normally and link to the page listing for the term.

------------------------------------------------------------------------------

Hopefully all the examples gives you a fair understanding of what I am hoping to accomplish. It must seem I'm asking a lot and I probably am but I think it would be really great if someone could come to the rescue on this one.

I know some code that I took from elsewhere that does some of these things separately and slightly differently.

			  <?php
               $vid = 5; /* vocabulary 5 = Tags */
               $result = db_query("SELECT t.tid, t.name FROM {term_data} t, {term_node} r WHERE r.tid = t.tid AND r.nid = %d AND t.vid = %d ORDER BY weight, name", array($node->nid, $vid));
               while ($term = db_fetch_object($result)) {
                 $tags[] = l(t($term->name), 'taxonomy/term/' . $term->tid);
                 }
               if ($tags) {
                 print t("Tags") . ": " . implode(' | ', $tags);
               }
			  ?> 

This accomplishes half of what is needed for Example 3 by showing terms from a certain category when on a node page. I'm not sure how useful this would be when trying to get everything else going though.

The 'Refine by taxonomy' module (http://drupal.org/project/refine_by_taxo) also partially accomplishes what needs to be done (or at least is a step in the right direction). The module automatically refines the taxonomy listing similar to what is needed in Example 2.

So I know at least some parts of what needs to be done is around, albeit in different forms, so it must be able to be done. Unfortunately I haven't a clue when it comes to coding which is why I'm asking here.

Please if anyone can help it would be greatly appreciated.

Comments

MediaMunkey’s picture

I've been thinking about the different elements that are needed for this set up and the one that I'm most interested in is simply displaying a list of terms on the page. Surely it can't be that difficult to implement? Yet I have not seen a snippet that does this anywhere. In fact in all my searches I haven't come across anyone looking for a solution to this problem let alone having the solution. Is it just me or is this strange? Am I the only one who wants a list of terms present on a page?

The code I posted above seems so close to the solution yet it in reality it isn't what is needed at all by the looks of it (remember I'm not a programmer). It does what I want when on a node page, listing the terms in a certain category for that node. I just need it to go one step further and list all the terms on a page with multiple nodes. If someone was able to do just this it would be a huge step in the direction I'm looking.

Also I've noticed the function taxonomy_node_get_terms_by_vocabulary will do what I want for individual nodes but again implementing this into a page with multiple nodes is something different. Thought I'd throw it out there anyway.