# Wrapping a Container with PHP code

**URL:** <https://forums.realmacsoftware.com/t/wrapping-a-container-with-php-code/44125>\
**Category:** RapidWeaver Elements\
**Created:** [August 6, 2024, 5:25pm UTC](https://forums.realmacsoftware.com/t/wrapping-a-container-with-php-code/44125 "2024-08-06T17:25:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [August 6, 2024, 5:25pm UTC](https://forums.realmacsoftware.com/t/wrapping-a-container-with-php-code/44125/1 "2024-08-06T17:25:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ben](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ben/32/28488_2.png) [@ben](https://forums.realmacsoftware.com/u/ben)\
**Post date:** [August 6, 2024, 7:01pm UTC](https://forums.realmacsoftware.com/t/wrapping-a-container-with-php-code/44125/2 "2024-08-06T19:01:38Z")

</div>

It is possible 😃

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

---

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [August 6, 2024, 7:47pm UTC](https://forums.realmacsoftware.com/t/wrapping-a-container-with-php-code/44125/3 "2024-08-06T19:47:28Z")

</div>

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

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

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. 🙂

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. 😀

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [August 6, 2024, 11:05pm UTC](https://forums.realmacsoftware.com/t/wrapping-a-container-with-php-code/44125/4 "2024-08-06T23:05:42Z")

</div>

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

> [@logrunner](#):
>
> 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.

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

> [@logrunner](#):
>
> 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?

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

> [@logrunner](#):
>
> This is really great stuff and hopefully make it a lot easier to develop powerful functions for websites. 😀

Yes, we hope so!
