Wednesday, April 23, 2014

How to Create Rotating Banner in SharePoint 2013 using Content Search Web Part

SharePoint 2013 brought an excellent web part to get content from search index, called "Content search web part". Using content search web part, We can build a simple image rotator or content slider in few steps.
Content Search Web part is available only on SharePoint 2013 enterprise edition!

Step 1 -  Create a Picture Library and upload images:
Go to your SharePoint site, Create new picture library.
 Give it a Name, Say "Slides"
 Upload required banner images to the library
Step 2: Trigger Incremental Crawl:
Trigger an incremental crawl or wait for the incremental crawl schedule to complete, So that the picture library we created added to search index.

Step 3: Add Content Search Web Part to the page
Navigate to the page where you would like to add content slider, Click on Site settings gear >> Edit page >> On Insert tab, Click on Web part >> Under the content Rollup, select "Content Search" and then click on "Add" button.
SharePoint 2013 how to add content search web part
Now, the web part should look like the below image. Click on "Edit Web Part" from the web part menu, content search web part sharepoint 2013
Click on "Change Query" button from the web part properties pane.
sharepoint 2013 slider
 Select a query as: Pictures (system) and Restrict by app as : Specify a URL. In URL field, enter the URL of your picture library and Click on OK.
sharepoint 2013 slider web part

Now, in Edit Properties, Set the Number of items to show as per your requirement, and expand Display templates section. Set the Control template as :Slideshow and Item template as Large picture.
sharepoint 2013 content search web part display templates
That's all! Done, This is what we get in the page!
sharepoint 2013 carousel

How to link banner Images to URLs?

Well, what we've done above is just a slideshow. On clicking banner images, they take us to the individual image from the banner. However, We may have to link banners to different URLs. Say, on clicking the above "New markets"banner, you may want to send users to :http://your-sites/departments/new-markets/ isn't it? So what this step brings in addition is: When user clicks on the banner, where it should takes them, Lets head on to the next step:
SharePoint 2013 generates managed properties for site columns. If you add a column directly to a list, it will not generate a managed property automatically!

Step 1: Add new Site column and Include it to the library
We need a column to hold target URL (when banner is clicked!), So lets create a new site column and add it to the Slides picture library. The reason we create site column, rather adding coloumn to the list directly is: We need a Managed property! Fortunately, in SharePoint 2013, all site columns will be automatically created as managed properties!

Navigate to "site action >> Site settings >> Site columns >> Create new site column "TargetURL"
 content search web part sharepoint 2013 tutorial
Add site column to the Library:
Go to list settings >> Add from existing site column >> and choose the site column "TargetURL".
Once done, update TargetURL value for all banner images. sharepoint 2013 content slider
Once done, Initiate either incremental/full crawl - This will create a new crawled property as well as managed property for the custom site column we've added to the picture library.


Verify the managed property: Go to : Site setttings >> search schema >> Managed properties.

Make sure, you get the Managed property listed.
sharepoint 2013 content search webpart slideshow
Now, configure the managed property in the content search web part properties. Go to Edit page, Modify web part, And set the "Link URL" value to the managed property created from our custom column (TargetURL).
sharepoint 2013 content search web part picture url
That's all! Now the banner images will be pointing to the URLs specified in TargetURL column!

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Five Challenges in SharePoint Security
...And How to Solve Them. Free White Paper
*Sponsored


Thursday, April 10, 2014

Create Custom Promoted Link Tiles in SharePoint 2013

Promoted links list is one of the new list type (App) introduced out of the box in SharePoint 2013, Its actually a list with a special view which shows the list items as tiles. Here is an example of a SharePoint 2013 team site with promoted links  Metro UI.
promoted links sharepoint 2013
Obviously, We can create our own Tiles like the one in "Get Started with your site", that is shown on all new team sites in SharePoint 2013. Lets create a Promoted Links as a Quick Navigation on a SharePoint support site's Home Page.

In Short, create a new Promoted Links list and add links that you need to display as tiles. Then add the Promoted Links App on a page to display links as Tiles.
Step 1: Create New Promoted Links List:
  1. To begin creating a Promoted Links list, Click on Site Settings Gear >> Choose "Add an app" linkadd promoted links sharepoint 2013
  2. Click on "Promoted Links" App list typepromoted links app sharepoint 2013
  3. You will be prompted for a list name. In my case, Its "Support Links"sharepoint 2013 promoted links feature
  4. Once you have created the Promoted Links, You can add links to the list by providing values such as: Link title, Description, Background Image Location(complete path of any existing image store anywhere - The tiles are 150px by 150px), Image Tool tip, Link behavior (Open link in a separate window), Order ( The lowest number will be the first tile). In my case, I've added links such as "Add New Site", "Request for Expert Help", etc.
    edit promoted links in sharepoint 2013
Edit promoted links in SharePoint 2013: Change the Tiles view to All Promoted Links view to edit Promoted Links! Otherwise, You can't edit them!!

Step 2: Add the Promoted Links List App to the Home page
Once you added all the required link items, you have to add this App to the page wherver required (typically on Home page!).  You can remove the above tile using remove this link and create your own tiles
  1. Navigate to the page where you where you want to add your tiles. Click on "Edit page"
  2. Click on Insert tab >> App Part
  3. Select the promoted links list (in my case its "Support Links") and click on add button to add it to the page.
  4. Save the page once done.

This is how my tiles view looks like:




You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Five Challenges in SharePoint Security
...And How to Solve Them. Free White Paper
*Sponsored


Wednesday, April 2, 2014

SharePoint 2013 Drag and Drop Upload Not Working

