Custom field support

Topics: ASP.NET 2.0, Business Logic Layer
Jun 12, 2011 at 9:52 PM

hi folks,

Is there a way to add custom fields to the post?

I need to create posts for movies. each post is a movie. each movie has a title description extra details, publish year, actors and much more.
I don't want to save all of this data into the POST table, rather i'ld like to save each information to it's own uniqu field.

what is the best way to achieve this...?
should I need to modify the core and create a new class will inherit from the POST class?
or there is already a support for such?


Jun 13, 2011 at 12:45 AM
Edited Nov 27, 2011 at 6:29 AM




Check out this Post on:

How to Add a Custom Field to a Post in BlogEngine.Net









Java Blog

Jun 13, 2011 at 2:06 AM

I am using SQL Server. Cannot find files: EditPost.aspx ; EditPost.aspx.cs

where is it located? (I am using version 2.0)

Jun 13, 2011 at 4:24 AM
Edited Nov 27, 2011 at 6:29 AM

Check out this Post on:

How to Add a Custom Field to a Post in BlogEngine.Net

Jun 13, 2011 at 12:09 PM

It seems like I must edit the BlogEngine.Core.Post object...which means I need to recompile the engine.

Am i correct? I don't want to make changes to the core, especially where I am not familiar much with code.

please help me.

thank you.



Jun 13, 2011 at 12:17 PM

You are little out of luck on this. From what I have seen in the core, there is no support for custom fields. Since you are talking about lot of fields that categorize your post even further, you are going to have deal with modification of core. It is not that hard just follow some example that kbdavis posted.

Jun 13, 2011 at 12:35 PM

I have followed the ad categories code and there are lots of modifications as you suggested.

to avoid core modificitions,
what if you create a new table be_POST_EXTENDED and save all the custom fields in there. can you create a simple extension to display/edit this fields?

(or I will have to this in the nasty way?)

Jun 13, 2011 at 1:40 PM

Nasty way or right way, i will leave that judgement to you :-)

Here is how I see it.... It does not matter what approach you take, you will have to do following at minimum:

1. Create new datatable(s)

2. Modify or create admin interface to assign your custom fields to each post unless you want to use some mechanism that will automatically assign custom fields to each post via extension.

3. Modify PostView in skin to display your custom fields.

4. Create extesion (to do any post processing on post etc.)

As you can see whatever approach you take, you have few changes to make any ways. The update for adcategories is very close to what you are trying to do. Part that may sound more complicate din that update is how it wants to pull advertisements. In your case, you do not have to do any such thing unless you want to add some intelligence to extracting custom fields from post content itself.

So either way, you have some work to do.