Thursday, 13 March 2014

How to edit a Master Page and Layout Page in SharePoint 2013


1 comment:
You probably would have seen a lot of examples about Creating Custom Master Page and Layout Page in SharePoint 2013, but in this post, I will give you some very important tips that you need to know before you start creating these custom pages.
When editing a Master Page -
When you try to modify a SharePoint 2013 Master Page, you must edit the Master Page’s .html file only. Once saved, the associated master page file gets updated automatically.
So don’t attempt to modify the .master as it should be perfectly in sync with its html counterpart.


When editing a Layout Page -
When you Create a Custom Layout Page using Design Manager, two files – .aspx and .html gets Created in the Master page gallery.

If you need to make any Changes to the Layout page, make sure you download the .html file of your layout page and make Changes to it. The .aspx page will get updated automatically.

Also, don't forget to Publish the .html or .aspx as a major version.

SharePoint Versioning


1 comment:

Tip #1 - SharePoint Tip of the Day – You probably would have used Major and Minor Versions in a document library. While Setting the limits though there are two boxes available under “Optionally limit the number of versions to retain”.
1) The first box is for setting the limit for Major Versions.
2) The second box however is used to specify the number of Major version that can have minor versions.

A lot of users think that the second box it to specify the number of minor versions but that isn’t true. In actual, the second box is to specify major versions that you want to keep drafts or minor versions for. By default, each major version can have up to 511 drafts (minor versions).

Tip #2 - If a user with Read permissions is getting Access denied on Documents, be sure that the document is Published as Major Version and not is in Draft’s mode.

A Document in Drafts mode will give access denied to any Read-only user despite of Read permissions assigned to it.

You can also change the “Draft Item Security” in Version Settings to allow readers to see the Draft versions as well.

Monday, 28 October 2013

Why I don't see "Edit Links" in left or Top Nav in SharePoint 2013


6 comments:
Here is a quick tip on a question that I was asked today.

"Edit Links" only appear in a Top-level Site (of a site collection) and not in subsites only if the navigation is inherited from the parent site.

In other words, if your subsite is inheriting navigation from Parent site the link "Edit Links" in left and top navigation will not appear.


Saturday, 13 July 2013

Migrate Content in new SharePoint 2013 Online\Office 365 Site


No comments:
You can now use a new Public Site Content Migration App to copy pages, documents, images, navigation, and more from your existing website to your new website in Office 365.

If your Office 365 account was recently upgraded, you’ll notice that you end up with two public websites.The Public site (middle) is your current website and the New public site (right) is the new website introduced with the upgrade. With both websites available, you can take your time learning how to use the new website and upgrade websites at your own pace. Or, if you’re not using your current website, then don’t upgrade at all.

To start the upgrade, go to the new website and install the Public Site Content Migration App. (Choose Settings   > Add an app select SharePoint Store and search for Public Site Content Migration App.)

Once you install it, open the app on your new website. (Settings   > Site contents > Public Site Content Migration.)

Follow the instructions, which starts with installing the migration app on your existing (pre-upgrade) website then returning to the migration app on your new website to finish. (Your existing website must be upgraded to the latest version of SharePoint before you can install the migration app there.)

When you’re finished migrating content and customizing the new website, you’re ready to switch to the new public website. You do this in two steps. First, make the website public so that everyone can see it. (You do this from the new website itself.)

Then, you change the website address (URL) of the new website so it uses your custom domain name, (like www.contosobistro.com). This assumes you own a custom domain name; if not, then there’s no additional step here.

Hide\Disable CallOuts and CallOut Actions in SharePoint 2013


No comments:
I was asked about the easiest way to Hide or Disable CallOuts and CallOut Actions in SharePoint 2013. I found few ways but the easiest is to either Change the View of the ListView Webpart or use a Custom Column that does not have a CallOut tied to it.




Look at the Various Options below -

1. Change the Column (Title) - You can Change the Title Column that is tied to CallOuts by using Title with Linked to edit menu or Title with Linked to Item Instead of Default Title Field. See details at Hide CallOuts in a SharePoint 2013

2. Change the View  - You can Change the View of the ListView Webpart to Newsletter etc to give your webpart a SP2010 ListView Look and feel. See details at Disable CallOut Popup for a Field or Column in SharePoint 2013 List
 
3. Hide CallOut Actions - You can Hide CallOut Actions bu Overriding the CallOut Actions in a default CallOut. See this quick example at Hide,Remove,Customize CallOut Actions in SharePoint 2013

Sunday, 7 July 2013

Display Truncated Announcements in SharePoint 2013


No comments:
The requirement of Displaying Truncated Announcements in SharePoint is one of the most desired requirements from business.

You can achieve this in various known ways like Custom webpart, odifying XSLT, dding DataForm Webpart etc but one of the new and easiest ones that I saw on web is by using JS link.

With JS link property of a ListView you can control the rendering of items entirely. Take look at this example from LearningSharePoint.com which shows how easy it is to style announcements and modify the output as per your requirement.

You can also try few other Interesting Options that I found on the web -

Display Announcement Details in CallOuts on Hover Over of Item in SharePoint 2013

Styling Announcements with JavaScript (using JS Link) in SharePoint 2013


Sunday, 12 May 2013

SharePoint 2013 - Create CallOut and CallOut Action Example


1 comment:
Example of Creating a CallOut and CallOutAction in SharePoint 2013

CallOuts are displayed for Certain type of lists in SharePoint 2013 like Task lists and Document libraries. All exiting CallOuts Can be customized and new one can be Created.

In the below Code all you need is to replace the 'target' element to position the callout from.



Create new CallOut -
 
 var listCallout = CalloutManager.createNew({ 
                launchPoint: target, 
                beakOrientation: "leftRight", 
                openOptions: { 
                    event: "click", 
                    showCloseButton: true 
                }, 
                ID: title, 
                title: title, 
                content: "<div class=\"ms-soften\" style=\"margin-top:13px;\">" 
                        + "Pulication Date: " + pubDate + "</div>" 
                        + "<div class=\"callout-section\" style=\"margin-top:13px;\">" 
                        + "<div>Description:</div>" + description + "</div>", 
            }); 
 
Create CallOut Actions -
 
var calloutAction1 = new CalloutAction({
                text: "Open ",
                isEnabledCallback: function () {
                    callBackListUrl = curListUrl;
                    return true;
                },
                onClickCallback: function () {
                    window.open(callBackListUrl);
                    listCallout.close();
                }
            });
 
listCallout.addAction(calloutAction1);

Check out more Examples at SharePoint 2013 CallOut Tutorial & Examples

Saturday, 11 May 2013

Best Practices for Assigning Permissions and adding users in SharePoint 2013


No comments:
Few Tips about Assigning Permissions and adding users in SharePoint 2013 -

* Break permission inheritance as infrequently as possible.

* Use groups based on folder membership to assign permissions - Do not use SharePoint groups to assign permissions to sites.When a SharePoint group is used to assign permissions, a full crawl of the index occurs. Instead, we recommend adding Active Directory Domain Services (AD DS) groups.

* Assign permissions at the highest possible level. As part of this strategy, consider the following techniques:
  • Put documents that require unique Permissions in document libraries that are defined to support that Permissions.
  • Use different document publish levels to control access. Before a document is published, the advanced permissions and versioning settings can be set for users who can only approve items in the document library.
  • For non-document libraries (lists), use the ReadSecurity and WriteSecurity permission levels. When a list is created, the owners can set the Item-level permissions to either Read access or Create and Edit access.

 
* Ensure that you do not have too many items at the same level of hierarchy in the document libraries, because the time that is required to process items in the views increases.
 
* There is a built-in limit of 50,000 scopes (unique permissions) per list or document library. After 50,000 scopes are reached addition of new scopes in a given list or document library is prohibited.
 
* Only set unique scopes on parent objects such as folders.
 
* Do not create a system with many uniquely-permissioned objects below an object that has many scopes.
 
* If your business requires more than 50,000 uniquely permissioned items in a list or document library, then you must move some items to a different list or document library.

CallOut Popups displayed for specific lists in SharePoint 2013


No comments:
I was asked this question to turn-on CallOut Popups for Announcements list where popups where going to get display the description of the field.

I researched why the Callouts does not appear on the Announcements list as I thought they get displayed for all of them by default but clearly this is not the case.

By default, CallOuts are displayed for certain types of lists and Libraries. I found the list here at Working with CallOut Popups in SharePoint 2013 post from LearningSharePoint.com

CallOut Popups are displayed for following Lists & Libraries -

  • Document Library
  • Assert Library
  • Images Library
  • Pages Library
  • Task Lists

Lists that do not display CallOut Popups are -

  • Custom Lists
  • Announcements Lists
  • Calendar List
  • Discussions List

Change Page Layout from Article Page to WebPart Page in SharePoint 2013


No comments:
I found this Interesting post on LearningSharePoint.com

By Default, When you use “Add a Page” option in Site Actions to Create a Page, a Page using Article Page Layout gets Created. Just to make it clear we are talking about “Add a Page” option that is in the screen below.

SharePoint 2013 Add a Page

To Change the default Layout (for this “Add a Page”) to your Custom Layout or to a WebPart Page Layout, you can use “Page layouts and site templates” feature that is available in Site Settings of your Publishing sites.

Lets look the Steps on how to do this -

1. Firstly, navigate to Site Settings using the Settings wheel or Site Actions in your SharePoint 2013 site.

2. Under “Look and Feel” Select “Page layouts and site templates”. Make Sure you have Publishing feature enabled to see this option.

 SharePoint 2013 page layouts and Site Templates

3. In Page layouts and site templates page in “New Page Default Settings” section Select the page Layout that you need to set as default in “Select the default page layout:” list.

SharePoint 2013 default Page

Once you have set this option, when you Create a new Page using “Add a Page”, a new WebPart Page will be Created.

Create a Page using “Add a Page” for testing purposes.

Resulting Page –
SharePoint 2013 WebPart Page Layout

The above page has Title and Page Content Fields added by default.You can Ignore these Fields and use WebPart Zones Instead.

Friday, 26 April 2013

New Project Page Layout in SharePoint 2013 Wiki Site


No comments:
Each Wiki Site has a Library called “Pages” that can accommodate additional Wiki pages added to your site. By default, two Pages – Home and About are added.











For a Content Author by default, three types of Wiki pages are available -

  • Enterprise Wiki Page
  • Redirect Page
  • Project Page

SharePoint 2013 Wiki Page Types

Enterprise Wiki Page – This is a Default Layout Type for any page Created in the Wiki site.

Redirect Page – This Page Layout is used when a User wants to Create a Page for Redirecting Purposes.

Project Page – Project Page Layout is a new Content Type added to a Wiki Site. A Project Page Layout is used for Creating Wiki Pages specific to Projects in the Company. This Layout has a special right Column for adding Metadata about the Project with Fields such as Project Status, Contact Person and Web Page address for the Project. See an example of Page Created using this Content Type below.

SharePoint 2013 Project Page

Thursday, 18 April 2013

How to deploy WSPs from SharePoint 2010 in SharePoint 2013


No comments:

In this post we will discuss some of the Important things to note while deploying SharePoint 2010 Solutions in SharePoint 2013. These results are based on Our experiences and findings from various posts about migration around the web.

Deploy SharePoint 2010 Solutions in SharePoint 2013 -

Migrating Custom Wsp Solutions -

Most of the wsp Solutions deployed in SharePoint 2010 should work fine in SharePoint 2013. This is because of the Support for both 14 Hive and 15 Hive directories that are Created in SharePoint 2013 by default.

Initially, when you deploy a SharePoint 2010 Solution it gets deployed to 14 Hive and not 15 Hive. To force the solution to install in 15 Hive you need to modify manifest.xml file of your solution and add addSharePointVersion=”15.0″ attribute to it. The Solutions can be forced to install in 15 hive that way However, some of the files especially that refers to _layouts might not work. All SharePoint 2010 Solution files that refers to _layouts folder (i.e. Features, Layouts-files, Images, ControlTemplates)needs to be updated(best approach is to Re-Create the Solution in Visual Studio 2012).In 15 hive , files in Layouts directory has a Path with ’15′ added to it.

For example path of a Custompage in 14 and 15 hive would be -
14 Hive path  – _/layouts/Custompage.aspx
15 Hive  path – _/layouts/15/Custompage.aspx

Notice the reference of 15 in _layouts folder reference in 15 Hive.This is reason you need to update paths of all the deployed files such as Features, Layouts-files, Images, ControlTemplates if the solutions is targeted to be deployed in 15 Hive.

Compatibility Level - In addition to SharePointVersion=”15.0″ attribute,with the new “CompatabilityLevel” parameter of Install -SPSolution cmdlet you can now deploy your .wsp or Solution to either 14 hive, 15 hive or both using the Powershell itself.This “Compatibility Level” value overrides SharePointProductVersion specified in manifest of the solution and it is only way with which solutions can be installed in both 14 & 15 Hive.

Compatibility Level Impacts only files deployed to the Templates folder in the 14/15 Root folder i.e. Features, Layouts-files, Images, ControlTemplates, etc.The files deployed Outside of this folder (e.g. a WCF Service) will be deployed to the 15/ISAPI regardless of the Manifest or PowerShell Compatibility level settings of the wsp-package. Files such as Assemblies in GAC/Bin and certain resource files will also be deployed to the same location regardless of the Compatibility Level.

