Skip to content

ajshort/silverstripe-itemsetfield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SilverStripe Item Set Field Module

This module provides a number of useful form fields for managing relationships by searching through a list of candidates and selecting the one(s) you want.

Maintainer Contacts

Requirements

  • SilverStripe 2.4+

Installation

  • Place this directory in the root of your SilverStripe installation. Ensure that the folder name is itemsetfield.
  • Regenerate the manifest cache by visiting any page on your site with the ?flush URL parameter set.

Usage Overview

This module provides three main form fields - HasOnePickerField, HasManyPickerField and ManyManyPickerField for managing objects acoss has_one, has_many and many_many relationships respectively.

For basic usage, just use the appropriate form field for your relationship type, and pass the constructor the parent object as the first argument, the relationship name as the second and optional field title as the third.

public function getCMSFields() {
    $fields = parent::getCMSFields();
    $fields->addFieldToTab('Root.Content.HasMany', new HasManyPickerField(
        $this, 'HasManyRelationshipName'
    ));
    return $fields;
}

For more advanced usage all fields accept an array of config options as the fourth constructor argument. See individual fields for what options are available.

Links

About

Provides a set of form fields for searching through and selecting objects.

Resources

Stars

Watchers

Forks

Packages

No packages published