Showing posts with label sharepoint 2013. Show all posts
Showing posts with label sharepoint 2013. Show all posts

Sunday, 26 March 2017

Run executeQueryAsync() synchronously SharePoint 2013

In JSOM, to fetch the data from the server we make a call through executeQueryAsync(). This works asynchronously by default.We need to make executeQueryAsync() behave synchronously.

That means we have to make this function wait till the operation gets completed and should return some values , then proceed to the next function.

This can be done by using JavaScript callbacks and deferred/Promises.
The promises pattern significantly simplifies JavaScript code when you make an app, which has multiple, nested asynchronous calls and it makes it very powerful.



<script type="text/javascript">
    var camlValues;
    $(document).ready(function () {
             
        SP.SOD.executeFunc('sp.js', 'SP.ClientContext', getItems);
    });
 
    function getItems() {
        getListItem('Test list').done(function()
{
        console.log(“Second Console Pass”);  
}).fail(function()
{
 console.log(“Second Console Fail”);  
});            
    }
 
    function getListItem(listTitle) {

      var deferred=$.Deferred();
        var clientContext = new SP.ClientContext.get_current();
        var olist = clientContext.get_web().get_lists().getByTitle(listTitle);
        var camlQuery = new SP.CamlQuery();
        ocamlItems = olist.getItems(camlQuery);
        clientContext.load(camlValues);
        clientContext.executeQueryAsync(
            Function.createDelegate(this, this.success),
            Function.createDelegate(this, this.failure)
        );

return deferred.promise();
    };
 
    function success(sender, args) {
        var listItemEnumerator = ocamlItems.getEnumerator();
        while (listItemEnumerator.moveNext()) {
            var olistItem = listItemEnumerator.get_current();
console.log(‘First Console Pass ‘);
             
deferred.resolve(olistItem );
        }
    }
 
    function onQueryFailed(sender, args) {
        console.log('An error occured while retrieving list items:' + args.get_message());

deferred.reject(olistItem );
    }
</script>





For the code given above, we will get the output, as shown below.

First Console Pass
Second Console Pass


Thanks.. Happy Coding..

Thursday, 23 March 2017

Author(Created By) Managed Property having more than one user in Odata search results SharePoint 2013

Hi All,
 
In our project we faced an issue in search query. Our requirement is to show all the requests raised by the current user in a page. So Basically we need to use "Created By" field in Search Rest end point url. Initially we used the following Rest end point url to retrieve the requests.
 
<Site_URL>/_api/search/query?querytext='Author:"<Current User Login Name>"
 
Please Note that we have used the managed property "Author" as it is the internal name of "Created By". 
Later we got an issue that more than one user was able to see the same request . Logically "created by" will be only one user. The issue is because "Author" property has the user who created the item and also the user who last modified the item. So the item was visible for both creator and last modified user.
 
For this we found an other managed property AuthorOWSUSER which resolved our issue.
 
So the final rest end point url is
 
<Site_URL>/_api/search/query?querytext='AuthorOWSUSER:"<Current User Login Name>"

Thank You 
Happy Coding ☺

Wednesday, 1 March 2017

Programmatically update the site title in SharePoint 2013

Hi All,

 Today I tried to update the Title of a Site in SharePoint.
I thought it will be as direct as spweb.Title="My new title";

But it was not so. U have to do the below code to update the Site title.

                    SPUserResource resource = oweb.TitleResource;
                    foreach (CultureInfo culture in oweb.SupportedUICultures)
                    {
                        resource.SetValueForUICulture(culture, txtTitle.Text);
                    }

This takes care of the multilingual behaviour of SharePoint and updates the Site Title in the browser.

Happy Coding

Friday, 6 January 2017

Create Publishing Page using Custom PageLayout by PowerShell in SharePoint 2013

Hi - Today i will share the code for creating Publishing Page based on a custom Pagelayout using powershell


$siteUrl="ur site URL here"

