You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
I am having problems while trying to upload page layouts with metadata. I need to upload a page layout and set its content type to page layout and then set its Associated content type to article page. I am trying to set ContentTypeId to Page Layout id but that doesn't seem to do anything. And when I try to add PublishingAssociatedContentType it just crashes with this error
Unable to update metadata of the file
Unhandled rejection StatusCodeError: 400 - {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The property 'PublishingAssociatedContentType' does not exist o
n type 'SP.Data.OData__x005f_catalogs_x002f_masterpageItem'. Make sure to only use property names that are defined by the type."}}}
It appears that this field is not exposed via the API. So that means that you cannot access it.
Also did a test on my side, but get the same result.
Also tried to retrieve it from an existing PL: https://tenant.sharepoint.com/sites/demo/_api/web/lists/getbytitle('Master Page Gallery')/items(87)?$select=PublishingAssociatedContentType
Which returns: The field or property 'PublishingAssociatedContentType' does not exist.
Thanks for testing it! Then it would seem that it is not possible to do this with the current REST API. We have to wait until Microsoft decides to expose it to the rest api.
I didin't check this throughly, but it might be possible to achieve this via JSOM https://msdn.microsoft.com/en-us/library/office/jj994682.aspx. Do you know if it is possible to use JSOM with gulp? If not I might try to achieve this with executing Javascript from developer console in our tenant after uploading the files, or alternatively set up PnP powershell to change the content types.
I tried for a while to get this working but it just won't. The property isn't in the type SP.Data.OData__x005f_catalogs_x002f_masterpageItem and there isn't a definition accessible for the correct content type. We only have a few content types so they set them manually after the initial deployment.
Hi!
I am having problems while trying to upload page layouts with metadata. I need to upload a page layout and set its content type to page layout and then set its Associated content type to article page. I am trying to set ContentTypeId to Page Layout id but that doesn't seem to do anything. And when I try to add PublishingAssociatedContentType it just crashes with this error
Someone tried the same thing and posted an issue of it to the gulp-spsync. wictorwilen/gulp-spsync#11
This is my current metadata that I am trying to set:
Do you know if it is possible to upload page layouts and set the correct metadata to them with this library?
The text was updated successfully, but these errors were encountered: