Hi,

I've been playing around with adding Taxonomy terms as selection rules, but I can't get it working. Panels just seems to ignore the term selection rule.

Setup:
- Taxonomy List 'Category'
- Node type 'Item' has a taxonomy select list containing the terms of 'Category'
- VARIANT 1 --> IF Node Type = 'Item' && Taxonomy Category term is NOT('test')
- VARIANT 2 --> IF Node Type = 'Item' && Taxonomy Category term is 'test'
- All criteria must pass

The node type rule does work, too bad the term rule doesn't. Panels always chooses the first variant (so if variant 2 would be first in order, it selects variant 2), that's why I think Panels ignores this rule... I tried almost everything to get the term selection rule working... Term from node, Multiple terms, term from parent, ....

Anyone has a fix or knows a workaround?

Comments

merlinofchaos’s picture

Well, for one, I'd reverse the order; it's always best to have the strictest rule first. == value is stricter than != value.

For two, are you 100% sure that the term is the term you think it is? Are there other terms that could possibly match in the autocomplete, so perhaps it's testing against a term in a different vocabulary by mistake? Or that the context is filled with the proper term? (Showing the term in a title or custom context via keywords can verify the actual data).

Anonymous’s picture

Thanks for your reply!

I've tried several times, also with different order, but still no luck. Anyway, I'll take that into account!

Secondly, the list is limited to pre-defined terms, so Panels gives me checkboxes to select the term I want.

And then, at last: breakthrough! I threw in the term in the node title as you suggested (both name & id), but is seems it doesn't contain anything at all...

Anonymous’s picture

Title: Selection Rule ignores taxonomy term input » 'Term from node' not populated
merlinofchaos’s picture

Are you sure that the term from node relationship is configured for the correct vocabulary?

Anonymous’s picture

Yes.

Just a quick thought: the content type is made by using a CCK Taxonomy Field (which isn't the same as relating a taxonomy list to a type through the taxonomy interface). Maybe this is the reason it cannot find any populated term?

merlinofchaos’s picture

That could very well be the problem; the relationship probably can't see the CCK Taxonomy stuff. I'm not sure there's a solution here as I doubt anyone has written a relationship for CCK Taxonomy. :/

So the only solution may be to write that relationship.

Anonymous’s picture

Darn. It's strange no one else noticed this..

As a workaround for writing a new relationship: could it be possible to create a PHP selection rule which fetches the cck taxonomy value and then makes the check? If so: can you please provide me this code snippet? (i'm not a coder, but i do understand what's going on when looking AT code)

Anonymous’s picture

Assigned: Unassigned »
Status: Active » Fixed

Hi,

after some searching here at drupal.org, I found this:
http://drupal.org/node/574048#comment-2027896

Creating the new directories including the .inc file, and then appending the code into a custom module instead of modifying another one solved it.

It may be useful to include this in Panels or Content Taxonomy by default.

Thanks!

merlinofchaos’s picture

That should go in content taxonomy.

However, some module authors are uninterested in Panels integration.

If that turns out to be the case, maybe the maintainer of the Panels Extras module would be willing to adopt it? I can't say for sure, and I shouldn't speak for him, but it might be worth suggesting.

Status: Fixed » Closed (fixed)
Issue tags: -taxonomy, -panels, -term, -ignore, -selection rule

Automatically closed -- issue fixed for 2 weeks with no activity.