nathancox / textfieldgroup
A super simple convenience module for displaying text and textfields inline in the CMS
Installs: 38
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 2
Open Issues: 3
Type:silverstripe-module
Requires
- silverstripe/framework: ~3.0
This package is not auto-updated.
Last update: 2024-12-16 16:25:33 UTC
README
This is intended to make any combination of text fields and labels on a single line. Eg for URLSegments prepended by the domain as a label, or for X, Y and Z coordinates for a single location.
The differences from FieldGroup are a) it takes away the minimum width of fields so things are spaced approriately; and b) if you pass in a string instead of a field it's automatically turned in to a LiteralField
No dramatic functionality, just a convenience class for formatting.
Currently being developed on SilverStripe 3, not tested on 2.x yet.
Maintainer Contacts
- Nathan Cox (nathan@flyingmonkey.co.nz)
Requirements
- SilverStripe 3.0+
Documentation
Installation Instructions
- Place the files in a directory called tagitfield in the root of your SilverStripe installation
- Visit yoursite.com/dev/build to rebuild the database
Usage Overview
The first argument is the field label. All following arguments should be either instances of FormField or strings to be converted in to LiteralFields.
$fields->addFieldToTab('Root.Main', new TextFieldGroup('Map coordinates',
$this->getMapLink() . '/',
new NumericField("LocationX", "", "", 3),
"/",
new NumericField("LocationY", "", "", 3)
));
$fields->addFieldToTab('Root.Main', new TextFieldGroup('Subdomain',
'http://',
new TextField("Subdomain", ""),
'.example.com'
));