{"id":1743,"date":"2013-05-10T11:11:03","date_gmt":"2013-05-10T11:11:03","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=1743"},"modified":"2024-04-26T12:56:19","modified_gmt":"2024-04-26T12:56:19","slug":"a-link-straight-to-a-sharepoint-documents-metadata","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/a-link-straight-to-a-sharepoint-documents-metadata\/","title":{"rendered":"A link straight to a SharePoint document\u2019s metadata"},"content":{"rendered":"<p>Often users want a link direct to a document\u2019s metadata. That\u2019s easily done using this format:<br \/>\nht tp:\/\/SharePoint\/sites\/SiteCol\/DemoMajorV2\/forms\/DispForm.aspx?ID=[x]<\/p>\n<p>Here\u2019s a sample link to a document\u2019s metadata properties, just add the ID:<br \/>\nht tp:\/\/SharePoint\/sites\/SiteCol\/DemoMajorV2\/forms\/DispForm.aspx?ID=285<\/p>\n<p>I took a random document:<br \/>\nh ttp:\/\/SharePoint\/sites\/SiteCol\/DemoMajorV2\/TestDoc.docx<\/p>\n<p>Found its ID in the browser by adding it to a View:<br \/>\nht tp:\/\/SharePoint\/sites\/SiteCol\/DemoMajorV2\/Forms\/My%20Documents.aspx<\/p>\n<p>Then took the format:<br \/>\nht tp:\/\/SharePoint\/sites\/SiteCol\/DemoMajorV2\/forms\/DispForm.aspx?ID=[x] and added the number to it:<\/p>\n<p>ht tp:\/\/SharePoint\/sites\/SiteCol\/DemoMajorV2\/forms\/DispForm.aspx?ID=285<\/p>\n<p>That same format can be used within the search XSL to add a reference to view the document\u2019s metadata in search results. Here\u2019s the XSL to paste into the XSL field in Core Search Results:<\/p>\n<pre lang=\"php\">\r\n<div class=\u201dsrch-Title3\u2033>\r\n <xsl:variable name=\u201ditemid\u201d select=\u201dItemID\u201d\/>\r\n <xsl:choose>\r\n <xsl:when test=\u201dcontentclass[. = 'STS_ListItem_DocumentLibrary']\u201c>\r\n <xsl:choose>\r\n <xsl:when test=\u201dcontains(basic4,\u2019http\u2019)\u201d>\r\n <xsl:variable name=\u201dlibrary\u201d select=\u201dsubstring-after(substring-after(url,basic4),\u2019\/')\u201d \/>\r\n <xsl:variable name=\u201ddisplayUrl\u201d select=\u201dconcat(basic4, \u2018\/\u2019, substring-before($library,\u2019\/'),\u2019\/Forms\/DispForm.aspx?ID=\u2019,itemid)\u201d \/>\r\n <a href=\u201d{$displayUrl}\u201d>\r\n Show properties\r\n <\/a>\r\n <\/xsl:when>\r\n <xsl:otherwise>\r\n <xsl:variable name=\u201dDocLib\u201d select=\u201dsubstring-after(substring-after(url,sitename),\u2019\/')\u201d \/>\r\n <xsl:variable name=\u201dMetaDataPath\u201d select=\u201dconcat(sitename, \u2018\/\u2019, substring-before($DocLib,\u2019\/'),\u2019Forms\/DispForm.aspx?ID=\u2019,itemid)\u201d \/>\r\n <a href=\u201d{$MetaDataPath}\u201d>\r\n Show properties\r\n <\/a>\r\n <\/xsl:otherwise>\r\n  \r\n<\/xsl:choose>\r\n <a href=\u201d{sitename}\u201d>\r\n Show library\r\n <\/a>\r\n <br><\/br>\r\n <\/xsl:when>\r\n <xsl:otherwise>\r\n <\/xsl:otherwise>\r\n <\/xsl:choose>\r\n<\/div>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Often users want a link direct to a document\u2019s metadata. That\u2019s easily done using this format: ht tp:\/\/SharePoint\/sites\/SiteCol\/DemoMajorV2\/forms\/DispForm.aspx?ID=[x] Here\u2019s a sample link to a document\u2019s metadata properties, just add the ID: ht tp:\/\/SharePoint\/sites\/SiteCol\/DemoMajorV2\/forms\/DispForm.aspx?ID=285 I took a random document: h ttp:\/\/SharePoint\/sites\/SiteCol\/DemoMajorV2\/TestDoc.docx Found its ID in the browser by adding it to a View: ht tp:\/\/SharePoint\/sites\/SiteCol\/DemoMajorV2\/Forms\/My%20Documents.aspx Then [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":1746,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[58],"tags":[],"class_list":["post-1743","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fast-search"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=1743"}],"version-history":[{"count":2,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1743\/revisions"}],"predecessor-version":[{"id":1748,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1743\/revisions\/1748"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/1746"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=1743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=1743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=1743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}