Is it possible to know in the live site in a Section if any of the widgets it contains will render anything?
We have some sections that contain spacing like this:
<div class="section" style="margin-bottom: 20px; background-color: #f4f4f4;">
But sometimes we have widgets that display something based on the presence of certain content. If that is the case, we don't want to display neither the widget AND the section it is in.
public class SimpleWidgetController : WidgetController
public ActionResult Index()
var content = GetContent();
return View("Widgets/_Content", content);
So in the case where
GetContent() does not return any results, we don't want to render the widget and also not the section it is in.
We cannot capture the result of
Html.Kentico().WidgetZone(), because that method will always return
null in the live site and renders directly to the output through MVC's
Is this possible in Kentico?