Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How can I include an iframe tag in a CMS page? 
 
saraspixels
Jr. Member
 
Total Posts:  2
Joined:  2010-01-13
 

How can I include an iframe tag in a CMS page?  TinyMCE seems to be editing out the iframe tag.

Here’s what I’m trying to do:

I want a flash image scroller on my home page that showcases my recent website designs.  I have created the flash SWF and have a simple index.html file that displays it.  How can I put the iframe tag in the Home page (in the Magento CMS section)?  Every time I try the editor takes out the tag.

I also tried using the Embed tag to embed the SWF directly but that is also removed (and I don’t think this will work as well as the iframe).

I am open to other suggestions if anyone knows how to get the flash scroller on my home page.

I am using Magento 1.4.1.0 and I am new to Magento so any help would be appreciated!

 
Magento Community Magento Community
Magento Community
Magento Community
 
saraspixels
Jr. Member
 
Total Posts:  2
Joined:  2010-01-13
 

Please can anyone help me get this working?

 
Magento Community Magento Community
Magento Community
Magento Community
 
rwone
Sr. Member
 
Total Posts:  174
Joined:  2009-02-12
 

i’d like to know this to and be able to embed a google calendar in a cms page…

 
Magento Community Magento Community
Magento Community
Magento Community
 
archmad
Member
 
Avatar
Total Posts:  32
Joined:  2010-04-03
Philippines
 

I was looking for the same solution but I guess the best way (for the moment) is to create a module.

Refer to this page: http://www.exploremagento.com/magento/simple-custom-module.php

I will just paste my code.

Step 1:

<?xml version="1.0"?>
<config>
    <
modules>
        <
GTwebsite_Iframe>
            <
active>true</active>
            <
codePool>local</codePool>
        </
GTwebsite_Iframe>
    </
modules>
</
config>

Step 2:

<?xml version="1.0"?>
<config>
    <global>
        <
blocks>
            <
gtwebsite_iframe>
                <class>
GTwebsite_Iframe_Block</class>
            </
gtwebsite_iframe>
        </
blocks>
    </global>
</
config>

Step 3:

Note that im using Iframe.php and not View.php

<?php

class GTwebsite_Iframe_Block_Iframe extends Mage_Core_Block_Template
{
    
public function getIframeOutput() {
        $url 
$this->getPageUrl();
        
$width $this->getWidth();
        
$height $this->getHeight();
        
$html '
            <iframe width="'
$width .'" height="'$height .'" src="'$url .'"><p>Your browser does not support iframes. Please install <a href="http://www.mozilla.org/firefox/" target="_blank">Firefox</a>.</p></iframe>
        '
;
        return 
$html;
    
}    
}

Step 4

Note that i used iframe.phtml and not view.phtml, also i saved it under /template/page/ and not /template/example/

<?php if($_heading $this->getContentHeading()): ?>
    
<div class="page-title">
        <
h1><?php echo $_heading?></h1>
    </
div>
<?php endif; ?>
<?php 
echo $this->getIframeOutput(); ?>

Step 5

In your CMS page

{{block type="gtwebsite_iframe/iframe" page_url="http://presentsyuu.com/catalog/index.html" width="100%" height="550" template="page/iframe.phtml"}}

See attached zip file for the module above.

File Attachments
iframe.zip  (File Size: 4KB - Downloads: 7)
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top