toanhnt wrote:Hello Valentin Kirov,
Thank you for your reply. What I mean is
how to add another widget zone under that but using different category ID for the new widget zone.
For example:
var categoryIds = new List<int> { 2, 3, 4 }
widgetZone = "categorydetails_top"
var categoryIds = new List<int> { 5, 6, 7 }
widgetZone = "example"
Hello again
toanhnt,
in that case you should do something like this:
@{
var categoryIds = new List<int> { 2, 3, 4 }; // Inside the curly brackets you can list all category IDs, comma separated
if (categoryIds.Contains(Model.Id))
{
@await Component.InvokeAsync("Widget", new { widgetZone = "categorydetails_top", additionalData = Model.Id })
}
}
@{
var secondCategoryIds = new List<int> { 5, 6, 7 }; // Inside the curly brackets you can list all category IDs for the additional widget-zone, comma separated
if (secondCategoryIds.Contains(Model.Id))
{
@await Component.InvokeAsync("Widget", new { widgetZone = "NAME_OF_OTHER_WIDGET_ZONE", additionalData = Model.Id })
}
}
Where for the secondCategoryIds you specify only the IDs for the additional widget zone.