Best Practice – Presentation Components

Sitecore recommended practices for presentation:

  • Limit the number of layouts in favor of sublayouts. The aim should be to have one layout per site per device.
  • Place components that appear in every single page statically (in the markup) of the layout. Use placeholders to dynamically bind components that only appear in some pages. Group components that are always used together in sublayouts.
  • Set presentation details on the _standard values whenever possible.
  • Use the FieldRenderer or the other Sitecore presentation controls to enable the PageEditor functionality. You can still use those components for rendering fields that should not be editable setting the disable-web-editing attribute.
  • Make sure to use the appropriate image manipulation parameters to ensure that images are re-sized on the server and unnecessarily large files are not sent to the browser.
  • Make sure to use the DataSource — by using $sc_item instead of $sc_currentitem in xslts, the DataSource attribute on WebServer controls or with the appropriate code in Subalyouts. This facilitates creating multi-variant tests (MVT) and personalization rules in the OMS.
  • Leverage the presentation component parameters. You could use the parameters to allow users to configure/modify the behavior of the component, for example, the number of items shown in a list, the CSS classes to use, the URL for a feed it is showing, and so on.
  • Make sure to create a template for any parameters in the presentation component, and set the Parameters Template Property.
  • Test components appropriately. For example, a menu rendering might work fine with a few items, but struggle when you have large amounts of data.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s