Try our conversational search powered by Generative AI!

You can specify a parent location rule when you create or move content

Fixed in

EPiServer.ContentDeliveryApi 3.7.0

(Or a related package)

Created

Oct 25, 2022

Updated

Apr 06, 2023

State

Closed, Acceptance tests pass


Description

Clients can create a block using endpoints.

Previously, if a block's parent was a page, then its parent would be that page, which was consistent with IContentRepository and explicit because there was no handling behind the scene. However, in UI, block's parent was ForThisPage (associated with the param parent).  

Supported endpoints

  • Create 
  • CreateOrUpdate (only support creating new content item)
  • CreateMediaMultipart
  • CreateOrUpdateMediaMultipart (only support creating new content item)
  • CreateContentMediaBinary
  • Move 

x-epi-parent-location-rule  – Header parameter is introduced to specify where content will be created or moved under: Content asset folder of parent or directly under parent. It has three values:

  • Default
    • Create / CreateOrUpdate and Move endpoints – By default content is created directly under parent.
    • CreateMediaMultipart, CreateOrUpdateMediaMultipart, CreateContentMediaBinary endpoints
      • By default, content is created under asset folder of parent if parent is IResourceable (e.g Block or Page).
      • Otherwise, content is created directly under parent.
    • CreateContentMediaBinary endpoint
      • If parent is not provided, content is saved under global asset root folder.
      • If non-default value of parent location rule is present but no parent Id is provided, Http 400 response is returned with message Parent must be provided.
  • Direct – Content created directly under parent.
  • AssetFolder
    • If parent is IResourceable (e.g Block or Page), content is created under asset folder of parent.
    • If parent is not IResourceable , 400 response is returned with message Asset folder is not supported for parent content.