Forum Discussion
Custom Sites web part
Hi vish3027,
I case just a layout change is enough, you might want to use PnP Modern Search Web Part.
https://github.com/microsoft-search/pnp-modern-search/releases/download/3.14.2/pnp-modern-search-parts.sppkg
All you need to do is adjust your query on Search Results Web Part and you can design you own layout with HandleBars template.
For search query template you can use this.
contentclass:STS_Site AND DepartmentId={<Hub site id>}
You can edit your display template from web part settings or create a HandleBars template file and link it to web part.
Template editor
- vish3027Aug 21, 2020Copper Contributor
I want to create exact copy of SITES web part only changes will be Header section styling and Overall height.
I am not sure about how the data/content coming into SITES web part.
I will refer your solution as well.
Thanks
- ganeshsanapAug 21, 2020MVP
vish3027 If you just want to change the CSS of single web part then you can use Modern Script Editor web part and add your custom CSS to SharePoint page.
Alternatively, you can create a SPFx Application customizer and apply your custom CSS to your SharePoint pages/webparts.
Overview of SharePoint Framework Extensions
Please click Mark as Best Response if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it Like.
- vish3027Aug 21, 2020Copper Contributor
Hello ganeshsanap
I have Modern Script editor on page and currently i have applied css using that only.
But there are updates changes coming from Microsoft which causing change in name structure classes and because of which changes applied through Modern script editor were lost, In last 2 weeks there are 4 times i have updated my css structure because of updates.
For that reason only i am looking for custom webpart soultion.
Application customizer, I am currently trying this as well. If you have any sample solution where you applied css to webaprt with App custo. that will help me as well.
Thank You