EN IT
Open2b version 7.8

Departments

Below are documented:

In addition to these, on the department.html page you can also use the variables common to all pages.

department.html

Department page with its products.

Note

For specific departments you can use a template file different from "department.html". The file name must have the "department-" prefix and the ".html" extension, for example "department-books.html".

You can then use the same variables as the department.html page.

Then apply the template to the site and, in the department settings in the admin, choose this template file to render the department.

var (

    // Path from the main department to the current one. When a filter
    // is applied it can also include a producer and attribute values.
    breadcrumbs []Breadcrumb

    // Child departments.
    childDepartments []ChildDepartment

    // Number of columns used to display products.
    columns int

    // Total number of products in the department.
    count int

    // Number of columns used to display child departments.
    departmentColumns int

    // Description.
    description html

    // Department identifier.
    id int

    // Image.
    image HTML

    // Name.
    name string

    // Pagination, lets you move to the next products.
    pagination Pagination

    // Parent department.
    parent Department

    // Department products.
    products []Product

    // Sibling departments. They are the departments at the same level
    // as the current department.
    siblingDepartments []SiblingDepartment

    // Menu to choose product sorting.
    sortBy html

    // Department best sellers.
    topSellers []Product

    // Number of columns used to display top sellers.
    topSellersColumns int

)

departments variable

The departments variable, of type []Department, is used on all store pages to show the departments tree.

{% for department in deparments %} .. {% end for %}