Friday, June 5, 2020

What are Master pages and Page layout in SharePoint?

Ans
Master page
These are the pages that provide a consistent layout and appearance (look and feel) for SharePoint sites. A master Page consist of a Site logo, Top navigation, left navigation(some cases) and a footer. In SharePoint Master Pages are stored in _catalogs folder or Master Page Gallery from UI.

Page layout 
A Layout page defines the Layouts(structure including Webpart zones) of a content page in SharePoint. Layout pages are not same as Master Page. A Layout Page is contained inside the content area surrounded by mater Page.

What are Application Pages, Site Pages and Content Pages?

Ans
Application Pages - An application page is deployed once per Web server and cannot be customized on a site-by-site basis. They stay in 12 hive folder structure, mostly under layouts folder.

Site Pages - These are pages that make up the site interface and are specific to one site or site collection.They mostly get stored in the content database of the site collection.

Content Pages - Site Page which contains webpart or other custom components. This Page is stored in database. They mostly get stored in the content database of the site collection.

What is a Site definition and Site Template?

Ans
Site definition
A Site definition is a collection of Files such as ONET.XML which defines the Site template for e.g. Team Sites used to create a Site in SharePoit. All the out-of-box site Templates like Blog,Wiki,Team Site etc can be found in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\

Site Template
Any Site along with the content can be saved as a template. If a site is saved as a Template it is stored in Site templates folder as a .stp file. This template is then re-used to create a new site which will have the pre-saved settings.

Can we create Web Application in SharePoint Online?

Ans 
We are able to create several site collection in SharePoint online and change its configuration but we can’t make any web application or change web application setting for your existing site collections.

What is the difference between Authentication and Authorization in SharePoint?

Ans
Authentication is the process by which the identity of a user who requests access to a SharePoint web application is verified.  

Authorization, which is the process by which a user is granted access to specific resources within a SharePoint site.  

Simply put, Authentication controls whether or not a user has permission to access sites on a SharePoint web application.  Authorization controls what documents, lists, libraries, etc. a user can access on a SharePoint site once they have been successfully authenticated.

SharePoint 2013 supports the following authentication types:
  • Windows authentication
  • Forms-based authentication
  • SAML token-based authentication

Why we should go for SharePoint framework or its benefits?

Ans
  • It runs in the user context so only the allowable data content will be displayed to an end-user.
  • It is light-weight, fast and responsive as SPFx is completely a client side and uses NodeJS. It is compatible with the Office Fabric UI components and becomes responsive.
  • When the server-side solutions are not used wisely, they might cause a damage from a site collection to an entire SharePoint farm. One can mitigate this risk using the client-side development which is supported by the SPFx.
  • If one’s online tenant is either running on the old SharePoint 2013 classic mode or upgraded to latest tenant feature, then one can have a back seat and relaxed as the SPFx is compatible with both the modern as well as classic pages.
  • In the erstwhile client-side code, one is required to use some extra variables and make some calls for fetching the configurations. Now, this becomes very convenient to use with the SPFx as one can assign the properties of a custom client-side web-parts and configure it accordingly.
  • The SPFx provisions its own deployment mechanism which includes the app bundling, the app packaging, the app shipping to store (or to local SharePoint App Catalog) and deployment in the tenant with the proper permission. The whole process is managed in better way for the client-side web parts.
  • If one is not having internet connection, then also one can develop on the SPFx coming with a local workbench which is effective in developing and testing of a client-side web-parts.
  • It is scalable as not being limited to SharePoint. One can use NodeJS and other component available in NodeJS community in the SPFx client-side development. A client-side web part can be made to interact with Office365, Azure, One Drive, Outlook, etc. with the Microsoft Graph API development.
  • No specific machine related requirement is necessary for the development. One can use any machine-like Windows, Mac or Linux for the client-side development. The only necessity is to set-up the development environment through NodeJS, Gulp and Yeoman template installation of the framework. To develop SPFx web-parts, one is simply required having any text editor.
  • The business logic or code of a client-side web-part is secured as it can’t be accessed from the page source or browser inspect.

How to deploy the spfx webpart?

Ans   Steps of deployment of SPFx solution in SharePoint page
  • Launch the console window and set console path to our SPFx web part directory. If Yeoman server is running on a console you have to stop it by Ctrl+C command followed by Y. 
  • gulp clean command: This command clean the project deployment file .sppkg which is present in folder sharepoint under project directory and also creates debug solution file. 
  • gulp bundle –ship command: This command help to create minified files for build the solution and also generate debug bundle under dest folder. This builds the minified assets required to upload to the CDN provider. The minified assets can be found under the temp\deploy directory. 
  • gulp package-solution –ship command: This creates the updated client-side solution package in the sharepoint\solution folder. Created file: sharepoint\solution\ms-hello-world.sppkg 
  • Now upload or drag an drop solution package file from sharepoint\solution\ms-hello-world.sppkg to App for sharePoint library in app catalog site. 





















  • Once our SPFx web part package has finished uploading, we will be prompted with a dialog window to complete the deployment. This is where you will choose whether to deploy to all sites within your tenant or to all subsites within your site collection. Make your selection and then click the Deploy button. 















  • We have deploy our Hello World SPFx web part. Now we need to add it on modern SharePoint site page.














  • From + Add a new web part icon we select our WP Hello World web part and save it. 












Note: In case we did not select “Make this solution available to all sites in the organization”, we would first have to add SPFx web part to respective site and then we add on page.

On SPFx web part creation SharePoint Youmen Generator will ask “if you would like to allow the tenant admin the ability to deploy the solution to all sites.” If we say Y yes then skipFeatureDeployment property set to true in the package-solution.json file. We also manually set this property from package-solution.json file.