Thanks for the quick answer but I have created a new page a level up from that (same as the manufacturers page from the View All link) and used this code in the .ascx page:
<asp:DataList ID="dlCategories" runat="server" RepeatColumns="3" RepeatDirection="Horizontal"
RepeatLayout="Table" OnItemDataBound="DlCategories_OnItemDataBound" ItemStyle-CssClass="item-box">
<ItemTemplate>
<div class="manufacturer-item">
<h2 class="man-title">
<asp:HyperLink ID="hlCategory" runat="server" />
</h2>
<div class="picture">
<asp:HyperLink ID="hlImageLink" runat="server" />
</div>
</div>
</ItemTemplate>
And this code in the .cs page:
namespace NopSolutions.NopCommerce.Web
{
public partial class CategoriesPage : BaseNopFrontendPage
{
protected void Page_Load(object sender, EventArgs e)
{
SEOHelper.RenderTitle(this, GetLocaleResourceString("PageTitle.Categories"), true);
if (!IsPostBack)
{
dlCategories.DataSource = this.CategoryService.GetAllCategories();
dlCategories.DataBind();
}
}
protected void DlCategories_OnItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
var category = e.Item.DataItem as Category;
string categoryURL = SEOHelper.GetCategoryUrl(category);
var hlImageLink = e.Item.FindControl("hlImageLink") as HyperLink;
if (hlImageLink != null)
{
hlImageLink.ImageUrl = this.PictureService.GetPictureUrl(category.PictureId, this.SettingManager.GetSettingValueInteger("Media.Category.ThumbnailImageSize", 125), true);
hlImageLink.NavigateUrl = categoryURL;
hlImageLink.ToolTip = String.Format(GetLocaleResourceString("Media.Manufacturer.ImageLinkTitleFormat"), category.LocalizedName);
hlImageLink.Text = String.Format(GetLocaleResourceString("Media.Manufacturer.ImageAlternateTextFormat"),category.LocalizedName);
}
var hlCategory = e.Item.FindControl("hlCategory") as HyperLink;
if (hlCategory != null)
{
hlCategory.NavigateUrl =categoryURL;
hlCategory.ToolTip = String.Format(GetLocaleResourceString("Media.Manufacturer.ImageLinkTitleFormat"), category.LocalizedName);
hlCategory.Text = Server.HtmlEncode(category.LocalizedName);
}
I haven't changed the manufacturer in the imagelink resources yet.
Was thinking there is a way to get only the top level categories into the databind but not sure how ?