I have cloned the OOTB display template "Control list" and "Item". Now I would like to change this code which is just a simple list of <ul>
and <li>
tags which are wrapping the content, to a table with cells in some structure. This is the structure I would like to have with 6 items:
<table>
<tr>
<td>picture1</td>
<td>picture2</td>
<td rowspan="2">detail info from the selected picture like : title, description</td>
<td>picture3</td>
</tr>
<tr>
<td>picture4</td>
<td>picture5</td>
<td>picture6</td>
</tr>
</table>
This is how my control templates look alike now:
<div id="Agenda_Control_List">
<!--#_
if (!$isNull(ctx.ClientControl) &&
!$isNull(ctx.ClientControl.shouldRenderControl) &&
!ctx.ClientControl.shouldRenderControl())
{
return "";
}
ctx.ListDataJSONGroupsKey = "ResultTables";
var $noResults = Srch.ContentBySearch.getControlTemplateEncodedNoResultsMessage(ctx.ClientControl);
var noResultsClassName = "ms-srch-result-noResults";
var ListRenderRenderWrapper = function(itemRenderResult, inCtx, tpl)
{
var iStr = [];
iStr.push('<li>');
iStr.push(itemRenderResult);
iStr.push('</li>');
return iStr.join('');
}
ctx['ItemRenderWrapper'] = ListRenderRenderWrapper;
_#-->
<ul class="cbs-Agenda-List">
_#= ctx.RenderGroups(ctx) =#_
</ul>
<!--#_
if (ctx.ClientControl.get_shouldShowNoResultMessage())
{
_#-->
<div class="_#= noResultsClassName =#_">_#= $noResults =#_</div>
<!--#_
}
_#-->
</div>