Copied to clipboard

Flag this post as spam?

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


  • Nicolai Winch Kristensen 50 posts 70 karma points
    Aug 14, 2012 @ 16:48
    Nicolai Winch Kristensen
    0

    Widget dropper IFrame

    Hi tried it out for Iframe use. IT seems to work for everything else than iframes

    I get :

    Error loading Razor Script [RAZOR]WidgetDropper.cshtml
    The best overloaded method match for 'System.Web.WebPages.Html.HtmlHelper.Raw(string)' has some invalid arguments

    im using: umbraco v 4.7.1 (Assembly version: 1.0.4281.20201)

    any ideas?

     

    Kind Regards :-)

    Nicolai

     

  • Kreck Design 2 posts 33 karma points
    Aug 14, 2012 @ 20:28
    Kreck Design
    0

    Hi Nicolai,

    Thank you for pointing this out. I'll update the downloadable package shortly to include this update, but here's how you can fix this now if you'd like...

    In the Developer section Scripting Files, edit the [RAZOR]WidgetDropper.cshtml file and scroll to the bottom of the file.

    Look for this (old) section:

        //#
        //# Actual rendering here
        //#
        <div class="cms-widget">
          @Html.Raw(node.html)
        </div>

    And replace with this (new) section:

        //#
        //# Actual rendering here
        //#
        <div class="cms-widget">
          @if(node.html.GetType() == typeof(umbraco.MacroEngines.DynamicXml))
          {
            @node.html.ToHtml()
          }
          else
          {
            @Html.Raw(node.html)
          }
        </div>

    The problem is because sometimes umbraco returns a string, and other times returns a DynamicXml object. As you can see, this new approach will first check before trying to render.

    Thanks again for reporting this!

  • Nicolai Winch Kristensen 50 posts 70 karma points
    Aug 22, 2012 @ 16:43
    Nicolai Winch Kristensen
    0

    thx - it works :-)

     

Please Sign in or register to post replies

Write your reply to:

Draft