3

In Sitecore's documentation you encounter terms such as "static binding" and "dynamic binding" of presentation components such as renderings.

  1. What are the differences between static- and dynamic bindings?
  2. Why would I use static bindings?
  3. Why would I use dynamic bindings?
2
  • It is not quite clear what you refer to by saying static and dynamic bindings? Oct 26, 2016 at 14:58
  • @adb I am referring to static and dynamic binding in terms of presentation in Sitecore. Oct 26, 2016 at 15:08

1 Answer 1

8

What is static- and dynamic bindings in general?

Static binding means adding a rendering to a page in a raw way, e.g. in an mvc view:

@Html().RenderAction("Controller", "Action");

Essentially, it means that you are not able to change this without editing the code.

Dynamic binding means that on a page you will have a placeholder to put your renderings into:

@Html().Sitecore().Placeholder("main")

After that in the Content Editor (or Exp Editor) you will be able to "dynamically" add any rendering you like to that "main" placeholder.

When would I use static bindings, and what are the use cases for doing so?

When would I use dynamic bindings, and what are the benefits of this?

It is generally recommended to use dynamic bindings, because of their flexibility.

However you may want to use static bindigs for things like site header rendering, etc (something that should not be removed by editors mistake and is not supposed to be changed)

Please refer to the official Sitecore documentation for more info on how this works altogether with layouts, sublayouts and renderings (https://sdn.sitecore.net/upload/sitecore6/sc62keywords/presentation_component_reference_sc62_a4.pdf)

1
  • 1
    Having all of bindings dynamic places a large burden on an Author to correctly configure a page for layout where there may be dozens of presentation components needed. Even when these are defaulted, the management of additional components through the Presentation dialogs can be cumbersome. This is made much simpler by 'hiding' components that should rarely be removed or altered, like logos, footers, navs, etc - design specific of course. Statically binding these elements retains encapsulation and reuse flexibility and simplifies the layout. You can always have extra page layouts! Oct 27, 2016 at 13:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.