Skip to content

Commit ccda929

Browse files
committed
Page custom fields
1 parent e820f08 commit ccda929

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

BlogEngine/BlogEngine.Core/Page.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Linq;
66

77
using BlogEngine.Core.Providers;
8-
8+
using Data.Models;
99
/// <summary>
1010
/// A page is much like a post, but is not part of the
1111
/// blog chronology and is more static in nature.
@@ -702,5 +702,33 @@ protected override void ValidationRules()
702702
}
703703

704704
#endregion
705+
706+
#region Custom Fields
707+
708+
/// <summary>
709+
/// Custom fields
710+
/// </summary>
711+
public Dictionary<String, CustomField> CustomFields
712+
{
713+
get
714+
{
715+
var pageFields = BlogService.Provider.FillCustomFields().Where(f =>
716+
f.CustomType == "PAGE" &&
717+
f.ObjectId == this.Id.ToString()).ToList();
718+
719+
if (pageFields == null || pageFields.Count < 1)
720+
return null;
721+
722+
var fields = new Dictionary<String, CustomField>();
723+
724+
foreach (var item in pageFields)
725+
{
726+
fields.Add(item.Key, item);
727+
}
728+
return fields;
729+
}
730+
}
731+
732+
#endregion
705733
}
706734
}

BlogEngine/BlogEngine.Core/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
[assembly: CLSCompliant(false)]
2020
[assembly: ComVisible(false)]
2121
[assembly: AllowPartiallyTrustedCallers]
22-
[assembly: AssemblyVersion("3.2.0.1")]
22+
[assembly: AssemblyVersion("3.2.0.2")]
2323
[assembly: SecurityRules(SecurityRuleSet.Level1)]

0 commit comments

Comments
 (0)