Posts

Get all sites with REST API and AngularJS

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>        <script>          var myAngApp = angular.module('SPAngGetWeb', []);          myAngApp.controller('SPAngGetWebController', function ($scope, $http) {              $http({                  method: 'GET',                  url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/webs?$orderby=Title",                  headers: { "Accept": "application/json;odata=verbose" }    ...

List of All Site Templates with REST API and AngularJS

Here is the code which can show you how to display all site templates / custom templates with use of REST API & AngularJS in SharePoint : <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>        <script>          var myAngApp = angular.module('SPAngGetSiteTemplate', []);          myAngApp.controller('SPAngGetSiteTemplateController', function ($scope, $http) {              $http({                  method: 'GET',                  url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/getavailablewebtemplates(103...

Get Web Part Title and Add Link / Text / Image to the right side of the web part title

Here is the code to get web part title and then add image or text or link in web part title and right align that. You have to put this code in Script editor web part or put this code in a file & store somewhere & provide link to master page or provide link to content editor web part // Function to add link/text/icon in right side of the web part title  $(document).ready(function () {     var className='.ms-webpart-titleText';     $(".ms-webpart-chrome-title span h2").each(function(inx){                var webPartTitle = $(this).text();                         //Check web part title         if(webPartTitle.indexOf("My Web Part Title")>=0)         {             var openUrl ="javascript:Ope...

_spPageContextInfo not found on the page

Add the following code to the page : <!DOCTYPE html> <%@ Page language="C#" %> <%@ Register Tagprefix="SharePoint"      Namespace="Microsoft.SharePoint.WebControls"      Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <html> <head> </head> <body>     <form runat="server">         <SharePoint:FormDigest ID="FormDigest1" runat="server"></SharePoint:FormDigest>     </form> </body> </html> You need to add the following code in case of JSOM: <!DOCTYPE html> <%@ Page language = "C#" %> <%@ Register Tagprefix = "SharePoint"       Namespace = "Microsoft.SharePoint.WebControls" ...

Create Responsive Circle

About Let’s see how to create a responsive circle with use of DIV tag in HTML CSS First we need to write some css for the circle: .circle {             margin-left : auto ;             margin-right : auto ;             border-radius : 50% ;             width : 100% ;             position : relative ;             border : 3px solid #D21009 ;             background-color : #d9534f ;         }         .circle:before {             content : "" ; ...