The datatype "secondaryNav" is placed on a "SiteSettings" page node in the content tree where i have my settings.
Unfortunately i keep getting this error message. Since i am using code taken directly from the documentation it must be something about my "siteSettings"-setup that causes the problem but i cannot see what.
My code:
@{
var siteSettings = root.SiblingsAndSelf().Where(x => x.ContentType.Alias == "siteSettings").First();
var links = siteSettings.Value<IEnumerable<Link>>("secondaryNav");
if (links.Any())
{
foreach (var link in links)
{
<li><a href="@link.Url()" target="@link.Target">@link.Name</a></li>
}
}
}
public string Name { get; set; }
public string Target { get; set; }
public LinkType Type { get; set; }
public Udi Udi { get; set; }
public string Url { get; set; }
So as you can see Url is a string here not a method you can call.. so just change
Problem rendering Multi-Url-Picker
I am trying to render a Multi-Url-Picker using the standard Umbraco documentation at: https://our.umbraco.com/Documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Multi-Url-Picker/index-vpre8_8
The datatype "secondaryNav" is placed on a "SiteSettings" page node in the content tree where i have my settings.
Unfortunately i keep getting this error message. Since i am using code taken directly from the documentation it must be something about my "siteSettings"-setup that causes the problem but i cannot see what.
My code:
Hi,
link is a special model that has the following:
So as you can see Url is a string here not a method you can call.. so just change
to:
Thanks so much. That fixed it.
This is my mistake - sorry, I updated the documents for this section yesterday and it is indeed incorrect.
Thanks for highlighting this @Henrik
No worries :)
is working on a reply...
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.