Download the PHP package arillo/silverstripe-elements without Composer

On this page you can find all versions of the php package arillo/silverstripe-elements. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-elements

SilverStripe Elements

Latest Stable Version  Total Downloads

Decorates a SiteTree class with multiple named element relations through a has_many "Elements" relation.

Requirements

SilverStripe CMS ^4.0

For a SilverStripe 3.x compatible version of this module, please see the 1 branch, or 0.x release line.

Todo

Usage

Set up you relation types in your _config/elements.yml, e.g:

In this example we are creating 2 element relationships to the Page, one called Elements, the other called Downloads.

To make it work Element class should subclass ElementBase, where all additional fields can be defined, e.g.:

In the SiteTree instance the element relations are now accessable through:

To use them in a template:

Notice: we pass in the $Pos, $First, $Last and $EvenOdd values to have them available inside the template as $IsPos, $IsFirst, $IsLast and $IsEvenOdd.

There is also a helper function to move a gridfield into another tab if you prefer:

Nested Element relations

Apply the same extension to the Element instead of the Page.

Element inheritance

If you would like to have the same elements applied to different Pagetypes you can use the element_relations_inherit_from definition referencing a arbitrary setup in the yml file. For example if we want the HomePage and the EventsPage to inherit the same elements we can define the .yml like this:

They both reference the MainElements defined in the yml where you have defined the element_relations, like this:

If you inherit elements you can still create your custom relations and also append new Element types to the inherited relation.

In this example ImageElement is added to the list of available Elements defined in MainElements.

URLSegmentField

If you want to show the URLSegment field in the cms, you can opt-in via the config show_urlsegment_field

Bulkuploader

There is support for using Colymba\BulkUpload\BulkUploader for an relation to a single element. E.g. given the following relation:

you can apply a bulkuploader in ImagesElement:

Translation

Naming of Tab and GridField labels can be done through silverstripes i18n. There is a special key called Element_Relations reserved to accomplish this task, e.g. in de.yml:

Populate default elements

A button below the Element GridField called "Create default elements" will populate the default elements defined in your _config.yml as empty elements in your page. If you trigger the action again it will counter-check against the already created elements and don't add any duplicates.

You can define the element_defaults for each of your relations like this:

Fluent integration

To use fluent with elements just add the Fluent extensions to the ElementBase:

Options

Use a tab instead of inline field when only one relation available

Changelog:

2.2.5

2.1.9

– added support for SS 4.4 GridFieldDetailForm::setShowAdd – removed 'onAfterDelete' hook, if you need auto deletion, add:

2.1.8

2.1.0

2.0.0

0.2.0

0.1.0


All versions of silverstripe-elements with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package arillo/silverstripe-elements contains the following files

Loading the files please wait ....