$site = Get-spsite $siteUrl
$web = $site.OpenWeb()
$pubWeb =[Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
#Name of the page layout. It can also be your custom template
$pl = $pubWeb.GetAvailablePageLayouts() | Where { $_.Name -eq "BlankWebPartPage.aspx" }
$newPage = $pubWeb.AddPublishingPage("newpage.aspx", $pl)
$newPage.CheckIn("")
$newPage.ListItem.File.Publish("")
$web.Dispose()

Happy coding..

Friday, 25 November 2016

remove a term from managed metadata column in Sharepoint




Hi All,

 Today I will share you the code for removing a single term from a Managed Metadata (- multivalue) column in a list.

Name of the List - "Todo List"
Name of the Managed metadata column - "TodoColumn"
Values it is holding at present - "Lesson 1" , "Lesson 2" , "Lesson 3" , "Lesson 4"
Value to be removed - "Lesson 1"

Now we will see the code :


   SPList list = oweb.Lists["Todo List"];
                    SPQuery oQuery = new SPQuery();
                    oQuery.Query = " <Where><Eq><FieldRef Name='TodoColumn' /><Value Type='TaxonomyFieldTypeMulti'>Lesson 1</Value></Eq></Where>";
                    SPListItemCollection collListItems = list.GetItems(oQuery);
                    foreach (SPListItem oListItem in collListItems)
                    {
                        TaxonomyFieldValueCollection tfc = oListItem["TodoColumn"] as TaxonomyFieldValueCollection;
                        tfc.Remove(tfc.Where(i => i.Label.Equals("Lesson 1")).FirstOrDefault());
                        oListItem["TodoColumn"] = tfc;
                        oListItem.Update();
                    }
                    list.Update()


Thats's it :)

Have a great day... Happy coding :))))

Friday, 4 November 2016

SharePoint - Programmatically get Friendly URL of Publishing pages

Hi Guys - After so long time, I am posting this. I got so busy in my project. Finally I am getting some time to post this. I got his requirement of finding the Friendly URL of Publishing pages.

Code is given below. Hope this helps someone.



using (SPSite osite = new SPSite("site url"))
            {
                using (SPWeb oweb = osite.OpenWeb())
                {
                    SPList olist = oweb.Lists["Pages"];
                    foreach (SPListItem item in olist.Items)
                    {
                        var associatedTerms = TaxonomyNavigation.GetFriendlyUrlsForListItem(item, false);

                        string url = string.Empty;
                        if (associatedTerms.Count > 0)
                        {
                            url = associatedTerms[0].GetResolvedDisplayUrl(string.Empty);
                        }
                    }
                }
            }


Happy Coding :)

Friday, 25 December 2015

REST End point URLs - SharePoint 2013

Today I will be sharing the Service End point URLs for the SharePoint 2013. To access SharePoint resources using REST, construct a RESTful HTTP request, using the Open Data Protocol (OData) standard, which corresponds to the desired client object model.

Example :

List Name - Products

Columns - Title , Company , Products , Manager

In which Title , Company are Single Line of Text columns.
Company is a lookup column ( LookUp list - Company Names  and It is Looking up to the column Company name with Internal Name Title ) .
Manager is a people Picker Column.

Service call for accesssing the columns would be -

(Always use Internal names for the columns and Display names for the List)
https://halyardhealth.sharepoint.com/sites/SPDEV/_api/web/lists/getbytitle('Products')/items?$select=Title,Products,Company/Title,Manager/Title&$expand=Company,Manager

For Lookup and People picker colums we have to expand the column like above

For applying the filter on the above query -

https://halyardhealth.sharepoint.com/sites/SPDEV/_api/web/lists/getbytitle('Products')/items?$select=Title,Products,Company/Title,Manager/Title&$expand=Company,Manager&$filter=Products eq 'Product 1'

https://halyardhealth.sharepoint.com/sites/SPDEV/_api/web/lists/getbytitle('Products')/items?$select=Title,Products,Company/Title,Manager/Title&$expand=Company,Manager&$filter=Company/Title eq 'Company 1'

For applying multiple filters :

https://halyardhealth.sharepoint.com/sites/SPDEV/_api/web/lists/getbytitle('Products')/items?$select=Title,Products,Company/Title,Manager/Title&$expand=Company,Manager&$filter=((Products eq 'Product 1') and(Company/Title eq 'Company 1'))

From the next post onwards I will be providing the codes for CRUD operation on Sharepoint 2013 list using Rest api.

Happy Coding...

Wednesday, 11 November 2015

All about "App Step" in SharePoint 2013

Impersonation Step workflow action had been deprecated in SharePoint Designer 2013. !!!
Yet , In SharePoint Designer 2013, you can choose the SharePoint 2010 Workflow platform during creation and still have all of those workflow actions available.

Even though we have the option to choose 2010 workflow and go for Impersonation Step, the best option is to leverage the App Step in 2013 workflows.

