pnp / pnpjs

Fluent JavaScript API for SharePoint and Microsoft Graph REST APIs
https://pnp.github.io/pnpjs/
Other
749 stars 305 forks source link

How to hide title from a site? #2927

Closed kkazala closed 7 months ago

kkazala commented 7 months ago

What version of PnPjs library you are using

3.x

Minor Version Number

16.0

Target environment

All

Additional environment details

SPO

Question/Request

Is there a way to hide site title using Pnp js?

Change the look / Header / Site title visibility: image

I see it's possible using PnP PowerShell but can't find this option in js

thank you in advance for your help =)

bcameron1231 commented 7 months ago

Not something we natively have. But you can use our exposed methods to achieve this.

import { spPost, SPQueryable } from "@pnp/sp";
import "@pnp/sp/presets/all";
import { body } from "@pnp/queryable/index.js";
import { Web } from "@pnp/sp/webs";

const sp = spfi(...);
await spPost(SPQueryable(sp.web, "SetChromeOptions"), body({'hideTitleInHeader':true}));

For more info on calling other endpoints we don't have. Check out our docs. https://pnp.github.io/pnpjs/concepts/calling-other-endpoints/

kkazala commented 7 months ago

thank you @bcameron1231 ! This has been a great help indeed :)

github-actions[bot] commented 7 months ago

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.