OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.41k stars 2.39k forks source link

Define Zone using Asp.net @section syntax #5412

Open ns8482e opened 4 years ago

ns8482e commented 4 years ago

It would be nice to define zone using @section asp.net syntax.

@section Header
{
     <h1>My Header</h1> 
}

which would be technically same as following tag helper

<zone name="Header">
      <h1>My Header</h1>
</zone>

and section can be rendered by calling on Views.

@if (IsSectionDefined("Header"))
{
    @await RenderSectionAsync("Header", required: false)
}
agriffard commented 3 years ago

Related PR has been merged. Can this be closed @ns8482e ?

ns8482e commented 3 years ago

@agriffard I guess this was reopened because merged PR was reverted.