Browse Source

Fix module at home page

Vova Tkach 5 years ago
parent
commit
2603f0203b
1 changed files with 15 additions and 11 deletions
  1. 15 11
      modules/modules.go

+ 15 - 11
modules/modules.go

@@ -118,17 +118,21 @@ func (this *Modules) getCurrentModule(wrap *wrapper.Wrapper, backend bool) (*Mod
 				mod = m
 				modCurr = "index"
 			}
-			if (*wrap.Config).Engine.MainModule > 0 {
-				if (*wrap.Config).Engine.MainModule == 1 {
-					if m, ok := this.mods["blog"]; ok {
-						mod = m
-						modCurr = "blog"
-					}
-				} else if (*wrap.Config).Engine.MainModule == 2 {
-					if m, ok := this.mods["shop"]; ok {
-						mod = m
-						modCurr = "shop"
-					}
+		}
+	}
+
+	// Selected module
+	if len(wrap.UrlArgs) <= 0 {
+		if (*wrap.Config).Engine.MainModule > 0 {
+			if (*wrap.Config).Engine.MainModule == 1 {
+				if m, ok := this.mods["blog"]; ok {
+					mod = m
+					modCurr = "blog"
+				}
+			} else if (*wrap.Config).Engine.MainModule == 2 {
+				if m, ok := this.mods["shop"]; ok {
+					mod = m
+					modCurr = "shop"
 				}
 			}
 		}