Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Sørensen 102 posts 327 karma points
    Feb 28, 2014 @ 15:24
    Dan Sørensen
    0

    Simple macro iframe examples how to fix external error?

    Hello Umbraco people

    I got a problem with a macro. the macro should just give back a iframe with the link the user past in, the marco can be put into the Rich Text editor.

    when I make the url to an external site it just loads forever like nothing happend but if I save the page it will show on the page normaly is there maybe a fix for this, because the user whould think it hasent loaded yet.

    Image of how it looks if its an external link, the load symbol will just continue forever. http://gyazo.com/4b50dd9faec8310234e075d7ac5e0cef.png

    This is the macro code just simple get the string that the user input and then make a <div> and <iframe> tag around.

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    @*
       Macro parameter to be set on the macro
       Show:True   Alias:iframeUrl     Name:Iframe Url    Type:Textstring
    *@   
    
    @{ 
        var iframeUrl = Model.MacroParameters["iframeUrl"];
    }
    
    
    @if(!iframeUrl.Equals(""))
    {
        <div class="iframe">
            <iframe src="@iframeUrl" height="100%" width="100%">
            </iframe>
        </div>
    }
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies