Embedding a window in another window

I was wondering if theres a way of embedding a window in another window. I understand there are templates that serve this purpose, but templates have restrictions I find it hard to work around.

I have a window that currently pops open when the user clicks a button, but I believe it’d be more useful embedded in the page, similar to the way a template can be. Is there a way of doing this, or are my only options templates and popups?

You could use a container that covers all or part of the window and then toggle it’s visibility when you need it.

In what way are templates more restricted than windows?

We often use templates instead of windows because of the added reusability and options like scaling. It’s only wrapped in a slim window to give make it possible to open.

Please explain your use case, so we can give alternatives.