Build And Deploy The Client Side Web Part (SPFx) In SharePoint Online

In the previous article, we saw how to create a new client Webpart (SPFx) for SharePoint Online with React template.

What is SPFx?

  • SPFx is introduced in SharePoint 2016. It is one of the new features in SharePoint.
  • SharePoint app model development is used before SPFx. It was introduced in SP 2013.
  • SharePoint apps client Web parts are loaded inside an IFrame, so its takes some time to load but SPFx is not like it and is fast.
  • We can use SPFx in SharePoint pages and SharePoint modern site pages. in the previous article, we saw how to create modern site page and how to add the Web part inside the modern site pages.
  • Client-side Web parts are client-side components, which runs inside the context of a SharePoint page.
  • Client-side Web parts can be deployed to SharePoint Online and you can also use modern JavaScript tools and libraries to build them.

Client-side Web parts support the features, which are given below.

  1. Building with HTML and JavaScript.
  2. Both SharePoint Online and on-Premises environments.

Steps

Follow the steps given below to take build and deploy SPFx,

Step 1

Open the cmd prompt, once your development is done.

SharePoint

Step 2

Run the command given below to clean the project and subsequently press enter.

gulp clean

SharePoint

Step 3

Before you run the Gulp bundle, make the change of CDN path (folder from document library or original CDN path), go to config/write-manifests.json file.

SharePoint

Step 4

Now, run Gulp bundle –ship and SharePoint Framework will generate debug bundles in the dist folder.

gulp bundle –ship

SharePoint Framework supports two types of builds, which are a debug build and a release build. Both are triggered, using the Gulp bundle task

SharePoint

If you request a release build, using the gulp bundle –production or gulp bundle –ship command (the production and ship arguments are interchangeable and using either of them gives exactly the same result). SharePoint Framework will generate optimized bundles and copy them to the temp/deploy folder.

Step 4

Finally, run the gulp package-solution –ship. To create .sppkg file, it must deployed in SharePoint app catalog.

This .sppkg file is locating in SharePoint folder inside the project folder.

SharePoint

Package process is done.

SharePoint

Once we run the commands given above, then get the bundle file from your project folder,

Open your project folder – Temp – deploy.

SharePoint
SharePoint
In deploy folder, copy all the files and add in SharePoint library path or CDN, which you mentioned in write-manifests.json file.

SharePoint
Upload the files to SharePoint document library.
SharePoint
Once you completed the steps given above, upload the app in an app catalog and install in your SharePoint site.

Get .sppkg file from <project folder> – Sharepoint – solution – <helloworldsample-webpart.sppkg>

SharePoint folder

SharePoint
Inside SharePoint folder, click solution folder to get .sppkg file,

SharePoint

Inside solution folder, copy the .sppkg file and upload it in an app catalog.

After you uploaded the app file, you will get the pop up, as shown below and click Deploy to trust the client side Webpart.
SharePoint

Now, install the app and add the client app part in your pages or modern site pages.

Refer to the URL given below.

The Web part will be available, which is based on the group name, which you provided in HelloWorldSampleWebPart.manifest.json file.

SharePoint

Finally, client side Webpart (SPFx) has been deployed successfully.

SharePoint

Summary

In this article, we have explored how to take the build for client side Web part and deploy the Web part in SharePoint Online.

Advertisements

Create An Alert And Manage An Alert For Page In SharePoint Online

What are SharePoint Alerts?

It is an email notification or SMS that can be sent from SharePoint when someone changes the page, list, and libraries.

  • Alert is one of the best out-of-the-box features in SharePoint online.
  • This is very useful to track the pages, Lists, document libraries
  • Alerts can be used for different business scenarios

Let me share the steps here to create and manage the alerts in SharePoint.

Steps to create an alert

In this example, I am going to create an alert for home page.

Follow the below steps to create an Alert.

Step 1

Open your SharePoint site.

SharePoint

Step 2

Then, click the page tab on the SharePoint site.

SharePoint

Step 3

On the top ribbon, you can see the “Alert me” button, just click it.

SharePoint

Step 4

When you click on the “Alert Me” button, you get an option to “SET AN ALERT ON THIS PAGE” (create new alert) and “MANAGE MY ALERTS” as shown below.

SharePoint

Step 5

Click the “Set an alert on this page” to create a new alert. When you click on that, it will show a popup as shown below.

SharePoint

Step 6

In the pop up window, you need to provide the below properties to create a new alert.

  • Alert Title
    Enter the title for this alert. This is included in the subject of the notification sent for this alert.
  • Send Alerts to
    You can enter user names or e-mail addresses. Separate them with semicolons.
  • Delivery method (Either email or SMS)
    Specify how you want the alerts delivered.
  • Send me an Alert when?
    Specify whether to filter alerts based on specific criteria. You may also restrict your alerts to only include items that show in a particular view.
  • When to send alerts
    Specify how frequently you want to be alerted (mobile alert is only available for immediate sending).

    SharePoint

    SharePoint

Step 7

Once you provide all the required information,click “OK” to save the alert.

SharePoint

Finally, your alert will be created successfully. Whenever you or someone makes any changes on the page, the configured email address will get email with subject of Alert title.

SharePoint

Steps to Manage the Alert

We have seen how to create a new alert. Now, let me share the steps to manage the alerts for the page.

Step 1

Follow the Above first 4 same steps for manage the alerts.

Step 2

Then, click the “Manage My Alerts” option to change the previously created alerts. When you click on that, it will take you to the My Alerts page.

SharePoint

Step 3

Click on the alert which you want to edit.

SharePoint

Step 4

Then, you can edit the alert details based on your requirement. Here, I am changing the Alert Title (Subject) and when to send Alerts.

SharePoint

SharePoint

Step 5

Click “OK” to save the alert changes.
SharePoint

Finally, your changes will be reflected on the “My Alert on this site” page.

SharePoint

Summary

In this article, we explored how to create alerts and manage the alert for particular pages in SharePoint online.

Uninstall (Remove) The Apps Or Client Side Web Part (SPFx) In SharePoint Online

In a previous article, we saw how to install the SharePoint apps and client side web part in SharePoint site. In this article, we are going to see the steps for uninstalling the SP apps and SPFx.

  • Site Owners can remove the app from the SharePoint site
  • Once you remove the apps, the client web part will be removed from all the pages
  • Several circumstances might influence farm administrators and site owners to remove apps from their sites.

For example, an app for SharePoint may no longer be needed or could become too much of a distraction to employees. The following procedure provides steps for removing (or uninstalling) an app.

Steps to uninstall the SharePoint apps

Follow the below steps to remove the app from your SharePoint site.

Step 1

Open your SharePoint site.

SharePoint

Step 2

Then, click on Site content from left navigation or using gear menu.

SharePoint

Step 3

On the Site contents page, select the app and click the ellipsis button, as shown below.

SharePoint

Step 4

After you click the ellipsis button, you can see the “REMOVE” option to uninstall the app.

SharePoint

Step 5

Click on the “Remove” button. It will show the confirmation dialog. Click “OK” for confirmation of removal of the app.

SharePoint

Step 9

Wait until it removes the app or client side webpart.

SharePoint

Finally, the app or client side (SPFx) webpart will be removed from your site.

SharePoint

Summary

In this article, we explored how to uninstall the SharePoint apps (.app) and client side web part – SPFX (.sppkg) files in SharePoint Online.

Install Apps And Client Side Webpart (SPFx) In SharePoint Online

SharePoint Apps overview

  • Apps for SharePoint provide a new method to deliver specific information or functionality to a SharePoint site
  • SharePoint 2013 introduces the “Cloud app model”, it enables you to create apps
  • Microsoft will host and control a public SharePoint Store, where developers will be able to publish and sell their custom apps for SharePoint
  • SharePoint apps have self-contained functionality that extends the capabilities of a SharePoint web application
  • Apps are essentially web applications that run “outside” of a SharePoint host web
  • It’s an easy to use, stand-alone app that solves specific end-user or business needs
  • We can use any language for creating the apps, such as HTML, PHP, .NET and web development tools and so on
  • By using “NAPA” we can create SharePoint apps
  • We can use the Client Object Model (CSOM) to talk to SharePoint
    • JavaScript for Asynchronous
    • .NET for Synchronous

Refer the below Article for SP Apps,

http://www.c-sharpcorner.com/UploadFile/93cb27/apps-in-sharepoint-2013/

SharePoint SPFx overview

  • SPFx was introduced in SharePoint 2016, and it is one of the new features in SharePoint
  • SharePoint app model development is used before SPFx, it was introduced in SP 2013
  • SharePoint apps client web parts are loaded inside the IFrame so takes some to load but SPFx is not like that, it is very fast.
  • We can use the SPFx in SharePoint pages and SharePoint Modern site pages. In the previous Article we saw how to create modern site pages and how to add the web part inside the modern site pages.
  • Client-side web parts are client-side components that run inside the context of a SharePoint page.
  • Client-side web parts can be deployed to SharePoint Online, and you can also use modern JavaScript tools and libraries to build them.

