The values for custom page attributes are persisted together with other page properties, but are not displayed or used anywhere by default. It is up to you to decide how you want to use these values. The most common scenarios are in custom extensions and you can use the Pages API to access values in custom page attributes.
One example of using the value of a custom attribute is when handling the PreRenderComplete event for Sitefinity CMS pages. The following procedure describes how to do this:
Sitefinity CMS fires certain events through the EventHub system, but you can only subscribe to these events after the application has been initialized. To make sure that the application is initialized, you can execute your code in the handle of the Bootstrapper.Initialized event. The first thing to do is to subscribe to this event and have a handler for it.
sender, EventArgs e)
Bootstrapper.Initialized += Bootstrapper_Initialized;
sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
For more information about using the EventHub, see Event system: EventHub.
var customAttributeValue = eventData.PageSiteNode.Attributes[
After you have retrieved the value, you can use it any way you want. This example shows how you can display it as an alert when the page is opened in the browser. The full code of the handler looks like this:
// register a script block, which shows the custom attribute value in an alert whenever the page is opened
+ customAttributeValue +
NOTE: As a developer, you can decide how you want to use the values of custom page attributes, but you can always access them through the Attributes collection of the PageSiteNode class.
Back To Top