-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to add custom web parts to a page #14
Comments
Can you share the code you are using? That will help us ensure we are testing what you are seeing as well. Thanks! |
Sure, see below, any issue let me know. My code was abstracted a little so I've tried to combine it ClientSidePage.fromFile(
//part has web part GUID '{4a28b74a-7d88-441b-807f-cc9c38049b48}' not '4a28b74a-7d88-441b-807f-cc9c38049b48'
//this works but a blank web part is added and i think its because the part definition has the web part id property with the brackets so SP can't find the web part on the page
}); |
Thanks, will have a look |
Two questions:
Thanks. |
I think I have this fixed, accidentally lumped it in with a large PR moving over all the changes from sp-pnp-js. I'll leave this open as I am curious on understanding how this happened, i.e. why the difference. |
Fixed as part of #17 |
See screenshot of webpart manifest file and web part definition details in maintenancemode. Neither have {}. To get it working I done the filter with {} to find the web part. Once i had the web part definition I created the web part from the definition and reset the new web part to have a web part id minus the {}. After i done this it works and renders on the page. Happy to retest once the new version comes out. |
Hi. I have the same problem. And temporary solution didn't help me.... |
I got the latest version 1.0.3 but still having the same issue. I got around it by doing the following // find the definition we want, here by id
//web part from definition might have wrong GUID so reset to GUID without '{'
|
Thank you @raymondlittle100. In my case I found a second problem. In web part definitions collection, all my custom web parts have Id in UPPER case and this should be taken into account when you filter web part definitions. But when you add your web part, ID must be in lower case... It's work for me, with your solution ( {} ). All my web parts created by SharePoint Framework and in manifest have Ids in lowercase.... It's curious... |
@raymondlittle100 thank you for sharing sample. it is working for me. |
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. |
Category
Version
Please specify what version of the library you are using: [ 1.0.2 ]
Expected / Desired Behavior / Question
Ability to add custom web part to a column and have it render ok.
Observed Behavior
Web part is added to the page but the web part is blank because the web part Id doesn't match the one being added by @pnp
Steps to Reproduce
I have a custom web part deployed to my tenant which has a web part id of '4a28b74a-7d88-441b-807f-cc9c38049b48'. I have checked this against the solution deployed on the tenant. I have been able to add and configure an Embed web part as per the examples but when I add my custom web parts its fails you just get a blank web parts, see attached
I noticed when debugging all my custom web parts the part Ids are prefix and appended with '{' '}'. Once I create my part from the part definition the new part has these brackets. Once the part has been created from the definition if i then manually remove these and add the web part it works and the web parts are added to the page ok. I have attached a screen shot of a debug point showing the differences in the web part ids betwen the OOTB embed and one of my custom ones. Part indexes 27 and 28 are custom whereas part 2 is OOTB
The text was updated successfully, but these errors were encountered: