Coder Social home page Coder Social logo

helpfulrobot / salted-herring-silverstripe-shortlist Goto Github PK

View Code? Open in Web Editor NEW

This project forked from salted-herring/silverstripe-shortlist

0.0 2.0 0.0 39 KB

Shortlist module for SilverStripe

License: BSD 3-Clause "New" or "Revised" License

PHP 93.75% Scheme 6.25%

salted-herring-silverstripe-shortlist's Introduction

silverstripe-shortlist

Build Status Scrutinizer Code Quality Build Status

Session based shortlist module for SilverStripe

This module allows for front end users to create shortlists of pages or dataobjects (which must have associated controllers & Links) which exist within the site. The shortlist is stored against the users' session (so adding/removing items only occurs during the session), but a unique URL for the particular shortlist may be shared.

Install

The module can be installed via composer:

composer require saltedherring/silverstripe-shortlist

Afterwards run a dev/build

Configuration Options

_config/_config.yml:

---
Name: shortlist
After: 'framework/*','cms/*'
---
ShortList:
  URLSegment: '/shortlist/'
  PaginationCount: 12

The base URL segment can be modified here, as can the pagination count (for the page that displays the actual list of items).

  • Ensure that URL Segment can dynamically generate the route.

ShortList Object requirements

For an object to be able to be added to the shortlist it must:

  • Provide a Link function
  • Extend ShortListExtension

Front-end

The shortlist may be added to any template by including the supplied ShortListLinks ss include:

<% include ShortListLinks %>

This will provide a mechanism to allow objects to be added & removed from the shortlist.

The other templates provided are:

  • templates/Layout/ShortList.ss (provides the template for the actual shortlist, including pagination controls)

  • templates/Layout/ShortList_empty.ss (for displaying empty shortlist messages)

  • Supply AJAX example use of pagination & add/remove links.

TO DO

  • Ensure that URL Segment can dynamically generate the route.
  • Supply AJAX example use of pagination & add/remove links.
  • Fix unit tests so they work in travis.

Coding Standards

The code has been written to PSR1.

salted-herring-silverstripe-shortlist's People

Contributors

simonwinter avatar scrutinizer-auto-fixer avatar

Watchers

James Cloos avatar helpfulrobot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.