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>
}
}
}
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.
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
is working on a reply...