Category Image on Category Page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Hi

I would like to display the category image I have uploaded for each category at the top of a category page above Cateogry Title (@Model.Name).

I have tried adding @model.PictureModel.ImageUrl in the file CategoryTemplate.ProductsInGridOrLines.cshtml, but this has returned nothing.

Any help would be really appreciated

Thanks
10 years ago
I suspect that might involve some tinkering with the source to get it to work, although it's a good idea to add the option in admin show category picture with the title.

If you can't get that to work and you are not using the category description for anything, you could add your category image with Tiny MCE in the decription box of the category.

Now go back to CategoryTemplateProductsinGridorList and modify like this:

    @Html.Widget("categorydetails_after_breadcrumb")
}
<div class="page category-page">
     @Html.Widget("categorydetails_top")
        @*description*@
        @if (!String.IsNullOrWhiteSpace(Model.Description))
        {
            <div class="category-description">
                @Html.Raw(Model.Description)
            </div>
        }
    <div class="page-title">
        <h1>@Model.Name</h1>
    </div>
The desired picture will appear near your category title, although if you were planning to put any text description for the category that will also appear near the title.
10 years ago
JonNopper wrote:
I suspect that might involve some tinkering with the source to get it to work, although it's a good idea to add the option in admin show category picture with the title.

If you can't get that to work and you are not using the category description for anything, you could add your category image with Tiny MCE in the decription box of the category.

Now go back to CategoryTemplateProductsinGridorList and modify like this:

    @Html.Widget("categorydetails_after_breadcrumb")
}
<div class="page category-page">
     @Html.Widget("categorydetails_top")
        @*description*@
        @if (!String.IsNullOrWhiteSpace(Model.Description))
        {
            <div class="category-description">
                @Html.Raw(Model.Description)
            </div>
        }
    <div class="page-title">
        <h1>@Model.Name</h1>
    </div>
The desired picture will appear near your category title, although if you were planning to put any text description for the category that will also appear near the title.


Thanks for the response, however by adding your suggestion, I only got my category description displayed and not the image.

Thanks for your help though :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.