[development] taxonomy terms as view field

Nancy Wichmann nan_wich at bellsouth.net
Thu Oct 1 21:30:39 UTC 2009


Are you sure you need a view? Would taxonomy_menu, taxonomy_directory, or
taxonomy_list handle your need?

Nancy E. Wichmann, PMP
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King,
Jr.


-----Original Message-----
From: development-bounces at drupal.org
[mailto:development-bounces at drupal.org]On Behalf Of Jeff Greenberg
Sent: Thursday, October 01, 2009 10:50 AM
To: development at drupal.org
Subject: [development] taxonomy terms as view field


I'm having a devil of a time. I need to replace the Ubercart catalog
page with my own. They don't use a template, so I've created a view and
will just change my menu links to suit (cat instead of catalog). The
title of the page needs to be the taxonomy term of the product. There's
no setting for that in view. So I will have the taxonomy term as a field
that isn't displayed, and grab it in the template and use it for the title.


The first problem is that Taxonomy Term as a field choice does not all
specifying a vocabulary ID. The product's brand is a vocabulary, and so
is the catalog, so I can't specify that the field be taxonomy term,
because what I get back is unpredictable.


So I made it All Taxonomy Terms, which -does- let me specify the
vocabulary. The trouble there, is that with a hierarchical vocabulary,
even though there is only one term selected when creating the node, all
parent terms are returned in the term field. Ok, so I'll just use the
final term in the template for the title.


What happens is that in the live preview for the page, the taxonomy
terms are listed. But when I dump $row in the template
(views-view-fields--viewname--page.tpl.php) the row contains the other
fields, but not the taxonomy terms field?!


No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.14.0/2406 - Release Date: 10/01/09
06:34:00



More information about the development mailing list