asp.net-mvcsitecoresitecore-mvc

What does @Html.Sitecore.Placeholder() point to?


In Sitecore 7 MVC, my understanding is that partial views are represented by using Razor declarations such as @Html.Sitecore().Placeholder("some_thing") in a .cshtml file.

In this context, what does the argument "some_thing" actually represent - is it something located in the Sitecore instance? If so, how can I locate the thing that "some_thing" represents within the Sitecore database?


Solution

  • @Html.Sitecore().Placeholder("some_thing") is typically used in a layout page such as your DefaultLayout page.

    Like Marek said it is a place that you put components in a position top/bottom.

    If you log into Sitecore and look into at a page, under the Presentation tab, there is an icon that says Detail. Click that. A pop-up will open (I think it still did in version 7, I dodn't have an instance running. On that popup, select a component or add a new component to the Default Layout.

    In the settings for the component will be a field called Placeholder. Put the text "some_thing" in there without the quotes.

    I think this is what you are asking what this is the placeholder representing.