A SharePoint Designer workflow will run under the permissions of the user who started the workflow. Certain steps of the workflow may require the user to have more permissions than you intend to grant them. If elevated permissions are not used, the workflow will not work, and you will likely receive an access denied error or the workflow will not execute at all.

In 2010 workflow we had Impersonation Step to overcome this. when the workflow enters the Impersonation Step, it runs under User's account who published the workflow.

Drawback in Impersonation Step :

The one drawback of using an Impersonation Step is that the workflow could suddenly stop working if anything were to happen to the user account that created and published the workflow. The purpose of the Impersonation Step is to run any actions inside this step as the user who authored the workflow. If the account that creates and publishes the workflow is edited in some way, possibly with a permission change on the site or a password change, then you have a broken workflow.


This has been overcome in the 2013 SharePoint Designer's App step:

Any actions you now place within this App Step can read from and write to all items in the site. And this does not depend on the user's account who has published the workflow.

So the actions that runs under the App Step will run under "System Account".
To get more details about "System Account" in SharePoint , check my another post here.


To Enable App Step in workflow, follow the below procedures


  • Go to Site Settings.
  • In the Site Actions section, select Manage site features.
  • Locate the feature called Workflows can use app permissions, as shown in the figure, and then click Activate.


Now you can see App step in your 2013 designer workflow.

Happy SharePointing.....

Thursday, 17 September 2015

Not able to create a Page Layout in SharePoint 2013 - Fixed

Hi All,

Recently I faced a weird problem while trying to create a new page layout from SharePoint Designer. Our environment got upgraded from 2010 to O365 recently.
Actually the error details were this:

When I tried to click on the Create New Page Layout link, I got "An unexpected error has occurred" message with a correlation ID. Even though we got the Correlation ID, it was not as easy as on-premises environment to go and check the logs.

So obviously I came for the help from Google and as usually it helped me in figuring it out.

Solution is as follows:


  • First check whether you are the Site Collection Administrator.
  • Then go to the Site Features, Disable SharePoint Server Publishing feature and go to the Site Collection features, Disable SharePoint Server Publishing Infrastructure feature
  • Then again Enable SharePoint Server Publishing Infrastructure in Site Collection Features . After that go to Site features and Enable SharePoint Server Publishing.


Now try to create a page layout. It works :)

Thanks for reading. Hope it helps..

Sunday, 30 August 2015

How to programmatically get the Titles and Guids of all the lists in a Sharepoint site.

Hi all, Below code is used to get the details of all lists in the Site using CSOM.
I have logged the details in console. You can manipulate the data as per the requirement.

$(document).ready(function () {
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext');
    retrieveAllListProperties();
});


function retrieveAllListProperties() {

    var clientContext = new SP.ClientContext(siteUrl);
    var oWebsite = clientContext.get_web();
    this.collList = oWebsite.get_lists();
    clientContext.load(collList);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded),       Function.createDelegate(this, this.onQueryFailed));

}

function onQuerySucceeded() {

    var listInfo = '';
    var listEnumerator = collList.getEnumerator();
    while (listEnumerator.moveNext()) {
        var oList = listEnumerator.get_current();
        listInfo += 'Title: ' + oList.get_title() + ' Guid: ' + oList.get_id().toString() + '\n';
    }
    console.log(listInfo);
}

function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}


Happy Coding :)

Sunday, 26 July 2015

Get current user using javascript - SharePoint client object model

Hi All,

  In this post we will see about, getting the loggedin Username using Javascript only.
In Client object model , to get the value of the loggedin User, mostly everyone will go for $().SPServices.SPGetCurrentUser. SP Services ibrary has tons of uses and is very easier.
But we can do this without referencing a third party library, if your requirement is like so.

Below given is the code for it.

function getCurrentUser()
{
var context = new SP.ClientContext.get_current();
this.website = context.get_web();
this.currentUser = website.get_currentUser();
context.load(currentUser);
context.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}



function onQuerySucceeded(sender, args)
 {
 alert(currentUser.get_loginName());
 }



function onQueryFailed(sender, args)
{
alert('request failed ' + args.get_message() + '\n'+ args.get_stackTrace());
}

Hope this helps somewhere. Happy coding..

Wednesday, 15 July 2015

Programmatically getting the values from a SharePoint list view

Hi,
 Today I will share the code for getting the values of the items in a particular view through Client Side Object Model.
For this we have to make 2 requests. First request is to get to know which view & view query and second would be for getting the values from that view.

