AI agents: the content index is at /llms.txt. Every page is also available as Markdown — send the request header Accept: text/markdown, or append .md to the page URL.
Xperience Docs

Cookie consent

We use necessary cookies (opens in a new tab) to run our website and improve your experience while browsing. Additional cookies are only used with your consent. You may revoke your consent on the Cookies Policy (opens in a new tab) page or in your browser at any time.

Configure (opens in a new tab)
  • Documentation
    InstallationUsing the Xperience interfaceDeveloping websitesConfiguring XperienceManaging usersSecuring websitesDeploying websitesManaging website contentMultilingual websitesMacro expressionsExternal utilitiesIntegrating 3rd party systemsCustom developmentE-commerce featuresOn-line marketing featuresRelease notes - Xperience 13Xperience terminology glossary
  • Tutorial
    Using the Xperience interfaceDeveloper tutorialBusiness tutorialResource hub for marketers
  • API Examples
    ConfigurationContent managementDevelopmentE-commerceOn-line marketingSocial media
  1. Home
  2. Custom development
  3. Working with pages in the API
  4. Storing custom data for all page types

Storing custom data for all page types


Was this page helpful?

Send us feedback Go back to top
  • Community Questions & Answers (opens in a new tab)
  • Contact support (opens in a new tab)

If you need to add raw data to a page, regardless of its page type and corresponding data types, use the NodeCustomData column of the CMS_Tree database table, or the DocumentCustomData column of the CMS_Document table.

The columns are not editable from the administration interface. You can access the columns in the API using properties of objects of the TreeNode class:

  • TreeNode.NodeCustomData
  • TreeNode.DocumentCustomData

Store and retrieve data using the indexer notation. The data is automatically serialized to an XML key-value structure and can be persisted in the database. For example, the custom data:

C#Storing a collection of custom values
treeNode.NodeCustomData["Data1"] = "Value 1";
treeNode.NodeCustomData["Data2"] = "Value 2";

// Persists the changes in the database
treeNode.SubmitChanges(true);

Results in the following XML structure:

XMLInternal XML structure
<CustomData>
    <Data1>
        Value 1
    </Data1>
    <Data2>
        Value 2
    </Data2>
</CustomData>

Access the data in code using specified key values:

C#
// Retrieves 'Value 1'
var data = treeNode.NodeCustomData["Data1"];

Related pages

  • Managing page types
  • Working with pages in the API
  • Page database structure