Viewing file properties instead of file in SharePoint document library

Multi tool use
Multi tool use


Viewing file properties instead of file in SharePoint document library



I have a document library on SharePoint online with lots of columns for metadata. These columns won't fit in a single view on screen, so I want the users to first view the properties of the file before downloading them.



Is there a way to change the behavior of the SharePoint library ensure that the user views the file properties first when they click on the filename?



PS: I understand I could have used lists, but after loading about 10000 documents, I have decided to use it as a last resort. Thank you.




1 Answer
1



Custom the LinkFilename field by CSR.



Sample code:


(function () {
'use strict';

var CustomWidthCtx = {};

/**
* Initialization
*/
function init() {

CustomWidthCtx.Templates = {};

CustomWidthCtx.Templates.Fields = {
'LinkFilename': {
'View': customDisplay
}
};

// Register the custom template
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(CustomWidthCtx);
}

/**
* Rendering template
*/
function customDisplay(ctx) {
var currentVal = '';
//from the context get the current item and it's value
if (ctx != null && ctx.CurrentItem != null)
currentVal = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];

var el = "<div class='ms-vb itx' id='" + ctx.CurrentItem.ID + "' app='' ctxname='ctx37'><a title='" + ctx.CurrentItem._ShortcutUrl + "' class='ms-listlink ms-draggable' aria-label='Shortcut file' onfocus='OnLink(this)' href='/Doc4/Forms/EditForm.aspx?ID=" + ctx.CurrentItem.ID + "' target='_blank' DragId='17'>" + ctx.CurrentItem.FileLeafRef + "</a></div>";

// Render the HTML5 file input in place of the OOTB
return el;
}

// Run our intiialization
init();

})();






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

y8Ror7qvyI,uXLdwvzPcpK5MAOyXl,10
wG kzu5Gj0dzQ2fzPSgTs

Popular posts from this blog

Rothschild family

Cinema of Italy