$(document).ready(function () {
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', getItemsFromView);
});

// First request
function getItemsFromView()
{
    var context = new SP.ClientContext.get_current();
    var list = context.get_web().get_lists().getByTitle('List Name');
    var view = list.get_views().getByTitle('View Name');
    context.load(view);
    context.executeQueryAsync(
        function (sender, args) { getItemsFromList('List Name', "<View><Query>" + view.get_viewQuery() + "</Query></View>") },
        function(sender, args) {alert("error: " + args.get_message());}
    );
}
//Second Request
function getItemsFromList(listTitle, queryText) {
    var context = new SP.ClientContext.get_current();
    var list = context.get_web().get_lists().getByTitle(listTitle);
    var query = new SP.CamlQuery();
    query.set_viewXml(queryText);
    var items = list.getItems(query);
    context.load(items);
    context.executeQueryAsync(
        function () {
            var listItemInfo = '';
            var listEnumerator = items.getEnumerator();
            var i = 0;
            while (listEnumerator.moveNext())
            {
                i++;
            }
            alert("items retrieved: " + i);
         
        },
     
function (sender, args) { alert("error in inner request: " + args.get_message()); }
   );
}

Hope this helps. Happy Coding :)

Sunday, 12 July 2015

Programmatically Send E-Mail using SPUtility.SendEmail - SharePoint

Hi All,
 Today we will see about Email in SharePoint (programmatical approach)

If you want to Send E-mail through SharePoint, We can use the capabilities already provided by SharePoint. (i.e) SPUtility.SendEmail. This is basically SharePoint's native functionality for email delivery.

First you will need to be sure that outgoing mail settings are configured for SharePoint. After that you can easily send email from your custom SharePoint application using SharePoint’s native mail capabilities. You can do this in Central Administration.
Open Central Admin --> System Settings --> Configure Outgoing Email

Before attempting to send an email from your application, you can easily check to be sure that the outgoing email settings are configured.

bool blnIsEmailServerSet = SPUtility.IsEmailServerSet(web);

If this returns false, you should not bother trying to send the email. Instead, show an error message or notify the SharePoint administrator, to check the settings of the server. If it returns true, you are good to go:

To use this method we will require namespaces:

using Microsoft.SharePoint.Utilities;
using System.Collections.Specialized;

Code:

 Below given is the code.

            using (SPSite oSite = new SPSite("Site collection URL"))  //Site collection URL
            {
                using (SPWeb oSPWeb = oSite.OpenWeb("Subsite URL"))  //Subsite URL
                {
                    StringDictionary headers = new StringDictionary();

                    headers.Add("from", "senderEmail@domain.com");
                    headers.Add("to", "receiverEmail@domain.com");
                    headers..add("bcc","HiddenuserEmail@domain.com");
                    headers.Add("subject", "Send Email using SP Utility");
                    headers.Add("fAppendHtmlTag","True"); //To enable HTML format

                    System.Text.StringBuilder strMessage = new System.Text.StringBuilder();
                    strMessage.Append("body of the message that can include html tags also");
                 
                    strMessage.Append("<span style='color:red;'> HTML </span>");
                    SPUtility.SendEmail(oWeb, headers, strMessage.ToString());

                }
            }


Some Limitations for this method are :

1.   No attachment allowed
2.   Message body size cannot exceed 2048 characters.
3.   The from address will be the “Outbound Sender Address” configured in the central admin.

To overcome the limitations, use the System.Net.Mail class methods to send E-mail.
I have given details here.

Happy Coding :)

Monday, 6 July 2015

Programmatically Diasable List Throttling for a specific List in SharePoint - Powershell

Hi All,

 Today we will see about "How to Diasable List Throttling for a specific List".

SP2010 introduces list throttling settings that allow us to specify how many items a user can query before the throttle kicks in and aborts the query. This applies to both the queries that retrieve through SharePoint UI and from custom code. Default limit is 5000 items per list. While exceeding this limit results in display of an error message. We can override it by calling RequestThrottleOverride on the SPQuery object. This will allow us to execute large unsafe queries.

SharePoint 2010 provides Administrators to control a limit of how many items to be retrieved from the lists at a time using User Interface or Object Model.

SharePoint by default set some limitation to your web application to make sure that performance is good even when data increasing. These limitations has been tested and carefully chosen by SharePoint Team and Microsoft does not recommend changing these value.


