Search code examples
piranha-cms

Piranha CMS block inside and outside container div


From code template we have:

<div class="block @block.CssName()">
  <div class="container">
     @Html.DisplayFor(m => block, block.GetType().Name)
  </div>
</div>

it make my content block always inside container class. How to make a flexible page where we can put a block inside and outside container


Solution

  • So finally i've made it by removing containerfrom template:

    <div class="block @block.CssName()">
      <!--<div class="container">-->
         @Html.DisplayFor(m => block, block.GetType().Name)
      <!--</div>-->
    </div>
    

    It make all standard block sit outside container. Next i made a group block of container. Any block can be inside this container group block except standard group block such as gallery and columns. Luckily it is open source, so we can make our own columns and gallery group block to be inside a container by modify cshtml template. I dont know how piranha.org do this

    piranha.org

    But i think my solve fit my purpose