1

I'm trying to make all the titles in the column "Title" (the default title) clickable to direct me to a specific site page in SharePoint2013 as shown:

    <ViewFields>
<FieldRef Name="Title"/>
<FieldRef Name="Project"/>
<FieldRef Name="X"/>
<FieldRef Name="Y"/>
<FieldRef Name="Z"/>
  </ViewFields>

How do I do that using JS in SharePoint designer?

2
  • Are you using Modern UI (SharePoint Online / SharePoint 2019) or you are using Classic Experience? Commented Aug 16, 2022 at 3:45
  • @KalpeshVaghela I'm using SharePoint online 2013 and SharePoint designer 2013
    – Bloom
    Commented Aug 16, 2022 at 4:20

1 Answer 1

1

You can use JS Link to customize rendering of Title column.

Official Documentation for JS Link: https://docs.microsoft.com/en-us/archive/msdn-magazine/2014/june/sharepoint-using-jslink-with-sharepoint-2013

You can use below Code in JS Link:

    (function () {
    var overrideCtx = {};
    overrideCtx.Templates = {};
    overrideCtx.Templates.Fields = {
        'Title': { 'View': renderPercentComplete }
    };
    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
})();

function renderPercentComplete(ctx) {

    var fieldVal = ctx.CurrentItem.Title;
    var html = '<a href="{Your Link Here}">' + fieldVal  + '</a>';
    return html;
}

Make sure that you add Title column in your view as shown in below screen shot:

enter image description here

3
  • I could't find the column Title(Linked to item with edit menu), and it doesn't seem to work with the column Title.
    – Bloom
    Commented Aug 16, 2022 at 7:38
  • Can you share screen shot of the view setting where you are trying to find this column? Commented Aug 16, 2022 at 7:42
  • I posted the screen shot
    – Bloom
    Commented Aug 16, 2022 at 7:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.