Client-side web parts supports below

  1. Building with HTML and JavaScript.
  2. Both SharePoint online and on-premises environments.

Refer the below Article for SPFx Creation:

Steps to Install the app

Follow the below listed steps to install the Apps & SPFx webpart

Note

Before you install the app make sure that app should be uploaded in app catalog.

Refer to the below URL to upload the app in appcatalog,

http://www.c-sharpcorner.com/UploadFile/93cb27/upload-app-file-in-sharepoint/

Step 1

Open your SharePoint site

SharePoint

Step 2

Go to site contents page using gear menu or left navigation as shown below

SharePoint

Step 3

On the site contents page click on “Add an app” to install the app

SharePoint

Step 4

Then select “From your organization” on your apps page.

SharePoint

Step 5

On the organization page select the app which you want to install, I’ve selected helloworldsample client side webpart for the installation

SharePoint
Step 6

After you selected the app, Installation will be started as shown below

SharePoint

Finally app or client side web part installation will be done in your SharePoint site

SharePoint

The same above steps to install the SharePoint apps are also in SP online.

Summary

In this article we have explored how to install the client side webpart (SPFx) and SharePoint hosted apps in SharePoint online site.

Create New SharePoint Client Side Web Part (SPFx)

What is SPFx?

  • SPFx was introduced in SharePoint 2016, it is one of the new feature in SharePoint
  • SharePoint app model development is used before SPFx, it was introduced in SP 2013
  • SharePoint apps client web parts are loaded inside the IFrame so it takes some time to load but SPFx is not like that, it is very fast.
  • We can use the SPFx in SharePoint pages and SharePoint Modern site pages. In a previous Article we saw how to create modern site page and how to add the web part inside the modern site pages.
  • Client-side web parts are client-side components that run inside the context of a SharePoint page.
  • Client-side web parts can be deployed to SharePoint Online, and you can also use modern JavaScript tools and libraries to build them.

Client-side web parts supports below,

  1. Building with HTML and JavaScript.
  2. Both SharePoint online and on-premises environments.

Steps

Follow the below listed steps to build your first web part,

Step 1

Open the Command prompt from your location on windows explorer.

SharePoint

Step 2

Then write the below command on your cmd prompt to create new project and press enter

md helloworldSample-webpart

SharePoint

Step 3

Next go to that project directory by using below command to create new web part and press enter to run the command

cd helloworldSample-webpart

SharePoint

Step 4

Then Run below command to create a new web part using yeoman SharePoint Generator, press enter to run

yo @microsoft/sharepoint

SharePoint

Step 4

Then next set of prompts will ask the specific below information about our web part, then press enter

  • Solution Name – Provide your web part name as your requirement
  • Where do you want to place the files? I selected the current folder
  • What framework would like to start with? – I selected React template for my web part
  • What is your web part name? Provide name for your web part (HelloworldSample)
  • What is your web part description? Provide description of your webpart

    SharePoint

Once you provide all the information yeoman will install required dependencies and scaffold the solution files along with the HelloWorldSample web part

SharePoint

Step 5

Using Visual code we can do the client side development

Open the Project using visual code,

SharePoint

Step 6

Then run the below command to preview your web part, build and run it on a local web server.

To install the developer certificate for use with SPFx development, switch to your console, make sure you are still in the

gulp trust-dev-cert

SharePoint

Once you installed the developer certificate enter the following command in the console to build and preview the web part,

gulp serve

SharePoint

Finally you can see the web part in local host itself, Press + (add) button to add the hello world sample web part

SharePoint

Using SharePoint work bench URL we can see the preview of client side webpart

URL for workbench: ../sites/dev/_layouts/15/workbench.aspx

SharePoint

Summary

In this article we have explored how to create new client side web part with react template. In the next article I will share how to take a build for client side web part.

Add In Built Web Parts In SharePoint Modern Site Page

In the previous article, we have gone through how to create a new SharePoint modern site page. Here, we are going to add Yammer embedded Web part and site activity Web part on SP modern site page.

