2017 © Pedro Peláez
 

silverstripe-vendormodule silverstripe-action

Adds basic call to action DataObject.

image

gorriecoe/silverstripe-action

Adds basic call to action DataObject.

  • Monday, July 16, 2018
  • by gorriecoe
  • Repository
  • 1 Watchers
  • 1 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 278 % Grown

The README.md

Silverstripe action

Adds basic call to action DataObject., (*1)

Installation

Composer is the recommended way of installing SilverStripe modules., (*2)

composer require gorriecoe/silverstripe-action

Requirements

  • silverstripe/cms ^4.0
  • gorriecoe/silverstripe-link ^1.0
  • gorriecoe/silverstripe-preview ^1.0

Maintainers

Usage


use gorriecoe\Action\Models\Action; ... class Page extends SiteTree { private static $many_many = [ 'Actions' => Action::class ]; private static $many_many_extraFields = [ 'Actions' => [ 'Sort' => 'Int' ] ]; public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldsToTab( 'Root.Main', [ GridField::create( 'Actions', 'Actions', $this->Actions(), GridFieldConfig_RecordEditor::create() ->addComponent(new GridFieldOrderableRows('Sort')) ) ] ); } }
<% loop Actions.sort('Sort ASC') %>
    <% with Preview %>
        <div class="call-to-action">
            {$Image.Fill(300,200)}
            <h2>
                {$Title}
            </h2>
            <p>
                {$Summary.Summary}
            </p>
            <a href="{$LinkURL}">
                {$Label}
            </a>
        </div>
    <% end_with %>
<% end_loop %>

The Versions

16/07 2018

dev-master

9999999-dev http://github.com/gorriecoe/silverstripe-action

Adds basic call to action DataObject.

  Sources   Download

BSD-3-Clause

The Requires

 

by Gorrie Coe

silverstripe modular