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:
That is:
I have created here:
- Layout.cshtml - A layout file with 3 placeholders: Header, Main, Footer
- Sublayouts
- Section - A sublayout view with following code:
- 1 Column - A sublayout view with following code.
- A Hero image component - This a sample component for example. We can use any other component. It contains 2 fields: Title, Image.