What is SharePoint modern page?

  • This is one of the new features in SharePoint 2016.
  • Modern team site pages are fast, easy to author and support rich multimedia content. The pages looks great on any device, in a Browser or from within SharePoint app.
  • SPFX (SharePoint Client site Framework) Web part can be easily added in modern pages.
  • These pages are built with Web parts, which you can customize according to your requirements. We can add the things given below in SP modern site pages.
    • Videos
    • Documents
    • Yammer embed feeds
    • Images
    • Site Activities
  • Using pages is a great way to communicate and share your ideas such as status and trip reports, how to write write-ups, know-before-you-go guides and frequently asked questions.

Steps

Follow the listed steps given below to add the in-built Web parts to modern site page.

Step 1

Open your SharePoint site.

SharePoint

Step 2

Go to site contents page, using Gear menu, as shown below.

SharePoint

Step 3

Now, select site pages library on site contents page.

SharePoint

Step 4

On the site pages library, open SP modern site page, which you have created before.

SharePoint

Step 5

Now, click Edit the page to add the Web part.

SharePoint

Step 6

On the page, click + (Add) button, followed by selecting the Web part, which you want to add.

  1. I selected the Site Activity Web part.

    SharePoint

Site Activity web part will be added in your site page.

SharePoint

Step 7

Now, click Add button to add one more Web part. I selected Yammer embed feed Web part.

SharePoint

Step 8

Now, add web part given below and the properties for Yammer embed Web part are given below.

  1. Web Address – Provide your Yammer Web address, select any group.
  2. Display Size

    SharePoint

Step 9

After you added the Web part, click Save and Close the modern site page.

SharePoint

Finally, your web part will be added successfully. Once all the changes are done, publish the page.

SharePoint

Summary

In this article, we explored how to add Yammer embed feed Web part and site activities in built Web part on SharePoint modern site page.

Create Page Layout Using Design Manager In SharePoint Online

What is page layout?

In SharePoint, we can create publishing pages and we can design our publishing pages, as we need.  SP 2013 has introduced Design Manager. Using page layout, we can create multiple pages with a single template. Also, we can include the in–built Web parts on the page layouts like Content editor, Script editor etc.

Page layouts help to dictate the overall look and feel of a Web page. A page layout relies on a content type to determine the kind of the content, which can be stored on the pages, which use the page layout. Content for the page is stored in the fields on the page. When you view or edit a page, the content is displayed in the field controls. When you create a page layout, you add field controls, using a Windows SharePoint Services-compatible Web authoring tool, such as Microsoft Office SharePoint Designer.

Steps

Follow the listed steps given below to create page layout in SharePoint.

Step 1

Go to your SharePoint site.

SharePoint

Step 2

Now, click Site settings from Gear menu, as shown below. You will be navigated to site settings page.

SharePoint

Step 3

On site settings page, select Design Manager in look and feel section.

SharePoint

Step 4

On Design Manager page, click 6.Edit Page Layouts from the left navigation, as shown below. Now, you navigate to the page.

SharePoint

Step 5

On Edit page layouts page, you can see the option to create new page layout

SharePoint

Step 6

Click Create a new page layout and you will get the pop up.

SharePoint

Step 7

On the pop up, provide the following.

  • NAME: Name of the page layout.
  • Master Page : Select the master page. I selected as Seattle.
    • Page layouts fits within a master page’s content placeholders. Choose this page layout’s master page.
  • Content Type : I selected the Article page.
    • All the types of the pages are not the same. You might want to have a picture for some or to show the author for others. Content Type determines the availability of these fields. Advanced users can also modify and create new content types.

      SharePoint

Step 8

Click OK to create a new page layout, as shown below.

SharePoint

Finally, page layout will be created successfully. Now, you can edit the page layout and we can add the Webpart zones and inbuilt Webpart , as per our requirement.

SharePoint

Summary

In this article, we explored how to create page layout in SharePoint, using Design Manager.

Set Wiki Page As Home Page In SharePoint Online By Activating The Feature

In the previous article, we saw how to set the Welcome page in SharePoint.

What is a Wiki page?

A Wiki is a site, which is designed for groups of people to quickly capture and share ideas by creating simple pages and linking them together. Your organization can use a Wiki for a variety of uses. On a large scale, you can share large volumes of information in an Enterprise Wiki. On a smaller scale, you can use a team site as a Wiki to gather and share ideas quickly about a project.

Now, SharePoint is providing an option to set a Wiki page as a home page. Let us go through the steps to activate the feature.

Steps

Follow the listed steps given below to set Wiki page as a home page.

Feature

SharePoint

Step 1

Open your SharePoint site.

SharePoint

