SOLVED

Extend built-in SP web part possible

%3CLINGO-SUB%20id%3D%22lingo-sub-3336093%22%20slang%3D%22en-US%22%3EExtend%20built-in%20SP%20web%20part%20possible%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3336093%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI'm%20a%20total%20noob%20in%20SPfx%20development%2C%20barely%20done%20with%20basic%20training%20-%20HelloWorldWebPart.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20wondering%20if%20it's%20possible%20to%20extend%20the%20web%20parts%20that%20are%20built%20into%20Sharepoint.%20And%20if%20so%2C%20how%20you%20would%20go%20about%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20looking%20to%20slightly%20modify%20the%20News%20web%20part%20and%20was%20hoping%20to%20be%20able%20to%20do%20something%20like%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3Eimport%20%7BNewsWebPart%7D%20from%20'%40microsoft%2Fsp-news-webpart%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3Eexport%3C%2FSPAN%3E%20%3CSPAN%3Edefault%3C%2FSPAN%3E%20%3CSPAN%3Eclass%3C%2FSPAN%3E%20%3CSPAN%3EMyNewsWebPart%3C%2FSPAN%3E%20%3CSPAN%3Eextends%3C%2FSPAN%3E%20%3CSPAN%3ENewsClientSideWebPart%3C%2FSPAN%3E%3CSPAN%3E%26lt%3B%3C%2FSPAN%3E%3CSPAN%3EINewsWebPartProps%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Eand%20then%20just%20override%20the%20methods%20I%20need.%20Rather%20than%20re-inventing%20the%20wheel.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EBut%20I'm%20starting%20to%20think%20it's%20not%20possible%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EAny%202%20Cents%20welcome!%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3342878%22%20slang%3D%22en-US%22%3ERe%3A%20Extend%20built-in%20SP%20web%20part%20possible%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3342878%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1308234%22%20target%3D%22_blank%22%3E%40parrtaker65%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESorry%2C%20this%20is%20not%20possible%20as%20you%20outlined%20and%20there%20is%20no%20expectation%20at%20this%20time%20to%20make%20out%20of%20the%20box%20webparts%20open%20source%20or%20release%20that%20code.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMy%20recommendation%20is%20to%20check%20out%20the%20huge%20samples%20repository%20available%20in%20the%20PnP%20Community.%20There%20are%20webpart%20samples%20there%20that%20might%20have%20the%20functionality%20you%20want%20to%20add%20to%20the%20out%20of%20the%20box%20webpart%2C%20or%20might%20be%20code%20there%20that%20you%20could%20use%20to%20jumpstart%20building%20your%20custom%20webpart.%20If%20your%20final%20product%20could%20be%20useful%20for%20others%20to%20see%2C%20considering%20contributing%20back%20to%20the%20repository.%20(The%20instructions%20on%20doing%20that%20are%20on%20the%20website%20below.)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELinks%20to%20the%20smples%20repo%20can%20be%20found%20at%20the%20link%20below%2C%20alongs%20with%20a%20LOT%20more%20information%20on%20multiple%20development%20technologies%20around%20Microsoft%20365.%26nbsp%3B%20Good%20luck!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20title%3D%22PnP%20Home%22%20href%3D%22https%3A%2F%2Faka.ms%2Fm365pnp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2Fm365pnp%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDon%20Kirkham%3C%2FP%3E%0A%3CP%3EMicrosoft%20MVP%2C%20Office%20Development%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%22%3E%3CSPAN%3EPlease%20click%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26amp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ELike%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3Bif%20my%20post%20helped%20you%20to%20answer%20or%20resolve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ELike%3C%2FSTRONG%3E%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello,

I'm a total noob in SPfx development, barely done with basic training - HelloWorldWebPart.

 

I'm wondering if it's possible to extend the web parts that are built into Sharepoint. And if so, how you would go about it.

 

I'm looking to slightly modify the News web part and was hoping to be able to do something like

import {NewsWebPart} from '@microsoft/sp-news-webpart;
and
export default class MyNewsWebPart extends NewsClientSideWebPart<INewsWebPartProps> {
 
and then just override the methods I need. Rather than re-inventing the wheel.
 
But I'm starting to think it's not possible
 
Any 2 Cents welcome!
2 Replies
best response confirmed by parrtaker65 (New Contributor)
Solution

@parrtaker65 

Sorry, this is not possible as you outlined and there is no expectation at this time to make out of the box webparts open source or release that code.

 

My recommendation is to check out the huge samples repository available in the PnP Community. There are webpart samples there that might have the functionality you want to add to the out of the box webpart, or might be code there that you could use to jumpstart building your custom webpart. If your final product could be useful for others to see, considering contributing back to the repository. (The instructions on doing that are on the website below.)

 

Links to the smples repo can be found at the link below, alongs with a LOT more information on multiple development technologies around Microsoft 365.  Good luck!

 

https://aka.ms/m365pnp 

 

Don Kirkham

Microsoft MVP, Office Development

 

Please click Mark as Best Response & Like if my post helped you to answer or resolve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Wow, guess I shouldn't be typing before my morning coffee. So many typos!!!