By andrew_hoffi on
I'm trying to pull the first term from a nodes terms, however I'm having trouble getting around the need to know the Terms TID. Using the following code I get the result, but the number represents the TID, which is going to fall over the moment I dont know what the term is.
print $node->taxonomy[1]->name;
I'm going to use the term as an argument for a view i've created and need to create the link for this using the term name.
Any help would be appreciated.
Comments
How about if (
How about
I've played around with the
I've played around with the code, but it doesn't seem to work for me. I think the problem I have is referencing the array with a number and not "taxonomy_term_1" here's what I have to play with:
Thanks
Andrew
-------------------
www.hoffi.com
That looks like $taxonomy,
That looks like $taxonomy, not $node->taxonomy. Which are you using?
Appologies your correct I
Appologies you are correct I should be using $node->taxonomy. I managed to solve the problem following the code suggestion you gave.
Thanks
Andrew
-------------------
www.hoffi.com
I got error with this line:
I got error with this line:
This line is working for me: