1

I've inserted a Pages Web Part on a page (Insert > Web Part > Apps > Pages). This displays a list of pages with links to each page.

The problem is I want to link the Title of the page rather than the Name.

2
  • Add a new field to the Page library and call it PageTitle. Fill in the data and use that in the View. Oct 24 '14 at 17:37
  • How would that link to the page? Won't that just show the value for PageTitle?
    – matt
    Oct 24 '14 at 17:45
2

Since you are using SharePoint 2013 I would recommend you to utilize Client Side Rendering (CSR) technique for that purpose.

How to customize a List View to render a Title as a link to page item

The following JavaScript template demonstrates how to render a Title column as a link to the page item:

(function () {
    function linkTitleRenderer(renderCtx) {
       var item = ctx.CurrentItem;
       return String.format('<a class="ms-listlink" href="{0}">{1}</a>',item.FileRef,item.Title);  
    }

    function registerRenderer()
    {
      var ctxView = {};
      ctxView.Templates = {};
      ctxView.Templates.Fields = {
        "Title": {
            "View": linkTitleRenderer
        }
      };
      SPClientTemplates.TemplateManager.RegisterTemplateOverrides(ctxView);
    } 
    ExecuteOrDelayUntilScriptLoaded(registerRenderer, 'clienttemplates.js');
})();
0

The title of the Wiki pages is always linked to the actual file name of that certain page. So for example you want to create a Wiki page with the title "Microsoft .NET Framework" you have to create that page with the exact same name.

Editing page properties will not show any option to update the title. To fix this open "/_catalogs/masterpage/EnterpriseWiki.aspx" in designer and look for "PlaceHolderPageTitleInTitleArea" and update it as

<asp:Content ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server">
    <SharePoint:ListItemProperty Property="Title" runat="server"/>
</asp:Content>

Once you enable this you can populate the title values for each page and read it through JSOM or JSLinks as explained below

How do you use JS Link with Pages?

2
  • This does not seem to answer the question about how to, in a list view, make the Title field link to the page. Oct 24 '14 at 18:00
  • @RobertLindgren This question was part of the outcome of a previous thread. I have updated my answer with relevant links Oct 24 '14 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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