Categories on homepage

Monday, November 25, 2024 2:14:37 PM
  • Posted: Saturday, October 1, 2022 6:29 PM
  • 13
Is the layout for categories on homepage hardcoded or possible to set it in settings?
Can set the layout for example 4 col or 3 col for categories on homepage or must change the code?


@model IList<CategoryModel>
@inject DisplayOrderHomePage order
<div class="categoryGrid  order-@order.HomePageCategories">
    <div cols="12" class="col-12 px-0">
        <div class="form-row">
            @foreach (var item in Model)
            {
                <div class="col-xl-@order.Pc_Xl col-lg-@order.Pc_Lg col-md-@order.Pc_Md col-sm-@order.Pc_Sm col-@order.Pc_Col">


That @order.Pc_Xl.. @order.Pc_Lg .. @order.Pc_Md.. comes from DisplayOrderHomePage.cs



using Grand.Domain.Configuration;

namespace Grand.Domain.Common
{
    public class DisplayOrderHomePage : ISettings
    {
        //Home page categories
        public int HomePageCategories { get; set; }
        public int Pc_Xl { get; set; } = 4; //default 4
        public int Pc_Lg { get; set; } = 4; //default 4
        public int Pc_Md { get; set; } = 6; //default 6
        public int Pc_Sm { get; set; } = 6; //default 6
        public int Pc_Col { get; set; } = 12; //default 12


0
  • Posted: Tuesday, October 4, 2022 4:29 PM
  • Team
  • 152
This settings are hidden, can be manage from database. But before you need to insert new records in Settings collection in MongoDB.
0
back to top
Filters