Download the PHP package weboftalent/portlets without Composer
On this page you can find all versions of the php package weboftalent/portlets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download weboftalent/portlets
More information about weboftalent/portlets
Files in weboftalent/portlets
Download weboftalent/portlets
More information about weboftalent/portlets
Files in weboftalent/portlets
Vendor weboftalent
Package portlets
Short Description Module to quickly render portlets of data from a simple template call
License BSD-3-Clause
Package portlets
Short Description Module to quickly render portlets of data from a simple template call
License BSD-3-Clause
Please rate this library. Is it a good library?
Informations about the package portlets
Functionality
- 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
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
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:
$RenderPortlet('Activity','','Title',2,'SmallTitleAndImage')
The parameters are as follows:
- 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.
<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
All versions of portlets with dependencies
PHP Build Version
Package Version
The package weboftalent/portlets contains the following files
Loading the files please wait ....