diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 871052b35..f12666e5d 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -500,6 +500,42 @@ class LeftAndMain extends Controller { return false; } } + + /** + * @return ArrayList + */ + public function Breadcrumbs($unlinked = false) { + $title = self::menu_title_for_class($this->class); + $items = new ArrayList(array( + new ArrayData(array( + 'Title' => $title, + 'Link' => ($unlinked) ? false : $this->Link() + )) + )); + $record = $this->currentPage(); + if($record) { + if($record->hasExtension('Hierarchy')) { + $ancestors = $record->getAncestors(); + $ancestors->push($record); + foreach($ancestors as $ancestor) { + $items->push(new ArrayData(array( + 'Title' => $ancestor->Title, + 'Link' => ($unlinked) ? false : Controller::join_links($this->Link('show'), $ancestor->ID) + ))); + } + } else { + $items->push(new ArrayData(array( + 'Title' => $record->Title, + 'Link' => ($unlinked) ? false : Controller::join_links($this->Link('show'), $record->ID) + ))); + } + } + + // TODO Remove once ViewableData->First()/Last() is fixed + foreach($items as $i => $item) $item->iteratorProperties($i, $items->Count()); + + return $items; + } /** * @return String HTML diff --git a/admin/css/screen.css b/admin/css/screen.css index 9e9a0c9c8..a5c4b7324 100644 --- a/admin/css/screen.css +++ b/admin/css/screen.css @@ -231,7 +231,8 @@ body.cms { overflow: hidden; } .cms-preview, .cms-menu, .cms-content, .cms-content-header, .cms-content-tools, .cms-content-fields, .cms-edit-form, .cms-preview, .cms-preview iframe, .cms-preview-controls { *display: inline; } .cms-content-header { padding: 0px 8px 8px; height: 32px; z-index: 60; background-image: url(../images/textures/cms_content_header.png); background-repeat: repeat; } -.cms-content-header h2 { float: left; padding: 8px 8px 0 0; font-size: 14px; line-height: 24px; font-weight: bold; text-shadow: #bfcad2 1px 1px 0; width: 176px; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; o-text-overflow: ellipsis; } +.cms-content-header a { color: #1556b2; } +.cms-content-header h2 { float: left; padding: 8px 8px 0 0; font-size: 14px; line-height: 24px; font-weight: bold; text-shadow: #bfcad2 1px 1px 0; max-width: 400px; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; o-text-overflow: ellipsis; } .cms-content-header > div { width: 9999em; overflow: hidden; } .cms-content-header .cms-content-header-tabs { position: fixed; right: 40px; } diff --git a/admin/scss/_style.scss b/admin/scss/_style.scss index ef77250a0..ac8015511 100644 --- a/admin/scss/_style.scss +++ b/admin/scss/_style.scss @@ -107,6 +107,10 @@ body.cms { image:url(../images/textures/cms_content_header.png); repeat:repeat; } + + a { + color: $color-text-blue-link; + } h2 { float: left; @@ -115,7 +119,7 @@ body.cms { line-height: $grid-x * 3; font-weight: bold; text-shadow: darken($color-widget-bg, 15%) 1px 1px 0; - width: $grid-x * 22 /* 24 - (padding on each side + margin) */; + max-width: $grid-x*50; margin: 0; @include hide-text-overflow(); } diff --git a/admin/templates/CMSBreadcrumbs.ss b/admin/templates/CMSBreadcrumbs.ss new file mode 100644 index 000000000..78c7de5ca --- /dev/null +++ b/admin/templates/CMSBreadcrumbs.ss @@ -0,0 +1,7 @@ +<% control Breadcrumbs %> + <% if Last %> + $Title.XML + <% else %> + $Title.XML / + <% end_if %> +<% end_control %> \ No newline at end of file diff --git a/admin/templates/Includes/LeftAndMain_EditForm.ss b/admin/templates/Includes/LeftAndMain_EditForm.ss index 74f9cdd12..a7d680857 100644 --- a/admin/templates/Includes/LeftAndMain_EditForm.ss +++ b/admin/templates/Includes/LeftAndMain_EditForm.ss @@ -3,8 +3,10 @@ <% end_if %>