I have created a context with a "Taxonomy term" condition set to the vocabulary I want the reaction "Blocks" to display a block on the taxonomy term page, "taxonomy/term/myterm". However it seems that the "Taxonomy term" condition is never checked or called in code to check.
Not sure whats going on here but for the immediate time I have set the a path condition instead.

CommentFileSizeAuthor
noshowsblockfortaxonomy.png53.4 KBdialn

Comments

marco_cruz’s picture

Same problem here...

kortas87’s picture

you should use 7.x-3.x-dev (2012-Feb-03). I think there was problem with getting node terms in context_condition_node_taxonomy.inc

not working (7.x-3.0-beta2 2011-Sep-09)

if (isset($node->{$field}[$node->language])) {
          foreach ($node->{$field}[$node->language] as $term) {

WORKING (7.x-3.x-dev 2012-Feb-03)

if ($terms = field_get_items('node', $node, $field)) {
          foreach ($terms as $term) {
benshell’s picture

The taxonomy term condition is still broken in 7.x-3.x-dev 2012-Apr-02. The execute method in context_condition_taxonomy_term is never even run. Kortas87, I think you're referring to the Taxonomy condition, rather than the Taxonomy Term condition. I haven't tested to see whether or not that works now in dev, but I assume it does because I see the code you mentioned has been fixed.

Anonymous’s picture

Version: 7.x-3.0-beta2 » 7.x-3.x-dev
Status: Active » Closed (works as designed)

I have created a context with a "Taxonomy term"

The screenshot shows a "Taxonomy" condition, not "Taxonomy term".

You maybe missunderstand these two conditions. I'm actually here, because I think I made the same mistake and thought the "Taxonomy" condition would react on taxonomy term pages, but it doesn't - by design!

  • The "Taxonomy" condition is meant for nodes assigned to a certain "Taxonomy term", but not for the taxonomy term page (i.e. taxonomy/term/[termId]). The config page states that quite clearly: "Set this context when viewing a node with the selected taxonomy terms".
  • The "Taxonomy term" condition seems to be meant for the taxonomy term pages, but unfortunately makes its decision solely on the vocabulary (thus doesn't allow to select a specific term).

I've tested both types of conditions and can verify they are working well in 7.x-3.0-dev. So I'm setting the issue status to "works as designed".

Feature request posted: #1553012: Taxonomy term condition should allow for matching on term-level

samireez’s picture

I have been trying to show a block via context if a given node has a taxonomy term X. I was using the Taxonomy condition ("Set this context when viewing a node with the selected taxonomy terms.") but the condition would not successfully run. I have Context 7.x-3.0-beta2

I would like to confirm that the code outlined by kortas87 in #2 above works fine. I've only edited the plugins/context_condition_node_taxonomy.inc (inside the execute function). Once the edit is in place, the context seems to be working fine - even when a node has more then one term in a given vocabulary, context seems to match the condition properly.

steinmb’s picture

Title: Context condition "Taxonomy term" is never loaded on a taxonomy term page. » Taxonomy term should support more then only nodes entities
Category: bug » feature
Status: Closed (works as designed) » Active

New title, moving to feature req. We are able to tag terms with terms from other vocabulary so this should work with other entities then nodes. +1 from me to get this into context.

hixster’s picture

Is there any news on this? The ability to derive context on taxonomy term pages and not just nodes is crucial for large taxonomy based projects.