As many of us have faced the issue of repeating content when trying to use same placeholder name, Sitecore 9 has filled this gap by introducing support for Dynamic Placeholders in Out of the Box installation.
Problem Statement and when to use Dynamic Placeholders:
In the below example I will reproduce an issue when I use a standard Sitecore placeholder:
I have created here:
- Layout.cshtml - A layout file with 3 placeholders: Header, Main, Footer
- Section - A sublayout view with following code:
- 1 Column - A sublayout view with following code.