HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback


Examples are written for the Projects feature (aka Project Mode).

Note

An `enum`, `ProjectStatus`, used by the "old" project gadget, is not documented here. For example, the List method has an overload that takes this parameter. You should not use `ProjectStatus` because it is being phased out.

Currently, there is no public API for programmatically creating comments and custom notifications on projects.

## Create a project

Note

The examples here use `ServiceLocator.Current` to access DI container. In "real" code, you should take in the dependencies through a constructor instead.

  • Create a project and save it.

    
  • There are a couple of static events for saving and deleting project and items that can be listened to.

    
  • Create project items.

    

## Access projects

  • Get a specific project.

    
  • List projects

    • List all projects.

      
    • Or get a paged list.

      
  • Get a specific project item.

    
  • List project items

    • List all project items.

      
    • Or get a paged list.

      
    • Or only projects of a specific category.

      
  • You also can send in a list of content and get all project items that matches that list.

    
  • To get the **projectIds** of the currently active projects, use the IProjectResolver.

    

## Update a project

  • To change the name of a project.

    
  • To update existing project items and/or adding new, just save the changed/new items.

    

## Delete a project

  • To delete a project, call **Delete**.

    
  • When you delete project item(s), send in the IDs of the items to `DeleteItems`.

    
  • Delete all project items for a project.

    

## Publish a project

  • Get a `ProjectPublisher`.

    
  • Publish a project.

    
  • To delay the publishing of a project, use the `DateTime` overload.

    
  • Publish a project without checking access rights, for example in a scheduled job, use a method that takes an `AccessLevel` and send in `NoAccess` to skip the access check.

    
  • To reactivate a project that was published.

    
  • You can publish a subset of a project by sending in a list of project items.

    

## Work with projects and content

  • Check if a content item is in a project.

    
  • Check if a content item is in a project with any version.

    
  • Check if a content item is part of a project.

    
  • To get the projects that are connected to a list of content.

    
  • Use `ProjectLoaderOptions` to load content with versions found in projects rather than loading the published version.