MINOR Upgrading notes around tab rewrites

This commit is contained in:
Ingo Schommer 2012-05-09 17:47:19 +02:00
parent 11f4756225
commit 6655830231
4 changed files with 36 additions and 1 deletions

View File

@ -326,7 +326,7 @@ The page tree moved from a bespoke tree library to [JSTree](http://jstree.com),
which required changes to markup of the tree and its JavaScript architecture.
This includes changes to `TreeDropdownField` and `TreeMultiSelectField`.
### Settings-related fields move from `SiteTree->getCMSFields()` to new `SiteTree->getSettingsFields()` [getcmsfields]###
### Settings-related fields move from SiteTree->getCMSFields() to new SiteTree->getSettingsFields() [getcmsfields]###
The fields and tabs are now split into two separate forms, which required a structural
change to the underlying class logic. In case you have added or removed fields
@ -338,6 +338,41 @@ We've also removed the `$params` attribute on `DataObject->getCMSFields()`
which could be used as a shortcut for customizations to `FormScaffolder`,
in order to achieve E_STRICT compliance. Please use `FormScaffolder` directly.
### Changed tab paths in SiteTree->getCMSFields() {#tab-paths}
In order to simplify the interface, the `SiteTree->getCMSFields`
method now only has one rather than two levels of tabs.
This changes the tab paths, affecting any fields you might have added.
We have also moved all fields from the "Metadata" tab into the "Main Content" tab.
:::php
// 2.4
$fields->addFieldToTab('Root.Content.Main', $myField);
$fields->addFieldToTab('Root.Content.Metadata', $myOtherField);
// 3.0
$fields->addFieldToTab('Root.Main', $myField);
$fields->addFieldToTab('Root.Main', $myOtherField);
![Tab paths in 2.4](_images/tab-paths-before.png)
![Tab paths in 3.0](_images/tab-paths-after.png)
The old paths are rewritten automatically, but will be deprecated in the next point release.
If you are working with tab objects directly in your `FieldSet`, you'll need to update
the tab names manually:
:::php
// 2.4
$fields->fieldByName('Root')->fieldByName('Content')->fieldByName('Main')->push($myField);
// 3.0
$fields->fieldByName('Root')->fieldByName('Main')->push($myField);
If only a single tab is found in any CMS tabset, it is hidden by default
to reduce UI clutter. You still need to address it through the usual tabset methods,
as the underlying object structure doesn't change. Once you add more tabs,
e.g. to the "Root.Main" tab in `SiteTree`, the tab bar automatically shows.
![Tab paths in 3.0 with a custom tab](_images/tab-paths-customtab.png)
### New `SiteTree::$description` field to describe purpose of a page type [sitetree-description]###
Please use this static property to describe the purpose of your page types,

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB