Thanks for creating your module. I am using it to provide an extra field for a category term. There is currently a description field but I wanted a shorter description field to use as teaser text. The shorter description is shown on the term's parent taxonomy list page. This module works great for this. However, I am clueless as to how to call my new fields variable. Right now I am using a database query to get that field data, but I was wondering if you could provide an example of how to print the fields value using the variable associated with it.
My structure is like this
home/vocabulary/category/term - Shows full description field data
home/vocabulary/category - Shows teaser description field data for each child terms
I am using this query to get the data right now. If I had multiple fields, I would make it WHERE tid = $category->tid AND field = 'teaser_description', but I don't need that yet:
$sql = "SELECT value FROM taxonomy_enhancer_data WHERE tid = '" . $category->tid . "'";
$output .= db_result(db_query($sql));
Is there a way to just call a variable like this:
$output .= $category->teaser_description;
or
$output .= taxonomy_enhancer_extend_term($category->tid);
Comments
Comment #1
nicholasthompsonI'm glad the module is working for you!
The way I use this is as follow...
I usually use this in conjunction with the Views module. I then override the view for taxonomy/term and then I override that view's theme in template.php. Once overriden, one of the arguments passed into the view is $args. I then run this...
Then later on I can access all the values in the $term object... For example:
The extend term function takes the term as a referenced argument and adds on all fields that are associated with that term based on the terms vocabulary and the taxonomy_enhancer settings FOR that vocabulary.
I hope this helps - if not, please reply back and I'll post a more thorough example.
Comment #2
nicholasthompsonComment #3
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.