2017 © Pedro Peláez
 

silverstripe-vendormodule silverstripe-list-to-bootstrap-grid

Create a Bootstrap grid layout from a SilverStripe List

image

axllent/silverstripe-list-to-bootstrap-grid

Create a Bootstrap grid layout from a SilverStripe List

  • Tuesday, February 6, 2018
  • by axllent
  • Repository
  • 1 Watchers
  • 3 Stars
  • 59 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 18 % Grown

The README.md

Create a bootstrap grid layout from a SilverStripe List

Easily create a 12-column grid system from a SilverStripe List. The class returns an ArrayList of rows each containing a items (whatever the List was), the column width, and optional offset (to center-align the last row if it has fewer items than the specified value)., (*1)

This was developed for Bootstrap, however can easily be modified to suit any CSS grid system., (*2)

Requirements

  • SilverStripe ^4 || ^5

Installation

Install via Composer

You can install it via composer with composer require axllent/silverstripe-list-to-bootstrap-grid, (*3)

Basic usage

In your page controller:, (*4)

<?php

use Axllent\ListToBootstrapGrid\ListToBootstrapGrid;

class CategoryPageController extends PageController
{
    public function getProductRows()
    {
        return ListToBootstrapGrid::create(
            $this->Products(),  // The list you wish to convert
            $columns = 3,       // Columns per row - must divide into 12!
            $center = true      // Center-align last row if < than $columns
        );
    }
}

Then in your CategoryPage.ss template:, (*5)

<% loop $ProductRows %>
    <div class="row">
        <% loop $Items %>
            <div class="col-sm-{$Up.Width}<% if $First && $Up.Offset %> col-sm-offset-{$Up.Offset}<% end_if %>">
                <h2>$Title</h2>
                ...
            </div>
        <% end_loop %>
    </div>
<% end_loop %>

The Versions

06/02 2018

dev-master

9999999-dev https://github.com/axllent/silverstripe-list-to-bootstrap-grid

Create a Bootstrap grid layout from a SilverStripe List

  Sources   Download

MIT The MIT License (MIT)

The Requires

 

bootstrap silverstripe list

06/02 2018

dev-silverstripe3

dev-silverstripe3 https://github.com/axllent/silverstripe-list-to-bootstrap-grid

Create a Bootstrap grid layout from a SilverStripe List

  Sources   Download

MIT The MIT License (MIT)

The Requires

 

bootstrap silverstripe list

17/10 2017

2.0.1

2.0.1.0 https://github.com/axllent/silverstripe-list-to-bootstrap-grid

Create a Bootstrap grid layout from a SilverStripe List

  Sources   Download

The MIT License (MIT)

The Requires

 

bootstrap silverstripe list

15/06 2017

2.0.0

2.0.0.0 https://github.com/axllent/silverstripe-list-to-bootstrap-grid

Create a Bootstrap grid layout from a SilverStripe List

  Sources   Download

The MIT License (MIT)

The Requires

 

bootstrap silverstripe list

26/10 2016

1.0.1

1.0.1.0 https://github.com/axllent/silverstripe-list-to-bootstrap-grid

Create a Bootstrap grid layout from a SilverStripe List

  Sources   Download

The MIT License (MIT)

The Requires

 

bootstrap silverstripe list

03/10 2016

1.0.0

1.0.0.0 https://github.com/axllent/silverstripe-list-to-bootstrap-grid

Create a Bootstrap grid layout from a SilverStripe List

  Sources   Download

The MIT License (MIT)

The Requires

 

bootstrap silverstripe list