Skip to content

Commit d2b2a41

Browse files
authored
Merge pull request #407 from topcoder-platform/issues-389
Issues-389: show 'Home' in the breadcrumbs
2 parents 5639a92 + 32c66f3 commit d2b2a41

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

vanilla/applications/vanilla/controllers/class.draftscontroller.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function index($offset = '0') {
3232
$this->addJsFile('jquery.gardenmorepager.js');
3333
$this->addJsFile('discussions.js');
3434
$this->title(t('My Drafts'));
35+
$this->setData('Breadcrumbs', [['Name' => t('My Drafts'), 'Url' => '/drafts']]);
3536

3637
// Validate $Offset
3738
if (!is_numeric($offset) || $offset < 0) {

vanilla/library/SmartyPlugins/function.breadcrumbs.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@ function smarty_function_breadcrumbs($params, &$smarty) {
2323

2424
$options = arrayTranslate($params, ['homeurl' => 'HomeUrl', 'hidelast' => 'HideLast']);
2525

26-
// Don't show a home link by default
27-
return Gdn_Theme::breadcrumbs($breadcrumbs, val('homelink', $params, false), $options);
26+
return Gdn_Theme::breadcrumbs($breadcrumbs, val('homelink', $params, true), $options);
2827
}

vanilla/library/core/class.theme.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static function assetEnd() {
5757
* @param array $options
5858
* @return string
5959
*/
60-
public static function breadcrumbs($data, $homeLink = false, $options = []) {
60+
public static function breadcrumbs($data, $homeLink = true, $options = []) {
6161
$format = '<a href="{Url,html}" itemprop="url"><span itemprop="title">{Name,html}</span></a>';
6262

6363
$result = '';
@@ -87,11 +87,6 @@ public static function breadcrumbs($data, $homeLink = false, $options = []) {
8787

8888
$defaultRoute = ltrim(val('Destination', Gdn::router()->getRoute('DefaultController'), ''), '/');
8989

90-
// FIX: Don't show current page
91-
if(count($data) <= 1) {
92-
return '';
93-
}
94-
9590
$count = 0;
9691
$dataCount = 0;
9792
$homeLinkFound = false;

0 commit comments

Comments
 (0)