dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
860 stars 467 forks source link

Edit Page V2: Render `HTML` from Page API to New Editor #27596

Closed fmontes closed 8 months ago

fmontes commented 8 months ago

Parent

27546

Task description

As a dotCMS user, I want to be able to use the new page editor with VTL rendered pages.

This should only apply to pages that are not headless. When the feature flag is set, the new editor should display a VTL rendered page in the editor iframe.

### Acceptance Criteria
- [ ] The feature flag must be set the rendering of HTML from the page API in the new editor.
- [ ] This don't include any editing and or tooling, just render the code

External Links

We can try to use Blob to render the HTML

// Step 1: Create the content
var htmlContent = '<!DOCTYPE html><html><body><h1>Hello, World!</h1></body></html>';

// Step 2: Create a Blob from the content
var blob = new Blob([htmlContent], { type: 'text/html' });

// Step 3: Create a Blob URL
var blobUrl = URL.createObjectURL(blob);

// Step 4: Set the Blob URL as the iframe source
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
iframe.src = blobUrl;

We don't know the implications of this in terms of permissions and cross-origin issues.

Assumptions & Initiation Needs

fmontes commented 8 months ago

Close in favor https://github.com/dotCMS/core/issues/27547