Archive for the ‘SharePoint’ Category

Create an ICS (iCal) file from SharePoint list for Outlook Calendar

How to create an ICS (iCal) File from a SharePoint list and save it as an event in your personal Outlook Calendar.

Refer to : https://prezi.com/ifd-8gwstckq/sharepoint-lesson-38-create-an-ics-ical-file-for-outlook-calendar/

An extra padding of 20 pixel is included by default in SharePoint 2013 for every webpart. This may be inconvenient depending on the scenario how you are displaying the content in your Visual WebPart. To remove the extra space injected to the Webpart, add the below css in your .ascx file of Visual webapart. This would get rid of the extra space rendered around your webpart.

<style type="text/css">

.ms-webpartPage-root {

border-spacing: 0px !important;

}

.ms-webpartzone-cell {

margin: 0px !important;

}

</style>

In case you are looking to hide Column name and semicolon in Grouped view example

+ Name : Ankur (1)

You want to hide (1) to show only –

+ Ankur (1)

Use below script in CEWP, remember to refer jquery library.

$(“table.ms-listviewtable td[class=’ms-gb’]”).each(function() {

elem = $(this)[0];

var linkNode = elem.childNodes[0];

linkNode.removeChild(linkNode.childNodes[1]);

var textNode = elem.childNodes[1];

textNode.nodeValue = textNode.nodeValue.split(‘:’)[1];

linkNode.appendChild(textNode);

});

In case you are looking to hide count in Grouped view example

+ Name : Ankur (1)

You want to hide (1) to show only –

+ Name : Ankur

Use below script in CEWP, remember to refer jquery library.

$("table.ms-listviewtable td[class=’ms-gb’]").each(function() {

//Hide all Counts for Groups

$(this).find("span:last").remove();

});

Probably the most simple way to hide View header would be to use CSS

1 Add Content Editor web part on View page (located under Media & Content category)

2 Insert the following code into CEWP

<style type="text/css">

.ms-viewheadertr { display:none; }

</style>

When you use the "Promoted Links" web part on one of your pages, there is the possibility that the web part uses a lot of horizontal space, because you need to display a large number of tiles; for example, 12 tiles. For an aesthetically-pleasing display of the tiles, without cumbersome scroll buttons, you would need a large 16:9 monitor.

So wouldn’t it be nice to have the option to cause the tiles to "wrap?" An example of useful wrapping would be breaking up the 12 tiles into 3 rows; 1 row for each 4 tiles. This would create the desired aesthetically pleasing display, without going past the edge of smaller screens. With this small JavaScript,the proper wrapping of tiles is possible.
Just add a "Script Editor" web part to the page and paste the following code to the snippet.

<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js "></script>

<script type="text/javascript">

$(document).ready(function () {

// Update this value to the number of links you want to show per row

var numberOfLinksPerRow = 4;

// local variables

var pre = "<tr><td><div class='ms-promlink-body' id='promlink_row_";

var post = "'></div></td></tr>";

var numberOfLinksInCurrentRow = numberOfLinksPerRow;

var currentRow = 1

// find the number of promoted links we're displaying

var numberOfPromotedLinks = $('.ms-promlink-body > .ms-tileview-tile-root').length;

// if we have more links then we want in a row, let's continue

if (numberOfPromotedLinks > numberOfLinksPerRow) {

// we don't need the header anymore, no cycling through links

$('.ms-promlink-root > .ms-promlink-header').empty();

// let's iterate through all the links after the maximum displayed link

for (i = numberOfLinksPerRow + 1; i <= numberOfPromotedLinks; i++) {

// if we're reached the maximum number of links to show per row, add a new row

// this happens the first time, with the values set initially

if (numberOfLinksInCurrentRow == numberOfLinksPerRow) {

// i just want the 2nd row to

currentRow++;

// create a new row of links

$('.ms-promlink-root > table > tbody:last').append(pre + currentRow + post);

// reset the number of links for the current row

numberOfLinksInCurrentRow = 0 }
// move the Nth (numberOfLinksPerRow + 1) div to the current table row$('#promlink_row_' + currentRow).append($('.ms-promlink-body > .ms-tileview-tile-root:eq(' + (numberOfLinksPerRow) + ')'));

// increment the number of links in the current row

numberOfLinksInCurrentRow++; }

}

});

</script>

Note that this script also adds a reference to the jQuerylibrary. When you already have access to jQueryon your SharePoint site you can delete the first row.

After saving your edited page it should look like this:

With the variable "numberOfLinksPerRow" you can control the count of tiles per row.

Reference : http://social.technet.microsoft.com/wiki/contents/articles/19622.sharepoint-2013-promoted-links-wrap-tiles.aspx

SharePoint Broken URL Fix

Posted: March 25, 2015 in SharePoint

SharePoint Broken URL Fix

Often users ends up in a mess trying to change logo or descriptions it playing with site settings and ends up breaking their sub site URL. I often receives such issues from end users and here is the PowerShell script that I use to fix this:

In this case, user accidentally renamed a subsite called Demo to Demo.aspx http://<server name>/SITES/RootSite/Demo.aspx

Set-SPWeb -Identity http://<server name>/SITES/RootSite/ Demo.aspx/ -RelativeURL Demo

Hope this helps J