Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm wondering if there is a possibility of some kind of conditional part of a token.
Example:
CCK field how_many
Title preset [title-raw]-[how-many]-[singular[how-many]:book][plural[how-many]:books]
or
Title preset [title-raw]-[how-many]-book[plural[how-many]:s]
Maybe we should talk about tokens and conditions in a different place, maybe in a different layer, above module... but I'm sure that this support here would be very helpfull.
Comments
Comment #1
bomarmonk CreditAttribution: bomarmonk commentedYou can do this with custom theming but your suggestion would make achieving this much easier.
Comment #2
hefox CreditAttribution: hefox commentedIf someone makes a patch for that, It would also be nice to have [if exists[token] ]. Often I want to include all fields that may be blank, and while can do php it gets annoying.
Comment #3
asb CreditAttribution: asb commented+
Comment #4
Tino CreditAttribution: Tino commentedI would also be very interested in simular functionality.
In my case at hand, I would like to put the word "and" in between two CCK fields, but only if the second field has a value.
E.g.: [field_date1-view] and [field_date2-view]
If there is a solution possible already, I would really appreciate a hint.
Comment #5
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs for DrupalFit commented