ElemPilot ElemPilot

Smart Templates and Iframe Rendering

Smart Templates and Iframe Rendering

Why smart templates use iframes

Smart templates are closed visual pieces. They render inside an isolated iframe so WordPress admin CSS, theme CSS, and legacy plugin styles cannot deform spacing, colors, buttons, or shadows.

How editing works

The source HTML is the visual truth. The plugin replaces only safe fields: text, image URL, button URL, coupon, colors, and countdown values. Preview and live output use the same renderer.

What to avoid

  • Do not rebuild smart templates by hand in PHP.
  • Do not patch smart template visuals with global theme CSS.
  • Do not use CDN scripts inside production templates.

Troubleshooting iframe height

If an iframe leaves empty space, the renderer should measure the real content element instead of relying on a default body height.

Por qu茅 usan iframe

Las smart templates son piezas visuales cerradas. Se renderizan en un iframe aislado para que CSS del admin, tema o estilos viejos no deformen espaciado, colores, botones o sombras.

C贸mo se editan

El HTML fuente es la verdad visual. El plugin reemplaza campos seguros: texto, imagen, URL de bot贸n, cup贸n, colores y countdown. Preview y salida real usan el mismo renderer.

Qu茅 evitar

  • No reconstruyas smart templates a mano en PHP.
  • No las parches con CSS global del tema.
  • No uses scripts CDN dentro de templates de producci贸n.

Altura de iframe

Si queda espacio vac铆o, el renderer debe medir el contenido real y no depender de una altura por defecto.

Copied