Bin Directory Considerations -
Also, you can no longer add partial trust solution packages to the \bin directory.Any files deployed to the \bin directory must be full trust.

GAC Considerations - After the Release of .NET Framework 4.0, the GAC was split into two, one for each CLR.
c:\windows\assembly is the location for .NET versions 1.0 through 3.5 and
c:\windows\microsoft.net\assembly is location for all the dlls for project Created in .NET Framework 4.0.
Consider looking into new Location if you have Created your project in Visual Studio 2012.
For these reasons and more it is Recommended to Re-Create a Solution in Visual Studio 2012, Re-add all the features, Components and then deploy it to SharePoint 2013 in 15 hive.

Sandbox Solutions -

Sandbox solutions are upgraded with the Content databases.

Fabulous 40 templates in SharePoint 2013 -

As per MSDN, Microsoft is not Creating any New Versions of these Fabulous 40 Templates. The Old Sites based on these templates can be upgraded only if the Templates are Installed successfully in SharePoint 2013.You can try installing wsp of Fab 40 with CompatabilityLevel as 15 and upgrade the existing site collections.

Master pages and CSS files -

Master Pages and Css has Changed a lot in SharePoint 2013.You can deploy a master page in Master page gallery but the styles from old core.css needs to be updated.See some useful tips on How to Override default Css in Layout and Master Pages in SharePoint 2013

Themes -

Re-create your themes following the SharePoint 2013 theming guidance, or select a new theme available in SharePoint 2013.

Site definition -

Migrate sites to a supported, predefined site definition, then apply Custom features by using Solution deployment.You can also Continue to use a Custom site definition. You do not have to create a new site definition that is based on SharePoint 2013.

SharePoint 2013 Design Manager Examples


1 comment:
SharePoint 2013 Design Manager Tutorials. This month we Started Exploring a new Feature of SharePoint 2013 called “Design Manger”.

This is Suppose to be a good replacement of the existing SharePoint Designer to Create Master Pages & Layout Pages in SharePoint 2013. Design Manager is a Cool new addition as it lets you Convert a simple HTML Template into a SharePoint Master Page(along with an awesome Preview functionality), Create a Layout Page, Get Code Snippets for SharePoint Components, Manage Design Templates for Search webparts and more.

Lets look at some of the Features & Benefits of using Design Manager.

1. Design Manager can only be used on Publishing sites(or sites with Publishing Feature turned-on).
2. You can Navigate to Design Manager from Site Settings menu and from Site Settings Page under Look and Feel.
3. You can upload the entire Design Package using “Import Design Package” option or you can Create Design Package using “Create Design Package” option.
4. You can Manage Device Channels – Create and Edit Channels.
5. Upload an HTML Master Page and Create a minimal master page.
6. Create an Edit Page Layouts.
7. Edit Display Templates.
8. Change Site and System Master Page
9. Lets you Preview Master Pages, Layout Pages and navigate to Snippet Gallery.
10. Lets you get Code from Snippet Gallery(for SharePoint Components) to be added to Master Pages & Layouts.

To begin with, consider Mapping Master Page Gallery as a Network drive. Opening Master Page Gallery as Explorer would let you Copy and Paste the design files that you can use in Design Manager.

Lets look some of these examples -

Add an Html Master Page to SharePoint 2013 using Design Manager
– With Design Manager, you can now Create a SharePoint Master Page out of a simple HTML Page Template – that you can either download from Internet or create it a notepad. See an example…
 

Create a Custom Page Layout in SharePoint 2013 This is a Step-by-Step tutorial on how to Create a Custom Page Layout in SharePoint 2013.We will use the new Design Manager to Create a Layout (from an existing one) and then edit it in one of the editors like Notepad.Once the layout is Created and Uploaded to Master Page Gallery, you can edit the generated html file in an editor of your choice and upload it back to the Master Page Gallery. See an example…

Add Snippets from Snippet Gallery in Master Pages & Layout Pages in SharePoint 2013 This is a Step-by-Step tutorial on How to use “Snippet gallery” and how to add Snippets for SharePoint Controls in Layout Pages using the design manager. See an example…

