Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@* Using with a basic TagBuilder *@
<div>
@Html.Sitecore().DynamicPlaceholder("feature",
Html.Tag("div")
.AddCssClass("col-sm-4")
.GenerateId("featureCol"),
3, 3)
</div>
@* Using with a Func<DynamicPlaceholderRenderContext, TagBuilder> *@
<div class="row">
@Html.Sitecore().DynamicPlaceholder("feature",
ctx => @Html.Tag("div")
.AddCssClass("col-sm-" + 12 / ctx.PlaceholdersCount)
.GenerateId("featureCol" + ctx.Index),
3, 4)
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment