Replies: 2 comments
|
Hi! I would like to work on adding dynamic variable interpolation for IFRAME widget URLs. Could you please assign this issue to me? |
0 replies
|
FYI, the workaround we ended up using was - the iframe widget points to an app-served html page hosted on the Twenty domain itself. Being same-origin, it can read the parent page's URL to grab the current record id, then a helper function resolves that to the external id and redirects the frame to the embed url with it - rendering the right customized record. @xNima-Dev |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Use case
We embed an external per-account analytics dashboard on Company record pages via the IFRAME page-layout widget. The external dashboard accepts the account as a URL parameter (
https://external.example.com/embed?companyId=…). Today the widget URL is fully static, so every company record shows the same dashboard — the user must search for the account inside the embedded view on every record they open.What we verified (Twenty Cloud 2.x, July 2026 + current
main)?companyId={{record.companyId}}) is not interpolated — it is passed through literally to the iframe. On currentmain, the iframe widget configuration is just{ url }(packages/twenty-server/src/engine/metadata-modules/page-layout-widget/dtos/iframe-configuration.dto.ts) andIframeWidget.tsxrendersconfiguration.urlunchanged viagetSafeUrl, with no record context and nopostMessagebridge to the embedded page.allow-same-origin(packages/twenty-front-component-renderer/src/host/utils/sanitizeIframeSandbox.ts), so they can't carry the third-party session that the page-layout IFRAME widget (which keepsallow-same-origin) supports.Proposal
In
IframeWidget.tsx(or at widget-config resolution), interpolate a small whitelist of record-context variables in the configured URL when the widget renders on a record page:{{record.id}}{{record.<fieldName>}}Values URL-encoded; empty string when the field is unset; no expressions or functions — just substitution, consistent with variable tokens elsewhere in Twenty (e.g. workflows).
Question
If there is already a supported way to pass the current record's context to an embedded external page (or one on the roadmap), we'd be glad to use that instead — we couldn't find one in the code, issues, or discussions.
Related (different scope)
allow-same-originHappy to contribute a PR if the approach sounds right to the team.
All reactions