# Dynamically rendering dynamically rendered pages

**URL:** <https://forums.concretecms.org/t/dynamically-rendering-dynamically-rendered-pages/6506>\
**Category:** Developing with Concrete\
**Created:** [November 14, 2023, 12:52am UTC](https://forums.concretecms.org/t/dynamically-rendering-dynamically-rendered-pages/6506 "2023-11-14T00:52:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbuerer](https://forums.concretecms.org/user_avatar/forums.concretecms.org/dbuerer/32/5178_2.png) [@dbuerer](https://forums.concretecms.org/u/dbuerer)\
**Post date:** [November 14, 2023, 12:52am UTC](https://forums.concretecms.org/t/dynamically-rendering-dynamically-rendered-pages/6506/1 "2023-11-14T00:52:37Z")

</div>

Looking for advice…and a question.

My question: Is there a way to intercept the html, from a controller, before it is fully sent to the browser? Ex: After all containers, blocks, etc. are rendered.

Background…i have page templates which are used in page types. Users, using the “output” option can modify how the pages render and what content is included. I generate one apartment container/section for each apartments that is assigned to that page. Everytime the page is loaded, i need to validate that apartment has a container, if not, create one. If an apartment has been removed from the property, i need to remove it from the patch.

The catch is that i need the page to be fully in-place editable after it’s rendered so that people can make changes to it on the fly.

So basically i want to intercept the page, add/remove containers/blocks as needed, then render it.

Any recommended approaches?

---

<div class="post-metadata">

**Author:** ![JohntheFish](https://forums.concretecms.org/user_avatar/forums.concretecms.org/johnthefish/32/3767_2.png) [@JohntheFish](https://forums.concretecms.org/u/JohntheFish)\
**Post date:** [November 14, 2023, 9:34am UTC](https://forums.concretecms.org/t/dynamically-rendering-dynamically-rendered-pages/6506/2 "2023-11-14T09:34:15Z")

</div>

You may be able to do something by handling and responding to events

> **[Full Event List](https://documentation.concretecms.org/developers/framework/application-events/full-event-list)**
>
> View a full list of events available to concrete5 developers.

Another option would be to override or extend the Area class. This class loops through and outputs the blocks in an area.

If you have a bespoke theme, declare and ExtendedArea class which extends the Area class. Then in the page templates, use the ExtendedArea class for the Main area of the theme templates.

That would provide a point at which you can intercept and modify the way blocks are output to whatever extent you like.

---

<div class="post-metadata">

**Author:** ![dbuerer](https://forums.concretecms.org/user_avatar/forums.concretecms.org/dbuerer/32/5178_2.png) [@dbuerer](https://forums.concretecms.org/u/dbuerer)\
**Post date:** [November 15, 2023, 3:07am UTC](https://forums.concretecms.org/t/dynamically-rendering-dynamically-rendered-pages/6506/3 "2023-11-15T03:07:41Z")

</div>

John those are great ideas Let me think about that.
