Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =========================
- Title
- Last Modified Date [LastModifiedTime]
- Editor [EditorOWSUSER]
- All access [ViewsLifeTime] Recent Access [ViewsLast3Days]
- =========================
- Blockquote
- <html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
- <head>
- <title>Customized Template</title>
- <!--[if gte mso 9]><xml>
- <mso:CustomDocumentProperties>
- <mso:TemplateHidden msdt:dt="string">0</mso:TemplateHidden>
- <mso:MasterPageDescription msdt:dt="string">This shows Title, Last Modified Date, Editor, All access and recent access for document. </mso:MasterPageDescription>
- <mso:ContentTypeId msdt:dt="string">0x0101002039C03B61C64EC4A04F5361F385106603</mso:ContentTypeId>
- <mso:TargetControlType msdt:dt="string">;#SearchResults;#Content Web Parts;#</mso:TargetControlType>
- <mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated>
- <mso:ManagedPropertyMapping msdt:dt="string">'Title':'Title', 'EditorOWSUSER':EditorOWSUSER', 'LastModifiedTime:'LastModifiedTime', 'ViewsLifeTime':'ViewsLifeTime', 'ViewsLast3Days':'ViewsLast3Days','SecondaryFileExtension','ContentTypeId'
- </mso:ManagedPropertyMapping>
- <mso:HtmlDesignStatusAndPreview msdt:dt="string">https://[URL]/_catalogs/masterpage/Display Templates/Search/Item_Custom.html, 正常に変換されました。</mso:HtmlDesignStatusAndPreview>
- <mso:HtmlDesignConversionSucceeded msdt:dt="string">True</mso:HtmlDesignConversionSucceeded>
- <mso:CrawlerXSLFile msdt:dt="string"></mso:CrawlerXSLFile>
- <mso:HtmlDesignPreviewUrl msdt:dt="string"></mso:HtmlDesignPreviewUrl>
- </mso:CustomDocumentProperties>
- </xml><![endif]-->
- </head>
- <body>
- <div id="Item_Custom">
- <!--#_
- //Get Title
- var title = ctx.CurrentItem.Title;
- var titleHtml = String.format('<a href="{0}" title="{1}" >{2}</a>', $urlHtmlEncode(ctx.CurrentItem.Path), $htmlEncode(title), $htmlEncode(title));
- //Get Editor
- var editorHtml = "";
- if (!$isEmptyString(ctx.CurrentItem.EditorOWSUSER)){
- var editorIdentifiers = ctx.CurrentItem.EditorOWSUSER.split(" | ");
- if(!$isNull(editorIdentifiers[1]))
- {
- editorHtml = "Editor " + editorIdentifiers[1];
- }
- };
- //Get Last ModifiedTime
- var lastModifiedTime = ctx.CurrentItem.LastModifiedTime;
- var lastModifiedTimeHtml = "Last Modifed Date " + lastModifiedTime.getFullYear() + "年" + (lastModifiedTime.getMonth() + 1) + "月" + lastModifiedTime.getDate() +"日";
- //Get ViesLifeTime
- var ViewsLifeTime = ctx.CurrentItem.ViewsLifeTime;
- var ViewsLifeTimeHtml = " All access " + ViewsLifeTime;
- //Get ViewsLast3Days
- var ViewsLast3Days = ctx.CurrentItem.ViewsLast3Days;
- var ViewsLast3DaysHtml = " Recent Access (" + ViewsLast3Days + " )";
- _#-->
- <h3 class="ms-srch-ellipsis">_#=titleHtml=#_</h3><!-- Title -->
- <div> <span>_#=editorHtml=#_</span><!-- Editor --><br>
- <span>_#=lastModifiedTimeHtml=#_</span><!-- Last Modified Date --><br>
- <span>_#=ViewsLifeTimeHtml=#_</span><!-- All access -->
- <span>_#=ViewsLast3DaysHtml=#_</span><!-- Recent access -->
- </div>
- <!--#_
- if(!$isNull(ctx.CurrentItem) && !$isNull(ctx.ClientControl)){
- var id = ctx.ClientControl.get_nextUniqueId();
- var itemId = id + Srch.U.Ids.item;
- var hoverId = id + Srch.U.Ids.hover;
- var hoverUrl = "~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Default_HoverPanel.js";
- $setResultItem(itemId, ctx.CurrentItem);
- if(ctx.CurrentItem.IsContainer){
- ctx.CurrentItem.csr_Icon = Srch.U.getFolderIconUrl();
- }
- ctx.currentItem_ShowHoverPanelCallback = Srch.U.getShowHoverPanelCallback(itemId, hoverId, hoverUrl);
- ctx.currentItem_HideHoverPanelCallback = Srch.U.getHideHoverPanelCallback();
- _#-->
- <div id="_#= $htmlEncode(itemId) =#_" name="Item" data-displaytemplate="DefaultItem" class="ms-srch-item" onmouseover="_#= ctx.currentItem_ShowHoverPanelCallback =#_" onmouseout="_#= ctx.currentItem_HideHoverPanelCallback =#_">
- _#=ctx.RenderBody(ctx)=#_
- <div id="_#= $htmlEncode(hoverId) =#_" class="ms-srch-hover-outerContainer"></div>
- </div>
- <!--#_
- }
- _#-->
- </div>
- </body>
- </html>
- <span ><img src="_#= ctx.CurrentItem.ProfilePhoto =#_" height="150px" width="150px" /></span><br/><br/>
- <span ><img src="_#= ctx.CurrentItem.ProfilePhoto =#_" height="150px" width="150px" /></span><br/><br/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement