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.
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.
Since you are using SharePoint 2013 I would recommend you to utilize Client Side Rendering (CSR) technique for that purpose.
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');
})();
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