Browse Source

Fix pages module breadcrumbs

Vova Tkach 6 years ago
parent
commit
8f846165cd
1 changed files with 5 additions and 1 deletions
  1. 5 1
      modules/modules.go

+ 5 - 1
modules/modules.go

@@ -224,7 +224,11 @@ func (this *Modules) getSidebarModules(wrap *wrapper.Wrapper) string {
 func (this *Modules) getBreadCrumbs(wrap *wrapper.Wrapper, data *[]consts.BreadCrumb) string {
 	res := `<nav aria-label="breadcrumb">`
 	res += `<ol class="breadcrumb">`
-	res += `<li class="breadcrumb-item"><a href="/cp/` + this.mods[wrap.CurrModule].Info.Mount + `/">` + html.EscapeString(this.mods[wrap.CurrModule].Info.Name) + `</a></li>`
+	if this.mods[wrap.CurrModule].Info.Mount == "index" {
+		res += `<li class="breadcrumb-item"><a href="/cp/">` + html.EscapeString(this.mods[wrap.CurrModule].Info.Name) + `</a></li>`
+	} else {
+		res += `<li class="breadcrumb-item"><a href="/cp/` + this.mods[wrap.CurrModule].Info.Mount + `/">` + html.EscapeString(this.mods[wrap.CurrModule].Info.Name) + `</a></li>`
+	}
 	for _, item := range *data {
 		if item.Link == "" {
 			res += `<li class="breadcrumb-item active" aria-current="page">` + html.EscapeString(item.Name) + `</li>`