CategoryTemplate Products view as Grid, Lines and Table

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 года назад
Hello,

Is it possible to modify the template CategoryTemplate.ProductsInGridOrLines under /Admin/Template/List or create a new template to have products listed as Grid, Lines AND TABLE?
3 года назад
Sure, it is possible.
Copy cshtml file, change it according to your needs, add the template to the template list on the admin/system/templates, and edit the product to use the new template.
You may also edit the current template so it will not require modifying the template at each product, but would suggest to make a copy of the current cshtml, so revert changes will be easy.

Regards,
Tom
3 года назад
In my understanding, I would require to edit \Views\Catalog\_CatalogSelectors.cshtml to include the table option and then edit \Views\Catalog\CategoryTemplate.ProductsInGridOrLines.cshtml to include the table view? Also, for a Table view I would perhaps need to add a similar _ProductBox partial view?
3 года назад
nop4you wrote:
Sure, it is possible.
Copy cshtml file, change it according to your needs, add the template to the template list on the admin/system/templates, and edit the product to use the new template.
You may also edit the current template so it will not require modifying the template at each product, but would suggest to make a copy of the current cshtml, so revert changes will be easy.

Regards,
Tom


I have checked this, and it looks like there's only two available View Mode types: grid and lines. They are added in Nop.Web/Factories/CatalogModelFactory.cs

                pagingFilteringModel.AvailableViewModes.Add(new SelectListItem
                {
                    Text = await _localizationService.GetResourceAsync("Catalog.ViewMode.Grid"),
                    Value = _webHelper.ModifyQueryString(currentPageUrl, "viewmode", "grid"),
                    Selected = viewMode == "grid"
                });
                //list
                pagingFilteringModel.AvailableViewModes.Add(new SelectListItem
                {
                    Text = await _localizationService.GetResourceAsync("Catalog.ViewMode.List"),
                    Value = _webHelper.ModifyQueryString(currentPageUrl, "viewmode", "list"),
                    Selected = viewMode == "list"
                });

So it seems that it's not possible to add a 'table' view mode without getting into the core?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.