定制 silvercommerce/complex-category 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

silvercommerce/complex-category

Composer 安装命令:

composer require silvercommerce/complex-category

包简介

Categories that allow more complex frontent functionality (such as sorting and selection of page length)

README 文档

README

Scrutinizer Code Quality

Category that allows sorting of products and selecting pagination length

Installation

Install this module using composer

composer require silvercommerce/complex-category

Usage

This module adds a new category type called "Complex Category" that you can add via the admin interface. These categories allow you to add a SortLimitForm that will add "sort" and "show" dropdowns and automatically update the product list.

Add Form to Template

This module requires you to add a $SortLimitForm variable to your category templates.

You can add this to all category templates, or specify a specific template for your complex category.

Customising sort and page length options

You can add custom sort and page length options via SilverStripe config. The config options are as follows.

ComplexCategoryController.sort_options

An array of sort options, where the key is the sort (which is loaded into the DataList::sort() call) and the value is what is loaded in the dropdown.

If you wanted to add a "Date Added" field to the sort, you could add the following to your config.yml

ComplexCategoryController:
  sort_options:
    "Created ASC": "Added (most recent first)"
    "Created DESC": "Added (oldest first)"

ComplexCategoryController.show_options

An array of page length options, where the key is the length (used by PaginatedList::setPageLength())and the value is what is loaded in the dropdown.

If you wanted to add 120 and 150 to the field, you could add the following to your config.yml

ComplexCategoryController:
  show_options:
    "120": "120"
    "150": "150"

NOTE: To attempt to help protect against attacks such as SQL injection, none of the above pass queries are passed via the URL, instead a index of the selected option is passed and then the controller selects the appropriate setting.

统计信息

  • 总下载量: 451
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-08-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固