Please add to Element Conditions: PHP Function Returns True

While the team is gathering feedback about the new Element Condition feature, please add the condition where a PHP function returns true. This would allow us to run our own query to determine if an element should show or not. Thank you.

3 Likes

Yes indeed.
I tried few things including the Advanced “Output php function” but, nothing works as I wanted.

It would be great to allow us to put custom functions with parameters, ex:

myfunction({post_id})

And dynamic results ex :

myotherfunction({arg})
1 Like

You can do this with the echo dynamic tag.

For eg, checking if we’re on the front page…

You can also use with a custom function with parameters…

{echo:my_function('some_arg')}
6 Likes

Ahh, thanks I didn’t get the {echo} thing… my bad. :see_no_evil:
It’s great then ! :slight_smile:

This is great, and not at all intuitive, and makes me wish that Bricks had a more comprehensive Docs area with user contributed notes.

Thanks @wplit !

1 Like