List Throttiling feature is webapplication level.
If we want to change the limits for the whole web app,
From Central Administration
1. Go to SharePoint 2010 Central Administration
2. Under Application Management, click "Manage Web Application"
3. Choose the web application that you want to change. On the ribbon click "General Settings" and then "Resource Throttling"
4. Change throttling settings and click OK.

To override the default throttling settings. just execute the below powershell to add list items more than the threshold limits.

web = Get-SPWeb -Identity http://mysite
$web.AllowUnsafeUpdates = $True
$list = $web.Lists["ListName"]
$list.EnableThrottling = $False
$list.Update()
$web.AllowUnsafeUpdates = $False
$web.Update()
$web.Dispose()

Thanks for your time.. Happy SharePointing..

Wednesday, 1 July 2015

Everyone and Everyone except external users SharePoint Online - Boundaries and Limitations.

 Hi All,

Today we will see about SharePoint Online. Let's say you have been asked to share a content (file or site or anything). Now these two words come into picture "everyone" and "everyone except external users".

Want to get more details about "External Users" - Check here

When a user is added to Office 365, the user automatically becomes a member of Everyone except external users. The important thing we have to note is that, By default, the Everyone except external users group is added to the Members group on the SharePoint Team Site. It is automatically assigned a permission level of Contribute. This means all users who are added to Office 365 can view, add, update, and delete items from lists and libraries.

If you want to change the permission levels for this group, you can remove it from the Members group and then add it to a group that uses different permissions. For example, you might add the Everyone except external users to the SharePoint Visitors group. This automatically assigns a Read permission level to all users in the Everyone except external users group.


And there is a difference between "everyone" and "everyone except external users".

Everyone:

All users no matter whether they are authenticated to access the SharePoint Online. For example, you share a document with everyone, and then all users can anonymously access the document as if they have the document URL.

Everyone except external users:

All internal user accounts which can be recognized by SharePoint Online.

And we have some limitations while using these groups.


  • While sharing some content with either of these groups, you can't send invitation mail for them.


  • You can't remove a user from either of these groups. Say, you want to share a document with all the persons except some few people. You can't go and delete those specific users. For this situation you have to create a new SharePoint group and add all the users you want in that.

Share me your feedback :)
Have a good day :)

Sunday, 7 June 2015

Programmatically Updating the Infopath forms and UDCX files after migration - SharePoint Powershell

Hi All,
 Today we will see about Infopath. We had a SharePoint migration in our company from 2010 to 2013. This Powershell cmdlet helped very much in reducing the manual time for updating the data connections in the Infopath forms.

 Once migration is done, the Infopath will be still pointing to the Old URLs in the data Connections.
Example: If the Old URL is something like "http://contoso2010.Company.com" and the New URL is like "http://contoso2013.Company.com", and after migration also the Data Connections will be pointing towards "http://contoso2010.Company.com". This includes the UDCX files also.

If there are only few forms, we can change it easily by following the below method.

For Updating in the forms : Just open the form in the Infopath designer, in the "DATA" tab click on "Data Connections". Check whether it is poinint towards our new URL. If not update the same and re-publish.

For Updating the UDCX files : Open the Data Connections Library and download the files to the Loca. Open the files in the notepad and change the "Web URL" and "List ID" parameters to the latest.

The above method will be helpful only if there are few forms. If there are more forms to be manually updated you can always go for the below PowerShell method.


The Update-SPInfoPathUserFileUrl cmd-let will upgrade form template and data connection files as per the parameter we give in the cmdlet. The update will access ALL files (except ASPX files) in any Data Connection library anywhere in the site and Update.

CMD-LET is

Get-SPWebApplication http://contoso2013 | Update-SPInfoPathUserFileUrl-find "http://contoso2010" -replace "http://contoso2013"

This example updates data connections in InfoPath form templates and universal data connection files, for all content under the Web application http://contoso2013. Data connections that reference http://contoso2010 are updated to reference http://contoso2013.

This also works for Admin approved Infopath forms :Update-SPInfoPathAdminFileURL -find "http://contoso2010" -replace "http://contoso2013".

The same method could be followed when moving the forms from Test to Production.

Thanks for Reading.. See you in the next post.. Happy Sharepointing..................



Sunday, 15 March 2015

Odata querying 100 items only issue - SharePoint

Hi Coders,
 This post will be useful for the beginners, who has already started using Odata in SharePoint 2013. You might have faced this issue or you havent figured it out yet.

For Odata queries please refer this.

