Hello everyone!

I'm having a little issues using taxonomy.

I enjoy the benefits of organising my pages using taxonomy terms, especially the breadcrumbs. However, I don't like the fact that when you visit a 'top-level' term, you get a listing of all the content in that term as an auto-generated page. I would much prefer being able to specify this index page for the taxonomy myself. Is this possible?

For example, I could then replace the 'forum' frontpage with a page created by me. Although the regular index page is great for things like a 'news' page where postings are regularly added, I am wanting to create something a bit more presentable for les-frequently added-to terms, while keeping the benefits of breadcrumbs.

Thanks for your help!!!

Andrew :-)

Comments

agray’s picture

Hi

Maybe I should clarify this - it seems quite simple, but can't think how to do it.

Basically I have a term, for example called 'news'. I have added pages to news, and like the fact that when I am reading the pages added under the news term, I get the breadcrumbs "home >> news" at the top.

what I want is for the news breadcrumb to link to a page of my choosing, not the standard taxonomy index page.

Any ideas?

Thanks

Andrew

yvelle’s picture

Have you tried url aliases? I'm not sure if it will work, but it might.

agray’s picture

Hi

Thanks for the suggestion. I thought about it for a bit, and tried adding an alias from the path to the taxonomy term index page, to the page I want to replace it with, but it didn't seem to work. I don't think it's possible to make a URL alias that does that.

It would be most useful if anyone knows how the downloads page on this site is achieved, because that's what I'm looking for.

e.g. a custom page http://drupal.org/project

that links to content filed under taxonomy terms: http://drupal.org/node/19309

that shows the appropriate breabcrumbs like Home » projects » Modules

and the breadcrumbs (''projects' in this example) links back to the custom page, not the generic taxonomy page.

That's what I'm hoping to replicate - any more ideas?

Cheers

Andrew

ultimate_fish’s picture

Hi, I'm wanting to do exactly the same thing and I can't work out how to do it either.

I love the crumbtrail navigation of drupal and the taxonomy system is really powerful, but like Andrew I want to be able to build an index for each taxonomy term.

Ideally these indexes would comprise some static content for navigation but also maybe the latest two or three articles posted in that taxonomy term.

Bit of a drupal newbie here, so I really don't know how to achieve this.

agray’s picture

good to know someone else is having trouble!

Is it possible to get in touch with the developers of this site?

sepeck’s picture

-sp
---------
Test sites and good habits: Drupal Best Practices Guide.
Misc Black Mountain

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

sepeck’s picture

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

ultimate_fish’s picture

alrighty then.... Can you give some instructions using words of one syllable, or less, on how we might achieve this ;)

dkaragiozov’s picture

Recently I had a small figth with the taxonomy, nodes, and URL aliases, so I made it work for me...

You can create a home page or use the front_page module and create the following url alias:

system_path: node/XXX (or just front_page)
alias: taxonomy/term/1 (replace 1 with the top-term in the vocabulary)

Hope, this will help!

Diman Karagiozov
Tetracom IS Ltd.
http://www.tetracom.com

venkat-rk’s picture

An index page for a taxonomy vocabulary is not available as of today.

Please read Jeremy Epstein's posting here (http://drupal.org/node/20836#comment-49208) for a better understanding of this issue and also his proposed cateogry module that seeks to remedy this problem:
http://drupal.org/node/23730

peterx’s picture

I have a structured site with each term pointing to a page and each page listing the pages under it. I used taxonomy_menu and taxonomy_multi_edit to add the menu. I then added code to a block to list the entries under the current page.

The code shown here is added after the code shown in http://drupal.org/node/28688. The result is a page of text then a list of the page summaries for the pages below the current page.

I added the following code to my .theme file. The code selects the node ids from the database so that they can be sorted by title. you can change the sort and add other selection criteria.

