Wrapping a Container with PHP code

Is it possible (or will it be) to have a custom HTML component (or similar) that contains a drop zone so that other components can be dropped into it. I want to have PHP code that does an if statement and if true renders the dropped in components otherwise not.

I have tested the concept in a basic fashion by having one custom HTML component doing the if statement and another HTML component, following the “dropped in” components, ending the if. The concept works.

It is possible :smiley:

Just add @dropzone("content") to your custom component’s template.

1 Like

Ah yes, I recall that being mentioned in one of the videos - Thanks. :slightly_smiling_face:

btw - the code above didn’t work until I corrected the quotation marks. :wink:

Corrected code: @dropzone("content") - just in case anyone else copies it.

PS. If it would be possible to ship a quick update for the php code issue, that would be helpful as I have to keep on editing the published pages to get PHP to work. Completely understand if it has to slot in with every thing else. :slightly_smiling_face:

Separate question, should PHP code execute in the WYSIWYG window i.e. so that I would see the result of the the PHP code logic?

This is really great stuff and hopefully make it a lot easier to develop powerful functions for websites. :grinning:

Great feedback, and it sounds like you are doing some interesting stuff!

We’ll try to get to this one fixed as soon as possible!

Sorry, PHP code does not render in the editor, it needs to be previewed in the Browser.

Yes, we hope so!