Access the context item

Abstract

How to access the context item using the Sitecore.Context.Item property.

In presentation and other components, processing often begins with the context item. You can access the context item using the Sitecore.Context.Item property. For example, to access the context item:

Sitecore.Data.Items.Item contextItem = Sitecore.Context.Item ;