Hi,

This is a feature request not a bug. This is an awesome module for taxonomy driven architectures and I was wondering if it would be possible to allow multiple terms to be selected per block.

Use case: I have created this promotion block and I want it to be shown on nodes tagged with term 1, term 2, term 3.

Ta!

P.S. I have tried to trick the autocomplete into saving more than one term, but that doesn't work :).

Comments

HeikeT created an issue. See original summary.

heiket’s picture

P.P.S. ... and we have looked into block visibility groups, but this adds too much complexity. Multiple terms is all that is needed :).

danielveza’s picture

Got a patch that is currently in internal testing that should fix this and allow for multiple behaviour.

Will post in the next day after I've done some clean ups + comments etc.

danielveza’s picture

StatusFileSize
new2.38 KB

Finally had some time to get back to this!

Attached is a patch that allows for the multiple terms behaviour. Code reviews + testing would be great!

danielveza’s picture

StatusFileSize
new2.45 KB

Fixing an undefined index issue found in some testing,

mlncn’s picture

Status: Active » Needs review

Definitely wanted! Marking needs review.

danielveza’s picture

Just an FYI - We have used this patch in our distribution and multiple sites with no issues.

jastraat’s picture

We are also using this patch. It works to allow multiple taxonomy terms.

However - there is another issue. When we have multiple taxonomy terms, we run into the following:

"Select a taxonomy terms(s) cannot be longer than 128 characters but is currently 129 characters long."

Multiple taxonomy terms can have a significant length. Would another field type (perhaps a listbox?) make more sense?

danielveza’s picture

I'm trying to take over maintainership of this module at the moment. When approved this is one of the patches I'll be committing. At the same time I'll look at raising the amount of characters allowed or maybe changing field type.

Alternatively for now, maybe use another hidden vocab to achieve the same purpose with smaller terms?

mlncn’s picture

DanielVeza, do you have an official request open to be a maintainer? If not add your name to https://www.drupal.org/project/term_condition/issues/3046649 maybe? If the maintainer is unresponsive it helps to have a public timeline of requests.

danielveza’s picture

I do yep - I should be getting maintainership soon.

https://www.drupal.org/project/projectownership/issues/3014619

danielveza’s picture

StatusFileSize
new4.61 KB

New patch - Uses DI properly and makes things a little cleaner. I've tested on my local. I'll give others a day or two to test and mark RTBC, otherwise I'll commit after that!

Thanks all.

  • DanielVeza committed fbecac5 on 8.x-1.x
    Issue #2948550 by DanielVeza, HeikeT, jastraat, raccinggrinner: Allow...

danielveza’s picture

Thanks all for your help. Seems the credit didn't come through for some reason.. :(

Attempting to give credit in this comment.

EDIT: Looks like it has come through now.

danielveza’s picture

Status: Needs review » Fixed

Regardless - This is fixed now. Thanks all for the help and testing.

New release should be coming out in the next ~2 weeks. Once I've sorted the rest of the issues in the queue.

Status: Fixed » Closed (fixed)

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