I am a senior SharePoint developer who loves coding. If you have any questions you can contact me through the below form. I work from Monday till Friday. I usually reply to emails by the weekend. So Please expect some delays.
Why get the content type from Content Type Hub(CTH )? Content Type Hub is a centralized location where we manage and publish content types to other web applications. Content Type Hub is actually a Site Collection. "In simple words, it is one place where you get to manage all the content type present in a tenant." To get all the Content Type from ContentTypeHub using REST API V2.* becomes easy now. It involves only the following two steps: Get the site ID of the ContentTypeHub https:// {YourtenantURL} /sites/contentTypeHub/_api/site Get all content types https:// {YourtenantURL} /_api/v2.1/sites/ {siteID of ContentTypeHub} /contentTypes Step 1: I am g etting the site ID of the ContentTypeHub by calling the REST API. As this is still from V1.0 endpoint, after '/api' , there is no need to mention the endpoint version. In the success method, I am calling the method getAllContentTypes which will get the content types. var siteURL=_spPageContextInfo.siteAbsoluteUrl;
The Location field in SharePoint has been announced in February 2019 - ( https://techcommunity.microsoft.com/t5/sharepoint/add-location-details-to-sharepoint-data-and-content/m-p/284875 ). Before this announcement, data has been saved as addresses and coordinates(Latitude, Longitude) in different columns in SharePoint because if they have to be filtered by address, city, or state. The data of the location column is saved with all these details: Image 1 If you want to save only the coordinates, you can pass only that value to the location column while saving the item. If you want to save, only the address like city, country and Pincode, you can pass only those values to the location column. I initially thought because it is a location column you have to pass the coordinates for saving. But, there is no mandatory value that needs to be passed to save the value for the location column and that is really useful. Save Location Details through SPFx/PnP JS: In this example, I am going to
A QR Code is a 2-dimensional bar code, which is generally used to encode a URL so that the user can scan the code using his/her smartphone to visit the concerned site. The camera/s of the latest smartphones can scan the QR code without having to install a separate app. Paytm is an example of how people started using QRCode widely nowadays. Installation Inside your SPFx project folder, run the below command from the terminal or node command prompt npm install --save qrcode or, install it globally to use the QR Code from the command line to save QR code images or generate ones you can view in your terminal. npm install -g qrcode Usage In your SPFx web part code, in the component file(.tsx/.ts), add the QR Code reference as below. var QRCode = require( 'qrcode' ); In the render() method, add the image tag to render the QR Code image. <img id= "myQRcode" height= "100%" width= "100%" /> Instead of using the canvas element, the publisher he
Comments
Post a Comment
Thank you for your comment.