Add Navigation, Security Trimming and more Snippets in Master Page in SharePoint 2013 In SharePoint 2013 the new Snippet Gallery provides an easy way to get Codes for very useful SharePoint Out-of-box Controls like Navigation, Security Trimming Control, Edit Panel Control, Search, Device Channel and more. SharePoint 2013 Design Manager Tutorials


Wednesday, 17 April 2013

Now you Upload Logo in SharePoint 2013 Site from you Computer


No comments:
Changing Logo on a SharePoint Site is one of the most desired requirements for a new SharePoint Site. It is easy to Change the Logo using Site Settings where you simply add the URL to the logo that you want replace it with.

Simply Navigate to Site Settings  and select 'Title, Description, and Logo'. Next in SharePoint 2013 you have two Options to Upload a Logo From Computer and to Upload from a SharePoint Site.

FROM COMPUTER | FROM SHAREPOINT
 
Uploading from SharePoint Site would let you select the Logo from one of the Libraries and Uploading From Computer would let you select the Logo from your Computer that gets added to Site Asserts Library and then applied as a new Logo.

Uploading from Computer is new in SharePoint 2013.

Sunday, 31 March 2013

New JavaScript Display Template in SharePoint 2013


1 comment:
Excellent Post at LearningSharePoint.com about the new JavaScript Display Template in SharePoint 2013.

JavaScript Display Template Content Type - This is a new Content Type Introduced in SharePoint 2013 to Create a new custom CSR JavaScript Display Template in the Master Page gallery of the site. JavaScript Display Template Content Type has some special Site Columns added to it that will help specify the target element (view,webpart etc..) where the JavaScript File’s magic or custom rendering will be Implemented.

Lets Look at the Steps to upload a new Js file as a new Javascript Display Template and look at the description of Site Columns.

1. Navigate to the Master Page Gallery (Site Settings -> under Web Designer Galleries -> Master Pages).

2. Select Files tab and then Upload Document.

3. Browse to the new JavaScript file that you have created and select Ok.

Task Status Indicators
JavaScript Display Template Upload Js
4. Next select “JavaScript Display Template” in the Content Type drop-down.

Add Javascript display template SharePoint 2013
5. Next specify the Name, Title, Description properties along with some special properties like “Target Control Type Standalone,Target Scope and Target List Template ID” for this new JS file.

Target Control Type - By description “Target Control Type is the Type of Control that you will be using in this Display Template or JavaScript File”. For example if your Display Template or JavaScript File will be controlling the rendering of a View in a List, then the Target Control Type value should be “View”.
There are three possible options

  • Form
  • View
  • Field

Standalone - Specifies if you need to include this JavaScript File Override during view selection.Default options are

  • Override
  • Standalone

Target Scope - URL of the website this override applies to. This can be a relative path to your Site Collection or subsite.

Target List Template ID - Specify the ID of the list Template type this Override or JavaScript render applies to.Use the list Here to determine the Template Id for the type of list that you will applying this rendering upon.
For example, 107 would be the Target List Template ID for a Tasks List.

Upload Js template SharePoint 2013

Upload JS Template SharePoint 2013



Once your done adding document properties Save it.

Don’t forget to Publish it as major Version before start using it.
PublishasMajorVersion

Saturday, 30 March 2013

List of the Snippets for Master Pages in SharePoint 2013


No comments:
In SharePoint 2013 the new Snippet Gallery provides an easy way to get Codes for very useful SharePoint Out-of-box Controls like Navigation,Security Trimming Control,Edit Panel Control,Search,Device Channel and more.

For a typical Master Page you can add Snippets for the following -
"Master Page Snippets SharePoint 2013"

Navigation - The navigation snippets provide common navigation links and menu items on a site page.
  • Top Navigation : The navigation snippets provide Top Navigation links.
  • Vertical Navigation : The navigation snippets provide Left Navigation links
  • Search Box: Place the search box component on your page to allow users to search your site
Administration –
  • Site Title : This is a ‘Site Title’ Control which users with administrative permissions can change in Site Settings.
  • Site Logo : This is a ‘Site logo’ Control which users with administrative permissions can change in Site Settings.
  • Sign In : Only authenticated users can see the ribbon. To give anonymous users a way to log into your site, insert the sign in snippet, which authenticated users won’t see.
Containers –
  • Edit Mode Panel :To display content, including snippets, to contributing site authors only, place it inside an Edit Mode Panel. (For example, an Edit Mode Panel might contain instructions and notes for page authors.)
    • Show Only in Edit Mode
    • Show Only in Regular Mode
  • Security Trim :To display content only to those users who have a specified level of security permissions, you can use a Security Trim Control.
    •         Show to Authors
    •         Show to Authenticated Users
    •         Show to Administrators
  • Device Channel Panel : A Device Channel Panel displays the content defined within it to one or more specified Device Channels. Device Channel Panels are typically used on Page Layouts to selectively hide certain regions and functionality from or show them to specified channels, and define channel-specific CSS.
