Browse Source

No need that, it's can be solved by template condition

Vova Tkach 6 years ago
parent
commit
388e0ddd23

+ 0 - 6
engine/fetdata/content.go

@@ -12,9 +12,6 @@ func (this *FERData) Name() string {
 		if this.wrap.CurrModule == "index" {
 			return this.dataRow.(*utils.MySql_page).A_name
 		}
-	} else if this.is404 {
-		// Return it from settings
-		return "404"
 	}
 	return ""
 }
@@ -33,9 +30,6 @@ func (this *FERData) Content() template.HTML {
 		if this.wrap.CurrModule == "index" {
 			return template.HTML(this.dataRow.(*utils.MySql_page).A_content)
 		}
-	} else if this.is404 {
-		// Return it from settings
-		return template.HTML("The page what you looking for is not found")
 	}
 	return template.HTML("")
 }

+ 0 - 9
engine/fetdata/meta_data.go

@@ -9,9 +9,6 @@ func (this *FERData) MetaTitle() string {
 		if this.wrap.CurrModule == "index" {
 			return this.dataRow.(*utils.MySql_page).A_meta_title
 		}
-	} else if this.is404 {
-		// Return it from settings
-		return "Page not found"
 	}
 	return ""
 }
@@ -21,9 +18,6 @@ func (this *FERData) MetaKeywords() string {
 		if this.wrap.CurrModule == "index" {
 			return this.dataRow.(*utils.MySql_page).A_meta_keywords
 		}
-	} else if this.is404 {
-		// Return it from settings
-		return ""
 	}
 	return ""
 }
@@ -33,9 +27,6 @@ func (this *FERData) MetaDescription() string {
 		if this.wrap.CurrModule == "index" {
 			return this.dataRow.(*utils.MySql_page).A_meta_description
 		}
-	} else if this.is404 {
-		// Return it from settings
-		return ""
 	}
 	return ""
 }

+ 2 - 2
hosts/localhost/template/404.html

@@ -1,8 +1,8 @@
 {{template "header.html" .}}
 <div class="container some-text pt-3">
-	<h2>404</h2>
+	<h2>Error 404</h2>
 	<div>
-		Page not found!
+		The page what you looking for is not found
 	</div>
 </div>
 {{template "footer.html" .}}

+ 1 - 1
hosts/localhost/template/header.html

@@ -9,7 +9,7 @@
 		<!-- Bootstrap CSS -->
 		<link rel="stylesheet" href="{{$.System.PathCssBootstrap}}">
 
-		<title>{{$.Data.MetaTitle}}</title>
+		<title>{{if not $.Data.Is404}}{{$.Data.MetaTitle}}{{else}}Error 404{{end}}</title>
 		<meta name="keywords" content="{{$.Data.MetaKeywords}}" />
 		<meta name="description" content="{{$.Data.MetaDescription}}" />
 		<link rel="shortcut icon" href="{{$.System.PathIcoFav}}" type="image/x-icon" />