Download the PHP package silvercommerce/complex-category without Composer
On this page you can find all versions of the php package silvercommerce/complex-category. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download silvercommerce/complex-category
More information about silvercommerce/complex-category
Files in silvercommerce/complex-category
Package complex-category
Short Description Categories that allow more complex frontent functionality (such as sorting and selection of page length)
License BSD-3-Clause
Homepage http://github.com/silvercommerce/complex-category
Informations about the package complex-category
Complex Category
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.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
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.
All versions of complex-category with dependencies
silvercommerce/catalogue-admin Version 1.*@dev
silvercommerce/catalogue-frontend Version 1.*@dev