Hi,
I'm trying to use customize CSWP.I want 5 columns in a template that displays last modified documents. If I take the two lines template and add an extra three lines, it only shows one extra line in the web part settings. Is there any limitation to the number of lines I can add?
As you can see it is all in Hebrew but that shouldn’t matter, if it added one line, why not all three?
Here is the code. It is simple as possible, I did not add any CSS yet or changed the JS, just copied the lines and changed their numbers:
<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"> <head><title>מסמכים</title><!--[if gte mso 9]><xml><mso:CustomDocumentProperties><mso:TemplateHidden msdt:dt="string">0</mso:TemplateHidden><mso:ManagedPropertyMapping msdt:dt="string">'Link URL'{כתובת URL של קישור}:'Path','Line 1'{שורה 1}:'Title','Line 2'{שורה 2}:'','FileExtension','SecondaryFileExtension','Line 3'{שורה 3}:'','Line 4'{שורה 4}:'','Line 5'{שורה 5}:''</mso:ManagedPropertyMapping><mso:MasterPageDescription msdt:dt="string">תבנית תצוגה זו של פריט תציג סמל קטן של תמונה ממוזערת ליד היפר-קישור של כותרת הפריט, עם קו נוסף הזמין עבור מאפיין מנוהל מותאם אישית.</mso:MasterPageDescription><mso:ContentTypeId msdt:dt="string">0x0101002039C03B61C64EC4A04F5361F385106603</mso:ContentTypeId><mso:TargetControlType msdt:dt="string">;#Content Web Parts;#</mso:TargetControlType><mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated><mso:HtmlDesignStatusAndPreview msdt:dt="string">http://galam/sites/HR/_catalogs/masterpage/Display Templates/Content Web Parts/Documents.html, ההמרה הצליחה.</mso:HtmlDesignStatusAndPreview><mso:HtmlDesignConversionSucceeded msdt:dt="string">True</mso:HtmlDesignConversionSucceeded></mso:CustomDocumentProperties></xml><![endif]--></head><body><!-- Warning: Do not try to add HTML to this section. Only the contents of the first <div> inside the <body> tag will be used while executing Display Template code. Any HTML that you add to this section will NOT become part of your Display Template. --><script> $includeLanguageScript(this.url, "~sitecollection/_catalogs/masterpage/Display Templates/Language Files/{Locale}/CustomStrings.js");</script><!-- Use the div below to author your Display Template. Here are some things to keep in mind: * Surround any JavaScript logic as shown below using a "pound underscore" (#_ ... _#) token inside a comment. * Use the values assigned to your variables using an "underscore pound equals" (_#= ... =#_) token. --><div id="FiveLines"><!--#_ var encodedId = $htmlEncode(ctx.ClientControl.get_nextUniqueId() + "_5lines_"); var linkURL = $getItemValue(ctx, "Link URL"); linkURL.overrideValueRenderer($urlHtmlEncode); var iconURL = Srch.ContentBySearch.getIconSourceFromItem(ctx.CurrentItem); var line1 = $getItemValue(ctx, "Line 1"); var line2 = $getItemValue(ctx, "Line 2"); var line3 = $getItemValue(ctx, "Line 3"); var line4 = $getItemValue(ctx, "Line 4"); var line5 = $getItemValue(ctx, "Line 5"); line1.overrideValueRenderer($contentLineText); line2.overrideValueRenderer($contentLineText); line3.overrideValueRenderer($contentLineText); line4.overrideValueRenderer($contentLineText); line5.overrideValueRenderer($contentLineText); var containerId = encodedId + "container"; var pictureLinkId = encodedId + "pictureLink"; var pictureId = encodedId + "picture"; var dataContainerId = encodedId + "dataContainer"; var line1LinkId = encodedId + "line1Link"; var line1Id = encodedId + "line1"; var line2Id = encodedId + "line2"; var line3Id = encodedId + "line3"; var line4Id = encodedId + "line4"; var line5Id = encodedId + "line5"; _#--><div class="cbs-Item" id="_#= containerId =#_" data-displaytemplate="Item2Lines"><a class="cbs-ItemLink" title="_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_" id="_#= pictureLinkId =#_"><img class="cbs-Thumbnail" src="_#= $urlHtmlEncode(iconURL) =#_" alt="_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_" id="_#= pictureId =#_" /></a><div class="cbs-Detail" id="_#= dataContainerId =#_"><a class="cbs-Line1Link ms-noWrap ms-displayBlock" href="_#= linkURL =#_" title="_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_" id="_#= line1LinkId =#_">_#= line1 =#_</a><!--#_ if(!line2.isEmpty) { _#--><div class="cbs-Line2 ms-noWrap" title="_#= $htmlEncode(line2.defaultValueRenderer(line2)) =#_" id="_#= line2Id =#_">_#= line2 =#_</div><!--#_ } _#--><!--#_ if(!line2.isEmpty) { _#--><div class="cbs-Line2 ms-noWrap" title="_#= $htmlEncode(line2.defaultValueRenderer(line2)) =#_" id="_#= line3Id =#_">_#= line3 =#_</div><!--#_ } _#--><!--#_ if(!line2.isEmpty) { _#--><div class="cbs-Line2 ms-noWrap" title="_#= $htmlEncode(line2.defaultValueRenderer(line2)) =#_" id="_#= line4Id =#_">_#= line4 =#_</div><!--#_ } _#--><!--#_ if(!line2.isEmpty) { _#--><div class="cbs-Line2 ms-noWrap" title="_#= $htmlEncode(line2.defaultValueRenderer(line2)) =#_" id="_#= line5Id =#_">_#= line5 =#_</div><!--#_ } _#--></div></div></div></body></html>
Thank you for your help,
Shiri