2017 © Pedro Peláez
 

silverstripe-vendormodule portlets

Module to quickly render portlets of data from a simple template call

image

weboftalent/portlets

Module to quickly render portlets of data from a simple template call

  • Tuesday, May 1, 2018
  • by weboftalent
  • Repository
  • 1 Watchers
  • 1 Stars
  • 224 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

Functionality

Build Status Scrutinizer Code Quality Code Coverage Build Status codecov.io, (*1)

Latest Stable Version Latest Unstable Version Total Downloads License Monthly Downloads Daily Downloads, (*2)

Dependency Status Reference Status, (*3)

codecov.io, (*4)

  • Adds a convenience template call that allows one to search for N of a certain type of DataObject and then render them with a given template.
  • Forces interfaced access to information about the data object such as title and image.

Installation

composer require "weboftalent/portlets:^4"

Usage

Interface for Models

For a model to be rendered as a portlet, it must provide the 3 following methods and implement the RenderableAsPortlet interface, (*5)

public function getPortletTitle();
public function getPortletImage();
public function getPortletCaption();

Templates

The model being rendered must implement the RenderableAsPortlet interface mentioned previously. An example call to render portlets is as follows:, (*6)

$RenderPortlet('Activity','','Title',2,'SmallTitleAndImage')

The parameters are as follows:, (*7)

  • The class name, in this case we are looking objects of class Activity
  • Filter, i.e. the WHERE clause of the search. In this case no filter has been applied
  • The sort field, in this case title.
  • The number of items to return, in this case 2
  • The name of the template used to render the portlets, here SmallTitleAndImage

In the template used to render the portlet, the records can be accessed using <control Records> - an example is below., (*8)

<ul class="slides">
<% control Records %>
<li>
<a href="$Link"><h5>$PortletTitle</h5>
<% control PortletImage %><% control SetWidth(170) %><img src="$URL"/><% end_control %><% end_control %>
</a>
<% end_control %>
</li>
</ul>

Silverstripe Version Compatibility

2.4 (tested with 2.4.5+) - stable24 branch 3.0 - stable30 branch, (*9)

The Versions

01/05 2018

dev-master

9999999-dev

Module to quickly render portlets of data from a simple template call

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe templates weboftalent portlets

01/05 2018

4.0.3

4.0.3.0

Module to quickly render portlets of data from a simple template call

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe templates weboftalent portlets

29/04 2018

4.0.2

4.0.2.0

Module to quickly render portlets of data from a simple template call

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe templates weboftalent portlets

29/04 2018

4.0.1

4.0.1.0

Module to quickly render portlets of data from a simple template call

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe templates weboftalent portlets

28/04 2018

dev-upgradess4

dev-upgradess4

Module to quickly render portlets of data from a simple template call

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe templates weboftalent portlets

28/04 2018

4.0.0

4.0.0.0

Module to quickly render portlets of data from a simple template call

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe templates weboftalent portlets

02/02 2016

3.1.2

3.1.2.0

Module to quickly render portlets of data from a simple template call

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe templates weboftalent portlets

19/01 2016

3.1.1

3.1.1.0

Module to quickly render portlets of data from a simple template call

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe templates weboftalent portlets

19/01 2016

dev-continuous_integration

dev-continuous_integration

Module to quickly render portlets of data from a simple template call

  Sources   Download

The Requires

 

silverstripe templates weboftalent portlets

05/08 2014

3.1.x-dev

3.1.9999999.9999999-dev

Module to quickly render portlets of data from a simple template call

  Sources   Download

The Requires

 

silverstripe templates weboftalent portlets

14/07 2014

dev-dev31

dev-dev31

Module to quickly render portlets of data from a simple template call

  Sources   Download

The Requires

 

silverstripe templates weboftalent portlets

23/01 2013

dev-stable30

dev-stable30

Module to quickly render portlets of data from a simple template call

  Sources   Download

The Requires

 

silverstripe weboftalent portlets

23/01 2013

1.0.0

1.0.0.0

Module to quickly render portlets of data from a simple template call

  Sources   Download

The Requires

 

silverstripe weboftalent portlets

23/01 2013

3.1.0

3.1.0.0

Module to quickly render portlets of data from a simple template call

  Sources   Download

The Requires

 

silverstripe weboftalent portlets