List of free tools for SharePoint

Hello everyone,

Today I’ll do some advertising for another blogger who makes a great post about free tools for SharePoint.

Some of them are new to me and seems pretty awesome! Great job Velin and Thank you for this one!

http://blog.velingeorgiev.pro/sharepoint-online-free-developer-tools-list-more-productivity

 

Hoping this helps,

Christopher.

Advertisements

Quick Win – Display attachments in list

win

Hello everyone,

Today, in the Quick Win series, I’ll talk about the possibility to view attachments in a list view.

By default, when you have one or more attachments to a list item, you see this

attachment1

If you open the properties of the item, you see the full list of attachments

attachment2

To display the full list of attachments in the view of your list, simply add the following JSLink (don’t forget to fix the path for the JQuery file)

(function () { 

// jQuery library is required
(window.jQuery || document.write('<script src="PATH/jquery.min.js"><\/script>'));
// Create object that have the context information about the field that we want to change it output render  

var linkFiledContext = {};
linkFiledContext.Templates = {};
linkFiledContext.Templates.Fields = {
"Attachments": { "View": AttachmentsFiledTemplate }
}; 

SPClientTemplates.TemplateManager.RegisterTemplateOverrides(linkFiledContext); 

})(); 

// This function provides the rendering logic for list view
function AttachmentsFiledTemplate(ctx) {
var itemId = ctx.CurrentItem.ID;
var listName = ctx.ListTitle;
return getAttachments(listName, itemId);
} 

function getAttachments(listName,itemId) {
var url = _spPageContextInfo.webAbsoluteUrl;
var requestUri = url + "/_api/web/lists/getbytitle('" + listName + "')/items(" + itemId + ")/AttachmentFiles";
var str = "";
// execute AJAX request
$.ajax({
url: requestUri,
type: "GET",
headers: { "ACCEPT": "application/json;odata=verbose" },
async: false,
success: function (data) {
for (var i = 0; i < data.d.results.length; i++) {
str += "<a href='" + data.d.results[i].ServerRelativeUrl + "'>" + data.d.results[i].FileName + "</a>";
if (i != data.d.results.length - 1) {
str += "
";
}
}
},
error: function (err) {
console.log(err)
}
});
return str;
}

Et voila!

attachment3

I wish I had the idea but I did not write this code, I found it on this msdn topic (Thanks Denis Guo)

Hoping this helps!

Christopher

Quick Win – Show PDF file preview in classic mode

win

Hello everyone,

Today, in the “Quick Wins” series I will talk about the preview of pdf document in SharePoint in “Classic” mode.

Problematic

As a user,

I want to see the preview of my pdf documents in my library and in my search result

In order to take advantage of this functionality in the same way as for office documents.

Cause

By default PDF files do not display the preview in the call-out menu

In libraries

pdfpreview01

In search result
pdfpreview02

Resolution

In order to use the preview of a PDF, we will tell SharePoint to use Word’s functionality for PDF files.

In libraries

We will use a jsLink file to integrate on desired views. The script to use is the following

window.onload = function () {

SP.SOD.executeFunc('filePreview.js', null, function () {

embeddedWACPreview.dimensions["pdf"] = embeddedWACPreview.dimensions["docx"];

filePreviewManager.previewers.extensionToPreviewerMap["pdf"] = filePreviewManager.previewers.extensionToPreviewerMap["docx"];

});

};

Put this script in a .js file, store it in a library in your site collection, and populate the jsLink in the view.

In search result
Simply create a result type based on the one used for Word and tell it to target pdf documents..

Go to the “Site settings”

In the “Search” section, click “Result Types”

pdfpreview03

Scroll down to Result Type “Microsoft Word” and click “Copy”

pdfpreview04

Give the name you want (PDF) ,choose the “PDF” content type and click “Save”

pdfpreview05.png

Results

In libraries

pdfpreview06

In search result

pdfpreview07.png

Hoping this helps!

Christopher

Quick Win – Contribute No Delete

win

Hello everyone.

Today I will talk about a specific configuration of the permissions

Problematic

As an administrator of my site,

I want my members to be able to add files / items but not to be able to delete them

In order to avoid unwanted deletion of information.

Reason

The standard permission level for members is “Edit”. This level of permission is sometimes replaced by the lower level “Contribute”. These rights allow members to participate in the addition of information to the site but also by default to delete the content.

Contribute no delete (1)

Resolution

To resolve this issue, we will create a new permission level that we will call “Contribute – No Delete”. We will apply it to the member group at the site level.

Go in the site settings

Contribute no delete (2)

Under “Users and Permissions”, click on “Site Permissions”

Contribute no delete (3)

On the ribbon, click on the “Permission Levels” links

Contribute no delete (4)

Choose the permission level “Contribute”

Contribute no delete (5)

Scroll down and click on the “Copy Permission Level” button

Contribute no delete (6)

Add the name “Contribute – No Delete”, set a description and untick the “Delete Items” and “Delete Versions” permissions

Contribute no delete (7)

Scroll down and click on “Create”

Contribute no delete (8)

The permission level is created, go back to the “Site Permission” by clicking the “Permissions” link

Contribute no delete (9)

Select the “Members” group and click on “Edit User Permissions”

Contribute no delete (10)

Select only the “Contribute – No Delete” permission level and click on ok

Contribute no delete (11)

Now your members will see this in the ribbon when they select an item

Contribute no delete (12)

“Edit item” is accessible but “Delete Item” is greyed out.

Hoping it helps.

Christopher.