Skip to content

Enhancement: spo site set enhance logo options #5495

@Jwaegebaert

Description

@Jwaegebaert

Right now, when you use siteLogoUrl in the spo site set command, it changes the thumbnail, not the actual logo of the site. Looking at the command's inner workings, it seems the body sent to _api/siteiconmanager/setsitelogo is missing a few things. With some tweaks to this endpoint, we should be able to modify the thumbnail and the logo as well. Let's add another option and adjust the command a bit.

Option Description
--siteThumbnailUrl [siteThumbnailUrl] Set the thumbnail for the site collection. This can be an absolute or relative URL to a file on the current site collection.

The request options for _api/siteiconmanager/setsitelogo should look like this:

  • To update the thumbnail:
const requestOptions: CliRequestOptions = {
  url: `${args.options.url}/_api/siteiconmanager/setsitelogo`,
  headers: {
    accept: 'application/json;odata=nometadata'
  },
  data: {
    aspect: 0,
    relativeLogoUrl: thumbnailUrl,
    type: 0
  },
  responseType: 'json'
};
  • To update the logo:
const requestOptions: CliRequestOptions = {
  url: `${args.options.url}/_api/siteiconmanager/setsitelogo`,
  headers: {
    accept: 'application/json;odata=nometadata'
  },
  data: {
    aspect: 1,
    relativeLogoUrl: logoUrl,
    type: 0
  },
  responseType: 'json'
};

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions