Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 372
alex Avatar asked Dec 05 '22 18:12

alex


1 Answers

In the shortest way: Sitecore Placeholder is a place where you can add your components.

The argument some_thing in @Html.Sitecore().Placeholder("some_thing") is the name of the placeholder.

You can have multiple placeholders on your page. When you add a component to a page, you tell Sitecore "Put in in placeholder some_thing and that's how Sitecore knows where to place it.

Read Presentation Component Reference for more information (yeah this document is years old, but the idea is still the same).

like image 173
Marek Musielak Avatar answered Jan 03 '23 18:01

Marek Musielak