'SiteBuilderBaseViewModel' does not contain a definition for 'CustomBlockList'
I want to render the content of my blocklist on the nav of my website, however, I get this error:
SiteBuilderBaseViewModel' does not contain a definition for 'CustomBlockList' and no accessible extension method 'CustomBlockList' accepting a first argument of type 'SiteBuilderBaseViewModel' could be found.
@inherits UmbracoViewPage<SiteBuilderBaseViewModel>
@using USNSiteBuilder.Core.Models
@using USNSiteBuilder.Core.Interfaces
@{
Usnnavigation navigation = (Usnnavigation)Model.Navigation;
if (navigation != null && navigation.CustomNav!= null && navigation.CustomNav.Any()) {
int index = 1;
foreach (var item in navigation.CustomNav) {
<li><span><a href="#">item @($"{index}")</a></span></li>
index++;
}
@Html.GetBlockListHtml(Model.CustomBlockList)
}
}
I have followed the docs and created the Components folder under blocklist. The file inside is "CustomBlockList.cshtml":
'SiteBuilderBaseViewModel' does not contain a definition for 'CustomBlockList'
I want to render the content of my blocklist on the nav of my website, however, I get this error:
SiteBuilderBaseViewModel' does not contain a definition for 'CustomBlockList' and no accessible extension method 'CustomBlockList' accepting a first argument of type 'SiteBuilderBaseViewModel' could be found.
I have followed the docs and created the Components folder under blocklist. The file inside is "CustomBlockList.cshtml":
The final goal is to render what's inside the Block list and not the item @($"{index}"). Can anyone help?
Hi,
I can see that you are using uSkinned Site Builder. Marc from uSkinned here.
To access your custom block list you will need to use:
Cheers,
Marc
is working on a reply...