From 6dbe7992c096044c6164fcc926140bfe68bc7d40 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Thu, 21 Feb 2019 14:50:23 +0300 Subject: [PATCH] Add ContentLayout.ShouldShowBreadCrumb() method --- .../AspNetCore/Mvc/UI/Layout/ContentLayout.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ContentLayout.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ContentLayout.cs index e5b169486f..bd54aef4d9 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ContentLayout.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/AspNetCore/Mvc/UI/Layout/ContentLayout.cs @@ -1,4 +1,7 @@ -namespace Volo.Abp.AspNetCore.Mvc.UI.Layout +using System; +using System.Linq; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Layout { public class ContentLayout { @@ -12,5 +15,20 @@ { BreadCrumb = new BreadCrumb(); } + + public virtual bool ShouldShowBreadCrumb() + { + if (BreadCrumb.Items.Any()) + { + return true; + } + + if (BreadCrumb.ShowCurrent && !Title.IsNullOrEmpty()) + { + return true; + } + + return false; + } } } \ No newline at end of file