Next.js Discord

Discord Forum

Flexible Layout for embeded content in iframe

Unanswered
Giant Angora posted this in #help-forum
Open in Discord
Avatar
Giant AngoraOP
We need an implementation idea of our goal.
Goal:
We would like to have a website that looks different when it is used in iframe (whitelabel the page)

We currently have a route parameter /embed/, but dublicate the whole application pages in this folder seems like to be a mess.
Our second approach was that we have a internal rewrite that we point to same page but in Layout we decide if the content is embed or displayed normal. Since usePathParams are client side only, this solution causes a flickering

We thought about route interception aswell but we could not make it work.

Any other thoughts of "How to handle the layout change when page is shown as iframe"?

0 Replies