So based on the above link, for retrieving items from the list , we have to use the following syntax.
http://server/site/_api/web/lists('guid')/items?$select=Title
This provides you the "Title" column value of  the items in the list.

So, the tweak in this query is, by default it returns only 100 items..
This important point has been missed in most of the documentation..


FIX : 
So to fix this we have to use the "top" clause.
http://server/site/_api/web/lists('guid')/items?$select=Title$top=10000

We have to give a maximum value based on our application nature.

Hope this helps..

Have a good day. Meet you on the next post.
Happy Sharepointing......

Friday, 4 July 2014

Jquery selectors - Wildcards for Finding Sharepoint fields with Internal Names in newform,editform and Displayform.

Hi All,
 Today we will see something related to jQuery. This was helpful when i tried to get the internal names of the columns in the newform, editforms.

Getting the controls in the forms using the label names would be inconsistent, as the labels could be changed frequently causing our code to break. So we have to query the fields using "id" of that element.

For example, if there is a control named "Project Name", its id could be "ProjectName_12h1278hk9kkhasfkcyh9"..

That is, "Internal Name of the column("ProjectName) + some junk"

These wild card selectors were very useful in finding the controls. This would be of a great help when u come across these sort of situations.


If you want to select elements with an id which ends with a given string :
$("[id$='myValue']")


If you want to select elements with an id which starts with a given string :
$("[id^='txtTitle']")


If you want to select elements which id contains a given string  :
$("[id*='txtTitle']")


If you want to select elements which id is not a given string  :
$("[id!='myValue']")
(it also matches the elements that don't have the specified attribute)


If you want to select elements which id contains a given word, delimited by spaces :
$("[id~='myValue']")


If you want to select elements which id is equal to a given string or starting with that string followed by a hyphen:
$("[id|='myValue']")


Have a good day....

Tuesday, 18 February 2014

Synchronous Event LookUp Value on After Properties - SharePoint

HI All,
 Today We will see about getting the value of a LookUp field in a Synchronous Event.
There is a major difference in getting the value of the same when the following two things are called.
1)properties.ListItem
2)properties.AfterProperties

For the first , properties.ListItem
We have to make call like this,
          
    SPFieldLookupValue prevItemValue = new SPFieldLookupValue(properties.ListItem["FieldName"] as string ?? string.Empty);
    string FieldNameListItem = prevItemValue.LookupValue;

And for the second, properties.AfterProperties

   SPFieldLookupValue newItemValue = new SPFieldLookupValue(properties.AfterProperties["FieldName"] as string ?? string.Empty);
   int str1 = newItemValue.LookupId;
   SPList targetList = properties.Web.Lists["Target List"];
   SPListItem targetItem = targetList.GetItemById(str1);
   string FieldNameAfterProperties = targetItem["ParentField"].ToString();


On seeing the piece of code for properties.ListItem we can easily understand the logic how it works.

For the second one, a small detour has been done to get the value.
On calling properties.AfterProperties we only get the Id of the particaular item and the value is missed. So for getting the value of that field in After properties we have to query the master list,s master column.

Hope you all understand. Please drop your queries for any further clarification.
Thanks for your Time.. See you on my next post...

Sunday, 16 February 2014

Bring back the BreadCrumb in SharePoint 2013

HI All,
 Today we will see how to add the breadcrumb in SharePOint 2013. To know about BreadCrumb, Please check here.

It seems like this feature has been removed in SharePoint 2013. But the real fact is that this BreadCrumb trail has been hidden from the End Users.

OK lets see how to get back the same.

1.Open your site with SharePoint designer

2.Navigate to All Files -> _catalogs -> master page

3.Edit the Seattle.master in advanced mode and copy all the code

4.By default it’s not possible to edit the original master. To create a new one click on File -> Blank Mater Page

5.Check out the new master, edit it in advanced mode, delete all the existent code and paste the one from the original Seattle

6.Search for <div class="ms-breadcrumb-dropdownBox" style="display:none;">
 Remove the CSS attribute, style="display:none;

7.Two lines bellow change the visible attribute of the SharePoint:PopoutMenu to true.

So Finally the code should look like,
<div class="ms-breadcrumb-dropdownBox">
<SharePoint:AjaxDelta id="DeltaBreadcrumbDropdown" runat="server">
 <SharePoint:PopoutMenu
  Visible="true"
  runat="server"
  ID="GlobalBreadCrumbNavPopout"


Thanks for your time. See you back on my next post.