0

Currently I want to output the taxonomy term of the current node I'm viewing. I have an Article content type and I created a view block placed it in the footer. Now in this view I'm using PHP Field and I want to output the taxonomy terms on the current page. Right now I know menu_get_object() can get you the node ID of the page, but I'm not sure how would one get the taxonomy terms of the current page?

I was thinking of doing a node_load() on the nid of the page and then parse the taxonomy array then fetch the TID then do another function to grab the Taxonomy name. Any other easier way of doing this?

1 Answer 1

4

You don't need php field for this.

On the right side click on Advanced, under RELATIONSHIPS add "Content: Taxonomy terms on node".

On the left side add a new field. Search for taxonomy and you should see a Taxonomy term name field that is now available thanks to the relationship.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.