Wednesday, January 7, 2015

OPEN LIST ITEM ATTACHMENTS WITH A CLICK ON THE PAPERCLIP

OPEN LIST ITEM ATTACHMENTS WITH A CLICK ON THE PAPERCLIP


Another requirement of one of my users is to open file attachments directly by clicking on the paperclip icon without the detour of opening the item first. Alexander Bautz from spjsblog.com wrote the perfect script for this purpose which you can find here on his blog post. Thanks for that!
However, the last update was from mid 2012 and therefore the latest version is not compatible with SharePoint 2013. I made some minor adjustments to the code to restore the compatibility and I added a fade-in and fade-out animation, as well.
And here is how it will look like: ListAttachments_Featured_Image2
All you have to do is uploading this script to the Style Library (or any other document libary, SVN or the Hive )  and putting the following snippet into a CEWP or Script Editor Web Part on the page where you want to to have this functionality.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="..location of the script here../ListAttachments.js"></script>
<script type="text/javascript">
var argObj = {hideIdColumn:true,
              clickToOpen:false,
              clickMouseover:'Click to open',
              oneClickOpenIfSingle:true};
</script>
The four options you can see in the snippet above are as follows:
  1. hideIdColumn: Defines whether the ID column will be hidden or not
  2. clickToOpen: Defines whether you have to click in the paperclip in order to see the list of attached files or not
  3. clickMouseOver: Defines the text in the tooltip when you hover your mouse over the paperclip
  4. oneClickOpenIfSingle: Defines if an attachment is directly opened or not if it is the only attachment of the list item
Have fun with the script!
To Download the latest version : Attachement Script

Sharepoint Designer 2013, XSLT List View Options ribbon option is not showing

Sharepoint Designer 2013, XSLT List View Options ribbon option is not showing I have an ordinary Wiki Page, also tried making an Article...