Cbauto wrote:Really can't get this to work getting the following error:
An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately.
h:----->\TopicDetails.cshtml
'IHtmlHelper<TopicModel>' does not contain a definition for 'Widget' and no extension method 'Widget' accepting a first argument of type 'IHtmlHelper<TopicModel>' could be found (are you missing a using directive or an assembly reference?)
I've copied the above exactly and inserted the correct names. What could be the error?
Greetings,
I assume that you are using a more recent version of nopCommerce. When you modify the TopicDetails.cshtml template, instead of adding:
@if (Model.SystemName.Equals("YourTopicName"))
{
Html.Widget("your_widget_zone_name");
}
You now have to use (in 4.40 nopCommerce):
@if (Model.SystemName.Equals("YourTopicName"))
{
@await Component.InvokeAsync("Widget", new { widgetZone = "your_widget_zone_name" })
}
Please let me know if you need any further advice or if you are using a version where the above code does not work.