Copied to clipboard

Flag this post as spam?

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


  • Anton Gildebrand 49 posts 149 karma points c-trib
    Feb 02, 2013 @ 18:51
    Anton Gildebrand
    0

    My v4 macros doesn't work in v6

    Howdy,

    I tried setting up a new website on v6, and installed a package containing pretty much everything from a production v4 site. However, all of my macros fails.

    When i open the script editor and tries to re-save a script, i get the following error

    error CS1513: } expected

     

     

    Here is the script i am trying to save.

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @{  
        var parent = @Model.AncestorOrSelf(1);
        if (parent != null) {
            foreach (var item in parent.Children.Where("Visible")) {
                var selected = Array.IndexOf(Model.Path.Split(','), item.Id.ToString()) >= 0 ? " class=\"active\"" : "";
                <a href="@item.Url"@Html.Raw(selected)>
                    @item.Name
                    <div></div>
                </a>
            }
        }
    }   

     

  • David F. Hill 122 posts 242 karma points
    Feb 12, 2013 @ 20:10
    David F. Hill
    1

    Hi Anton,

    I don't know if you've resolved this by now - but...

    if you remove the @ sign in front of "Model" on line 3 - it should save without errors.

    Hope that helps,
    David

  • 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