Web Parts  -
Media and Content –
  • Media Web Part
  • Content Editor
  • Get started
  • Image Viewer
  • Page Viewer
  • Picture Library
  • Script Editor
  • Silverlight Web Part
"Media and Content"

Dynamic Content –
  • Content Query
  • Summary Links
  • Table of Contents
  • Timeline
  • Relevant Document
  • XML Viewer
  • Term Property
  • Rss Viewer
  • Sites in Category
  • Categories
"dynamic content"

 Other WebParts –

Other webparts snippets


Custom ASP.NET Markup -
If you have any ASP.NET elements you’d like to include that aren’t available in the Snippet Gallery, paste the markup for those elements into the text box below, click the Update button, and paste the resulting HTML Snippet into your page.

Change Master Page and Theme in SharePoint 2013


1 comment:
Changing a Theme and a Master Page can be done while Selecting and Trying out Themes using the
 the new "Change the Look" option in Site Settings or under Look and Feel in Settings menu.

Lets Look at the Steps -

Select the "Change the Look" in Settings Option.



Here you can find some really good SharePoint Themes which can switch the look of your Office 365 site in minutes. Here is a quick look of the Themes



When you select one of the themes you would find some Interesting Options like you can Change the background Image of the site,select a color Scheme, Select the desired font and a desired Master Page. Once you are done click on “Try it Out” on the top right of the Master Page.



Next click on “Yes, Keep it” to apply this new Look.



Here is the Final Result.

Sunday, 3 March 2013

Customize Top Suite bar in SharePoint 2013


No comments:
Here are some Importnat links that will be used to Customize Top Suite bar in SharePoint 2013.

To Customize left "SharePoint' or 'Office 365' text in top left see -

http://www.learningsharepoint.com/2013/02/22/change-sharepoint-in-top-left-bar-in-sharepoint-2013-with-logo/


http://zimmergren.net/technical/sp-2013-tip-change-the-sharepoint-text-in-the-top-left-corner


To Customize NewsFeed,Skydrive,Sites bar (DelatSuitelinks) see -

http://www.learningsharepoint.com/2013/02/10/addremove-links-in-top-suitebar-skydrivesitesnewsfeed-in-sharepoint-2013/

http://www.sharemuch.com/2012/11/04/adding-your-own-links-to-sharepoint-2013-suite-bar/


To Customize Shared,Follow,SYNC bar (Promoted Actions) see -

http://www.learningsharepoint.com/2013/02/19/add-links-to-promoted-actions-sharefollowsync-in-sharepoint-2013/

Error Creating Layout Page 'Sorry, something went wrong..' in SharePoint 2013


No comments:
Past day I tried to follow a new article Here on LearningSharePoint.com for Creating Custom Layout Pages in SharePoint 2013 but when I clicked on "Create a Layout" link in Deisgn Manager I got the following error -

 
The error has no proper explanation and I couldn't find anything on google as well.I tried Re-Creating Site and Re-enabling Publishing feature in the site but nothing worked.
 
Finally, Re-Creating the Site Collection worked and the regular popup started appering.

Sunday, 10 February 2013

Programmatically Create Social Profile in SharePoint 2013


1 comment:
Its been a while since I wrote a blog entry. Here is something that will be useful to all.

In User Profiles each user now has a Social Profile to track interact with Social activities or properties of a User. In addition to the existing ones in SharePoint 2013 Ms has Included the following new objects that represent Users and User Properties:

The SocialActor object represents users (and other entities) for feed,following and other social activities.

The PersonProperties object contains general user properties and user profile properties. PersonProperties is the primary API for accessing user properties from client-side code.

//Create a Social Profile with SPSocialFollowingManager


SPSocialFollowingManager _followManager = new SPSocialFollowingManager(profile);

//Create a Social actor of type Document


SPSocialActorInfo newActor = new SPSocialActorInfo();

newActor.ActorType = SPSocialActorType.Document;

//Follow the document actor
newActor.ContentUri = new Uri('path of document to follow');
_followManager.Follow(newActor);


Please Note that to Create or Change user profiles, you must use the server object model. User profiles and user profile properties from client APIs are read-only (except the user profile picture).