Some years ago I created a SilverStripe website and added several fields to Page.php. I am currently working on something like this but can not afford to change the project again - now at Silverstream 3.1.10
I have to announce the UI for the page sub-classes , Which does not need all the hereditary areas with some extensions.
How this extension can appear
> class nocturnal extensions {public function update cmsfield (fieldlist $ field) {$ fields- & gt; Extends removeFieldFromTab ("Root.Main", "MenuTitle"); $ Fields- & gt; RemoveFieldFromTab ("Root.Main", "workflow"); }}
config.yml
Redirector page: Extension: - NOKLATOR
For all fields of this field Works on SiteTree
(like Manititel field), but not in the field added to page
(such as Workflow fields) If the extension is on UserDefinedForm
, the workflow has been removed but if this extension is on the redirect page
, So this does not work on the other side MenuTitle is removed in both classes. My guess is this sequence is about my project after : 'frame /', 'cm /'
and hopefully i like a noclutter
work within the project Can I create an extension
How can I get it or how do I work around this problem?
You have to $ this-> At the end of your
need to be expanded. page
getCMSFields ()
function ('updateCMSFields', $ fields)
increases category page citrate {// ... public function getCMSFields () {// call update CMSfield after adding your field to SiteTree :: disableCMSFieldsExtensions (); $ Fields = parent :: getCMSFields (); SiteTree :: enableCMSFieldsExtensions (); // ... $ this- & gt; Expand ('updateCSMSFields', $ fields); Return $ field; }}
The problem you have is $ this-> expand ('updateCMSFields', $ fields)
declares your code where updateCSMSFields ()
The function will be called page
getCMSFields ()
updateCMSFields ()
You are trying to delete the workflow field before you add it to the page
code> function. The reason for this is that the UpdateCMSFields extension hook is declared in the original
SiteTree
getCMSFields ()
function. UserDefinedForm
it resolves $ this- & gt; Call it under the
. An extension hook is said to work to getCMSFields ()
('updateCMSFields', $ field) parent :: getCMSFields ()
before SiteTree :: disableCMSFieldsExtensions ()
.
No comments:
Post a Comment