Domanda

I've followed this tutorial to create an extension that displays an alert on top of the page:

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/using-page-placeholder-with-extensions

However; I would like the alert to be really on top, even on top of the Office 365 bar.

Is it possible to add a placeholder on top of the Office 365 bar?

In the example bellow, the green alert would need to be on top of the blue bar.

enter image description here

È stato utile?

Soluzione

The workaround, use jQuery to change the DOM sequence.

For example:

jQuery('#SuiteNavWrapper').prepend(jQuery('div[data-sp-placeholder="Top"]'));

enter image description here

Altri suggerimenti

Unfortunately, there is no way to create new placeholders. The footer and the header is all we have and we cannot move them closer to the top.

However, if you really want to, you can place any HTML anywhere on the page with a bit of JavaScript. This is not the recommended approach, but I had to do it in the past if some projects really required it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top