This project is read-only.

How to get the value of custom fields of blog page?

Topics: Controls
Jan 2, 2016 at 2:30 AM
Edited Jan 2, 2016 at 3:05 PM
For blogengine 3.2, I can use Post.CustomFields["captionimage"] to get value of Custom Fields, but can not do the same with blog page. When I use Page.CustomFields["captionimage"], I got error.
For example, in Page.aspx, I need to get the value of a certain item in CustomFields of the current page.
how to get the value of the value custom fields of blog page?
Jan 2, 2016 at 6:05 PM
The page missed a property, fixed with
Github and downloads updated (only BlogEngine.Core.Dll changed).
Can use similar to post, with: Page.CustomFields["foo"].Value
Marked as answer by robinliug on 1/3/2016 at 7:10 AM
Jan 2, 2016 at 7:20 PM
Edited Jan 2, 2016 at 7:22 PM
Hi, etur,
I got the code. thanks.
Just share a feature I added to my blogengine website
here is the page:
if a visitor is not logged in, I get the value of the customfields["RequireLogin"],and if it is "yes", I display the page.description, plus a div that requires visitor to login or regsiter to my website.
You can do the same with your posts.
I also use page.customfields to determine if an Exit Intent Popup should be displayed to visitor to collect user email address.
here is an example:
an Exit Intent Popup div will show automatically in 5 seconds after page is load.

with content marketing, collecting the user email address is very important.