Modify pages

Sitefinity CMS allows you to modify the PageNode and the underlying PageData through the code.

When modifying a page, you must perform the following:

  1. Get the page.
    When modifying the page, you must get the PageNode or thePageData. To modify the title, the HTML title, or the description of the page, you must get and modify the PageData object. To modify the URL of the page, you must get the PageNode object. For more information about finding a specific PageNode or PageData, see For developers: Query pages.

  2. Modify the properties.
    After you get the page object, you modify the properties.

  3. Save the changes.
    Finally, you must save the changes.

Native API

To modify a page using the Native API, you must use the PageManager class.
To modify the HtmlTitle and the Description of a page, perform the following:

  1. Get the PageData with the specified Title by calling GetPageDataList and filtering based on the Title property.
  2. Modify the HtmlTitle and the Description properties.
  3. Save your changes.

Use the following code sample:

 

Fluent API

To modify a page using the Fluent API, you must use the page facade.
To modify the HtmlTitle and the Description of a page, perform the following:

  1. Get the PageNode of the page with the specifiedTitle.
  2. Modify the HtmlTitle and the Description of the PageData object.
  3. Save your changes.

Use the following code sample:

Was this article helpful?

Next article

Delete pages