Step 2

Go to site settings page by using Gear menu, as shown below.

SharePoint

Step 3

On site settings page, select Manage site features from Site Action.

SharePoint

Step 4

Now, scroll the page down and you can see “Wiki Page home page” feature, as shown below.

SharePoint

Step 5

Click Activate to set Wiki page as a home page.

SharePoint

Finally the feature will be activated and Wiki page will be set as a home page.

SharePoint

Now, go to your home page by clicking home icon on SP site.

SharePoint

Summary

In this article, we explored how to set Wiki page as a home page in SharePoint site by activating the feature.

Create Modern Site Pages In SharePoint Online

What is SharePoint modern site page?

  • This is one of the new features in SharePoint 2016.
  • Modern team site pages are fast, easy to author and support rich multimedia content. And pages look great on any device, in a browser or from within the SharePoint app.
  • SPFX (SharePoint Client site Framework) web part can easily add in modern pages.
  • These pages are built with the Web parts, which you can customize according to your requirements. We can add the things given below in SP modern site pages.
    • Videos
    • Documents
    • Yammer embed feeds
    • Images
    • Site Activities
  • Using pages is a great way to communicate and share your ideas such as status and trip reports, how-to write write-ups, know-before-you-go guides and frequently asked questions.

Steps

Follow the steps given below to create a modern site pages.

Before you create modern page, you should activate the Site Pages feature on your SharePoint site.

SharePoint

Activate the site page feature

Step 1

Open your SharePoint site.

SharePoint

Step 2

Go to site settings, using Gear menu.

SharePoint

Step 3

On site settings page, select Manage site features from site action section, as shown below.

SharePoint

Step 4

Now, scroll down the site feature page and activate the Site Pages Features.

SharePoint

Finally, site pages feature will be activated successfully.

SharePoint

Create modern site page

Once we have activated the site page feature; we can create a modern site pages on our site.

To create modern site page, follow the steps given below.

Step 1

On your SharePoint site, go to site contents page, using Gear menu or using navigation.

SharePoint

Step 2

Now, open the site pages library on the site contents page.

SharePoint

Step 3

On Site pages library, click the files options from top ribbon bar, as shown below.

SharePoint

Step 4

From the top ribbon, select the New Document, you will get the dropdown, as shown below.

SharePoint
Step 5

Click Site page option from the dropdown.

SharePoint
Step 6

When you click the site page, you will navigate to the modern site page.

SharePoint
Step 7

Provide the name for the page, click Save and close option to save the page.

SharePoint

Finally, modern site page will be created successfully.

SharePoint
Summary

In this article, we have explored what modern pages are and how to create new modern pages on SharePoint Online site.

Create New Search Result Source For SharePoint Online

What is Search?

  • SharePoint Search is used to get the keyword results from SharePoint sites, using search query.
  • Search center is used to show the results from the site, using keywords.
  • In Search center, there are several pages and they are called search verticals.
  • We can customize the search vertical, as we need. The default search verticals in SharePoint online are given below.
    • People
    • Conversation
    • Videos
  • SharePoint provides lots of options to customize the search results, as we require.

Steps to create Search Result Source

Follow the listed steps, mentioned below to create Search Result Source.

Step 1

Open SharePoint site, where you need to create the search result source.

SharePoint
Step 2

Select “Site settings” from gear menu, as shown below.

SharePoint
Step 3

On “Site Settings” page, click “Search Result Source” under site collection administration.

SharePoint

Step 4

You will navigate to “Manage Result Source page”, as shown below.

SharePoint

Step 5

Subsequently, click “Create New Result Source” on Manage Result source page.

SharePoint

Step 6

On “Manage Result Source” page, provide the values, mentioned below in the respective fields.

  • Name- Name of the result source.
  • Description- Description of the result source.
  • Protocol- Select Local SharePoint.
  • Type- Select SharePoint Search Results.
  • Search- Results enable this, if you need to show the search results only when the results set is complete, select does not show partial search results.
  • Query Transform {searchTerms}
  • redential Information: Anonymous (by default, it selects anonymous options and options are disabled).

    SharePoint
    SharePoint

Step 7

Click the Launch Query builder on the pop up to create a query as you need.
SharePoint
Step 8

Click Test Query to test your query, check your results and click OK.

SharePoint

Step 9

Finally, click save to create search result source.

SharePoint
Search result source will be created successfully.

SharePoint

Summary

In this article, we have explored how to create a search result source in SharePoint Online.