nopcommerce category template

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
hello,
i would like to know if it is possible to change the appearace when showing categories. Since for every category i have to add about 100 subcategories, I would like to see them as a list, without any images, so that i reduce the occupated space per page.

Thank you in advance,
Ciambella
7 years ago
You need to comment out lines 82 to 86 of CategoryTemplate.ProductsInGridOrLines located in Views -> Catalog so that the page of code look like below:

@*subcategories*@
        
        @if (Model.SubCategories.Count > 0)
        {
            <div class="category-grid sub-category-grid">
                <div class="item-grid">
                    @foreach (var item in Model.SubCategories)
                    {
                        <div class="item-box">
                            <div class="sub-category-item">
                                <h2 class="title">
                                    <a href="@Url.RouteUrl("Category", new { SeName = item.SeName })" title="@item.PictureModel.Title">
                                        @item.Name
                                    </a>
                                </h2>
                               @* <div class="picture">
                                    <a href="@Url.RouteUrl("Category", new { SeName = item.SeName })" title="@item.PictureModel.Title">
                                        <img alt="@item.PictureModel.AlternateText" src="@item.PictureModel.ImageUrl" title="@item.PictureModel.Title" />
                                    </a>
                                </div>*@
                            </div>
                        </div>
                    }
                </div>
            </div>
        }

and maybe delete the item-box div, don't forget the closing tag!
7 years ago
Hello everybody,

In addition to that discussion do you know what is CategoryTemplateId in database for categories?

Thank you in advance,

Konstantinos
7 years ago
kokkinakiskonst wrote:
Hello everybody,

In addition to that discussion do you know what is CategoryTemplateId in database for categories?

Thank you in advance,

Konstantinos


Hi,

you can create your own category template and add it here: admin area -> System -> Templates -> Category templates.
If you have more than one category template there, you will see a dropdown list on the category edit/create page that allows you to select a template. So CategoryTemplateId is an id of the selected category template.
4 years ago
NopCommerce needs to rethink their menu organization scheme.  It's very convoluted and disjointed. can't seem to figure out the logic for how settings are organized.

Changing the template for a category requires changes in several pages deep in the administration pages.  First you must create a new template in your themes folder, then you need to add it to the Admin/setting/Catalog page.  Then you need to change it for the categories under Admin/Category/List.  The problem isn't the number of steps, as this is fairly a complex operation.  It's finding where you need to make all the changes as their not organized in a logical way to either the programmer or end-user.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.