One of the cool new feature in SharePoint 2013 is the ability to drag and drop files directly into document libraries.  We had a scenario where it didn't work!  some users were unable to upload files into document libraries by dragging and dropping. They see only "New document" but "new document or drag files here" not visible. Which means: drag and drop not available for them!
drag and drop in sharepoint 2013 not working

SharePoint 2013 drag and drop requirements:
SharePoint 2013 drag and drop feature in based on HTML 5! So, the browsers which supports HTML 5, such as recent versions of IE 10 or above, Firefox, Chrome and Safari, drag and drop functionality in SharePoint 2013 works fine.

This functionality also works on browsers which doesn't support HTML 5 (such as IE 8 and IE9), when you have Microsoft Office 2013 installed. Office 2013 installs an activeX control "SharePoint DragUpload Control (Interceptor.dll) and browsers use them for drag-and-drop functionality. BTW, Check the version compatibility (If you have 32 bit version of office installed, It can't run on IE 64 bit!!)
sharepoint 2013 drag and drop browser support
Enable drag and drop feature in SharePoint 2013 for IE8/IE9:
As already stated, SharePoint 2013 drag and drop not available for IE8/IE9 when you don't have Microsoft Office installed on client machine. So, We can run SharePoint designer 2013 installer (Just choose "Office Tools >> Microsoft SharePoint Foundation Support" option, No need to install SPD 2013!) Having SharePoint Designer 2013 enables uses to drag and drop documents in SharePoint 2013.
How about libraries with required columns? Well, when you upload by drag and drop, The file is checked-out and they'll have to check-in explicitly.
SharePoint 2013 drag and drop upload permissions:
user must have at least contribute permission to the document library, otherwise, they can't drag and drop in SharePoint 2013.
What if none of the above works for you? Use Explorer view!


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Five Challenges in SharePoint Security
...And How to Solve Them. Free White Paper
*Sponsored


Monday, March 31, 2014

Restart SharePoint Timer Service Remotely using PowerShell

SharePoint Timer service must be restarted for certain configuration changes in SharePoint administration activities. Well, without logging into each and every SharePoint server and restarting timer service, we can utilize PowerShell to do it remotely!

PowerShell Script to Restart SharePoint Timer Service Remotely:
 #Service to Restart
 $ServiceName = "SPTimerV4"

 #Array to Hold server Names. Update this Array accordingly
 $ServerNames = @("SPServer01", "SPServer02", "SPServer03")
 
 #Get All SharePoint Servers and restart their SharePoint Timer service
 foreach($Server in $ServerNames) 
 {
     Restart-Service -InputObject $(Get-Service -Computer $Server -Name $ServiceName)
 }

You can also use the classic WMI method to restart any service on remove server:
 
    #Server Name
    $ServerName = "SPServer01"
 
    #Service to Restart
    $ServiceName = "SPTimerV4"
 
    #Get Timer Service
    $Service = Get-WmiObject -computer $ServerName Win32_Service -Filter "Name='$ServiceName'"
    $Service.InvokeMethod('StopService',$Null)
    start-sleep -s 5
    $Service.InvokeMethod('StartService',$Null)
    start-sleep -s 5


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Five Challenges in SharePoint Security
...And How to Solve Them. Free White Paper
*Sponsored


Sunday, March 30, 2014

Get SharePoint Site Collection, Web, List Objects from GUID

Requirement: On Nintex workflow databases, Ran a query to fetch workflow usage statistics, and the query gave GUIDs of SPSite, SPWeb and SPList objects!

SELECT TOP 100 
I.WorkflowName, 
I.WorkflowInstanceID, 
I.SiteID, 
I.WebID, 
I.ListID, 
I.ItemID, 
I.WorkflowInitiator, 
I.WorkflowID,
I.State, COUNT(P.WorkflowProgressID) as WorkflowProgressRecords
FROM WorkflowInstance I inner join WorkflowProgress P WITH (NOLOCK)
ON I.InstanceID = P.InstanceID
--WHERE i.State=2 
GROUP BY I.WorkflowName, I.WorkflowInstanceID, I.SiteID, I.WebID, I.ListID, I.ItemID, I.WorkflowInitiator, I.WorkflowID, I.State 
ORDER BY COUNT(P.WorkflowProgressID) DESC
Get SharePoint Site Collection, Web, List Objects from GUID
Well, from SQL query we got GUIDs of SharePoint site collection, web and list objects, but how do we get the actual site collection/site/list locations? PowerShell comes to rescue. Here is the PowerShell script to get SharePoint site collection, web, list objects from GUID.
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")  
 
#Get-SPWeb cmdlet for MOSS 2007
 Function global:Get-SPWeb($SiteGUID, $WebGUID)
{
  $site = New-Object Microsoft.SharePoint.SPSite($SiteGUID)
        if($site -ne $null)
            {
               $web=$site.OpenWeb($WebGUID);      
            }
    return $web
}
 #GUIDs for Site, Web and List 
 $SiteGUID = [GUID]("294D0050-19BE-439E-BF87-246F07828DAE")
 $WebGUID = [GUID]("AEDA6502-83C5-4967-A4C6-DF26B6F1ABDA")
 $ListGUID =[GUID]("1A54DCCD-251A-4B05-A7EC-BF10877C8B90")
 
 #Get the Web   
 $web = Get-SPweb $SiteGUID $WebGUID
 #Get the List
 $list = $web.Lists[$ListGUID]
 
 #Get the List title
 $list.title 
 $ListURL = $Web.URL+"/"+$list.RootFolder.URL
 write-host $ListURL 


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Five Challenges in SharePoint Security
...And How to Solve Them. Free White Paper
*Sponsored


You might also like:

Related Posts Plugin for WordPress, Blogger...