1. Component library

SubPageCode

Version:

You use the SubPageCode component to add code that is specific for an item. Sitecore only executes this code when it renders the item. The SubPageCode component is similar to the PageCode component, but it differs from the PageCode component in the following ways:

  • You use the SubPageCode component for items that are rendered by a Repeater component.
  • You add the SubPageCode component to the _Standard Values layout of the template for the items that the Repeater component renders.

Properties

NameDescriptionDefault
Data
PageCodeScriptFileNameSpecify the folder where the script files for the item are located.
PageCodeTypeNameSpecify the type name and assembly of the Page Code object to be run server-side when the page is loading.

Configuration

You can create a configuration item for a SubPageCode component by creating an item based on the SubPageCode Parameters template.

The configuration item has these specific fields:

  • PageCodeScriptFileName
  • PageCodeTypeName
If you have suggestions for improving this article, let us know!