Replies: 2 comments 7 replies
-
Using object templates as conditions still feels like an anti-pattern. (It's mushy, error-prone, and has unbounded performance implications.) The Condition Builder was created to eliminate the need for this practice in the first place! That said, for better or worse, it's a common practice in the Craft ecosystem now. If we decide it's too late to be idealistic about this, I would at least reach for expressions rather than parsed templates, a la Symfony Expression Language. |
Beta Was this translation helpful? Give feedback.
-
Really needed this today – would be amazing if it happened 🙂 I do get @michaelrog's point, but IMO I don't really see how object template support in conditions would be any more of a worry than having it in something like URI or title formats 🤷 |
Beta Was this translation helpful? Give feedback.
-
The recent addition of a Twig template option which outputs a related element ID dynamically for relational condition rules is great!
Would it be possible to have a Twig template option that evaluates to
true
orfalse
in conditionals?I think the existing rules cover a lot (certainly the most common) of use cases, but a condition based on a dynamic boolean value from a twig template would open up possibilities for some crazy stuff. And I mean that in a good way 🙂
Beta Was this translation helpful? Give feedback.
All reactions