Need to use PHP conditional content

I have a special use case that I’d appreciate some help with.

I have some content that I want to include in Page Builder that is conditional using PHP to determine if it should be displayed or not. The content is a Beaver Builder callout. So essentially, if a certain condition exists, then I want to show the callout. If it doesn’t exist, then I don’t want to show the callout.

I have the code so I don’t need help with that. I just need help figuring out how to use it within Beaver Builder using the Callout content type.

The only thing I can think of right now is to put the callout into Page Builder and then copy the html associated with that callout. Then go back into Page Builder, delete the callout, and paste the code into the HTML content type along with the PHP conditional statement.

Can you think of any other way to do this? I know it’s a special case and not common.

Hi Lloyd,

The issue I see with doing this is that PHP pasted into the builder isn’t parsed for security reasons. Would work for you to hide the callout with CSS and then show it with a conditional JavaScript statement?

Alternatively, you could create a custom module, but I’m guessing that might be overkill for this situation. If not, that’s worth a shot.

Justin