mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:43:35 +08:00
Making the list shape's ul/ol not render if there are no items
--HG-- branch : dev
This commit is contained in:
@@ -244,13 +244,16 @@ namespace Orchard.Core.Shapes {
|
||||
if (Items == null)
|
||||
return;
|
||||
|
||||
var count = Items.Count();
|
||||
if (count < 1)
|
||||
return;
|
||||
|
||||
var listTagName = string.IsNullOrEmpty(Tag) ? "ul" : Tag;
|
||||
const string itemTagName = "li";
|
||||
|
||||
var listTag = GetTagBuilder(listTagName, Id, Classes, Attributes);
|
||||
Output.Write(listTag.ToString(TagRenderMode.StartTag));
|
||||
|
||||
var count = Items.Count();
|
||||
var index = 0;
|
||||
foreach (var item in Items) {
|
||||
var itemTag = GetTagBuilder(itemTagName, null, ItemClasses, ItemAttributes);
|
||||
|
Reference in New Issue
Block a user