Flash en Prestashop
He leído algunas soluciones buenas y otras malas al dilema de cómo insertar las tan demandadas animaciones flash en un documento de Prestashop. Respondiendo a la demanda de varios de mis lectores, he creado mi propia solución, bastante sencilla de intuir si se maneja un poco de HTML. En este ejemplo vamos a insertar una película cualquiera, teniendo en cuenta sus dimensiones, en el módulo editorial.
Hay dos maneras de hacerlo usando el tag HTML <iframe>. Para verlo, sustituyan el código del archivo …/modules/editorial/editorial.tpl por el de abajo, en el que sólo se han añadido dos fragmentos de código. Les dejo a ustedes la tarea de decidir cuál iframe les conviene más: el que contiene un archivo HTML o el que contiene directamente el archivo .swf. Para que la segunda opción surta efecto, necesitamos el archivo iframe.html, que pondremos en la misma carpeta del módulo editoral.
Deben cambiarse las rutas y nombre de los archivos en color rojo.
editorial.tpl
<!– Module Editorial –>
<div id=»editorial_block_center» class=»editorial_block»>
{if $xml->body->home_logo_link}<a href=»{$xml->body->home_logo_link|escape:’htmlall’:’UTF-8′}» title=»{$xml->body->$title|escape:’htmlall’:’UTF-8’|stripslashes}»>{/if}
{if $homepage_logo}<img src=»{$this_path}homepage_logo.jpg» alt=»{$xml->body->$title|escape:’htmlall’:’UTF-8’|stripslashes}» />{/if}
{if $xml->body->home_logo_link}</a>{/if}
{if $xml->body->$logo_subheading}<p>{$xml->body->$logo_subheading|stripslashes}</p>{/if}
{if $xml->body->$title}<h1>{$xml->body->$title|stripslashes}</h1>{/if}
{if $xml->body->$subheading}<h3>{$xml->body->$subheading|stripslashes}</h3>{/if}
{if $xml->body->$paragraph}<div class=»rte»>{$xml->body->$paragraph|stripslashes}</div>{/if}
<! — iframe con archivo swf –>
<iframe width=»100%» height=»300″ src=»http://www.dominio.com/pelicula.swf» >
Si ves este mensaje, significa que tu navegador no soporta esta característica o está deshabilitada
</iframe>
<!– iframe con archivo html que contiene etiqueta tag HTML object –>
<iframe width=»100%» height=»300″ src=»http://localhost/prestashop/modules/editorial/iframe.html» >
marginwidth=»0″ marginheight=»0″ frameborder=»0″ scrolling=»no»>
Si ves este mensaje, significa que tu navegador no soporta esta característica o está deshabilitada
</iframe>
</div>
<!– /Module Editorial –>
iframe.html
<!DOCTYPE html PUBLIC «-//W3C//DTD XHTML 1.0 Strict//EN» «http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd»>
<html xmlns=»http://www.w3.org/1999/xhtml» xml:lang=»en»>
<head>
<meta http-equiv=»Content-Type» content=»text/html; charset=UTF-8″ />
<title> Titulo </title>
</head>
<body>
<object classid=»clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ codebase=»http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0″ width=»100%» height=»300″>
<param name=»movie» value=»pelicula.swf» />
<param name=»quality» value=»high» />
<embed src=»pelicula.swf» quality=»high» pluginspage=»http://www.macromedia.com/go/getflashplayer» type=»application/x-shockwave-flash» width=»100%» height=»300″></embed>
</object></body></html>