It is possible to "
change the homepage products datalist to a repeater".
Add the following to file:
Modules\HomePageProducts.ascx
<asp:Repeater ID="rptrProducts" runat="server" OnItemDataBound="rptProducts_OnItemDataBound">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<div class="ProductItem">
<div class="title">
<asp:HyperLink ID="hlProduct" runat="server" />
</div>
<div class="picture">
<asp:HyperLink ID="hlImageLink" runat="server" />
</div>
</div>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater>
You can comment out or delete the DataList (dlCatalog).
---
Edit file:
Modules\HomePageProducts.ascx.csUpdate the
BindData() function, comment out/delete the data binding to the DataList (dlCatalog) and add the databinding to the Repeater (rptrProducts) -new lines are underlined.
private void BindData()
{
ProductCollection products = ProductManager.GetAllProductsDisplayedOnHomePage();
if (products.Count > 0)
{
//dlCatalog.DataSource = products;
//dlCatalog.DataBind();
rptrProducts.DataSource = products;
rptrProducts.DataBind();
}
else
{
this.Visible = false;
}
}
Change the function signature for dlRelatedProducts_ItemDataBound(...)
FROM
protected void dlRelatedProducts_ItemDataBound(object sender, DataListItemEventArgs e)
TO
protected void rptProducts_OnItemDataBound(object sender, RepeaterItemEventArgs e)
This is for version 1.40 and you will need to recompile the solution.
.