From 167bc045fe3951965f5df7f10c5370f5b7be643c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 5 Jan 2012 13:45:07 +0100 Subject: [PATCH] MINOR Making page drop down searchable on CMS add form, and ensuring that the default page option is showing first --- code/controllers/CMSMain.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 5a47a52f..17bee34b 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -1061,6 +1061,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr ); $pageTypes[$type->getField('ClassName')] = $html; } + // Ensure generic page type shows on top + if(isset($pageTypes['Page'])) { + $pageTitle = $pageTypes['Page']; + $pageTypes = array_merge(array('Page' => $pageTitle), $pageTypes); + } $numericLabelTmpl = '%d%s'; $fields = new FieldList( @@ -1079,6 +1084,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr 'Page' ) ); + $parentField->setShowSearch(true); $parentField->setValue(($record) ? $record->ID : null); $actions = new FieldList(