2017 © Pedro Peláez
 

silverstripe-module bootstrap_orderable_frontend

Frontend orderable paginated lists

image

andrelohmann-silverstripe/bootstrap_orderable_frontend

Frontend orderable paginated lists

  • Tuesday, March 22, 2016
  • by andrelohmann
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

bootstrap_orderable_frontend

Maintainers

  • Andre Lohmann (Nickname: andrelohmann)

Requirements

Silverstripe 3.2.x, (*1)

Overview

This Module provides a nice paradigm to build orderable collections on the frontend The orderable list will be paginated and ajaxified (, (*2)

Usage

create an OrderablePaginatedList in your controller action and add an ajax statement, (*3)

class MyController extends Controller {

    ...

    public function orderableobjects(){

        $List = MyOrderableObject::get()->sort('Sort');
        $MyOrderableObjects = new OrderablePaginatedList($List, $this->request);
        $MyOrderableObjects->setPageLength(10)->setSortField('Sort');
        // if the sortable list is a many many relation
        // $MyOrderableObjects->setOwner($OwnerObject)->setManyMany('NAME_OF_MANY_MANY_RELATION');

        if($this->request->isAjax()) {
            return $this->customise(array(
                "Objects" => $MyOrderableObjects->process(), // process the ordering after OrderablePaginatedList has all information it needs (pageLength, SortField, Owner, ManyManyRelation)
                "URL" => $this->request->getURL(true) // add this for BackURL parameter
            ))->renderWith('OrderableObjectsList');
        }

        return $this->customise(new ArrayData(array(
            "Title" => "My Orderable Objects",
            "Objects" => $MyOrderableObjects,
            "URL" => $this->request->getURL(true) // add this for BackURL parameter
        )))->renderWith(
            array('Page_orderableobjects', $this->stat('template_main'), $this->stat('template'))
        );
    }

use templates/Layout/Page_orderableobjects.ss and templates/Includes/OrderableObjectsList.ss as base templates to build your own orderable paginated lists, (*4)

Notice

This repository uses the git flow paradigm. After each release cycle, do not forget to push tags, master and develop to the remote origin, (*5)

git push --tags
git push origin develop
git push origin master

The Versions

22/03 2016

dev-develop

dev-develop

Frontend orderable paginated lists

  Sources   Download

BSD-3-Clause

The Requires

 

framework silverstripe

22/03 2016

dev-master

9999999-dev

Frontend orderable paginated lists

  Sources   Download

BSD-3-Clause

The Requires

 

framework silverstripe

22/03 2016

1.0.1

1.0.1.0

Frontend orderable paginated lists

  Sources   Download

BSD-3-Clause

The Requires

 

framework silverstripe

01/09 2015

v1.0.0

1.0.0.0

Frontend orderable paginated lists

  Sources   Download

BSD-3-Clause

The Requires

 

framework silverstripe

04/08 2015

v0.1

0.1.0.0

Frontend orderable paginated lists

  Sources   Download

BSD-3-Clause

The Requires

 

framework silverstripe