$url_node = $_GET['q'];
$url_alias = drupal_get_path_alias($_GET['q']) . '/';
$url_map = drupal_get_path_map();
$selected_nodes = array();
foreach($url_map as $url_key => $url_value)
	{
	if(substr($url_key, 0, strlen($url_alias)) == $url_alias)
		{
		$url_remainder = substr($url_key, strlen($url_alias));
		if(strpos($url_remainder, '/') === false)
			{
			$value_parts = explode('/', $url_value);
			if($value_parts[0] == 'node')
				{
				$selected_nodes[] = $value_parts[1];
				}
			else
				{
				$output .= 'Alias: ' . $url_key . ', system: ' . $url_value . '<br />';
				}
			}
		}
	}
if(count($selected_nodes) > 0)
	{
	$node_ids = db_query(db_rewrite_sql(
		'select n.nid from {node} n'
		. ' where n.nid in(' . implode(', ', $selected_nodes) . ')'
		. ' order by n.title'));
	while($node_1 = db_fetch_object($node_ids))
		{
		$output .= node_view(node_load(array('nid' => $node_1->nid)), 1);
		}
	}
styro’s picture

The taxonomy assoc menu in cvs sounds like it does what you want (I haven't tried it yet myself).

What we've done along similar lines is to use the taxonomy_context module, and put the 'static' content for that term in the terms description. The HTML content we put in the description (including links to node we think are important etc) is then shown above the node listings.

You can also use the sticky attribute to keep certain nodes at the top of the taxonomy listings.

Jaza’s picture

In answer to some of your questions, andrew:

  1. I agree with the advice already given in this thread, to try both the taxonomy_assoc and the taxonomy_context modules. These two modules are your only hope if you wish to treat some of your categories as an 'index page', and put some descriptive content in them. Taxonomy_context is the 'lighter' option, as it just displays a plain-text description with a term. Taxonomy_assoc is suitable if plain text is not enough, i.e. if you need to embed an actual node on a category page. I wrote taxonomy_assoc because the 'lighter' option wasn't enough for my needs :-).
  2. Getting the node listing for a term's page to display in a 'custom' way is not easily done. The 'downloads' page on drupal.org is actually generated by the project module, not the taxonomy module (although I think project.module still uses taxonomy terms under the surface). This is how they got it to look different to a regular node listing. There are some modules out there for custom display of node listings, e.g. the article module, but taxonomy itself doesn't let you customise a node listing. You could also try experimenting with your theme - you might be able to theme a particular set of terms differently, but I don't know how.
  3. Also, play around with the optional 'depth' argument you can put on taxonomy terms. E.g. taxonomy/term/7/3 will list all nodes tagged with term 7, and all nodes tagged with children of term 7, to a depth of 3 (default depth is 0). By specifying a depth, and perhaps aliasing the depth-specific URL, you might be able to get an empty listing. Unfortunately, you can't specify a depth of -1, so this makes it a bit harder.

Jeremy Epstein - GreenAsh

Jeremy Epstein - GreenAsh

peterx’s picture

Taxonomy_assoc sounds good. I did not find it or anything that sounds like it in the modules download page which is why I built my own code to do the same in my theme. I am happy to replace my code with a standard module.

Could Taxonomy_assoc be modified to add a node to the vocabulary page?

Jaza’s picture

You can download taxonomy_assoc here. The latest release is for 4.5 (which is why it doesn't appear on the standard downloads page), but this release has been tested to work on 4.6 as well.

Taxonomy_assoc cannot be modified to add a node to a vocabulary page, because there are no vocabulary pages.

Jeremy Epstein - GreenAsh

Jeremy Epstein - GreenAsh

peterx’s picture

I installed taxonomy_menu to get terms in to the menu. taxonomy_menu adds the vocabulary as the top level term in the menu structure. If I have vocabulary hardware and vocabulary software, hardware and software appear as the top entries in the menu.

I added table vocabulary_node to define a node for the top level entry.

peterx’s picture

http://drupal.org/node/19806 does not have a download link. Found the download at http://drupal.org/project/Modules/4.5.

The module installed. I see taxonomy_assoc field in input type configure. I did not turn the field on because I will not start out using [assoc] in nodes.

I found the administer > taxonomy associations form and the taxonomy association selection list in the content edit. Will start testing it.