BlogEngine.NET integration into current site

Topics: ASP.NET 2.0, Business Logic Layer, Controls, Themes
Oct 14, 2011 at 4:48 PM

I was wondering if there was a way to add the BlogEngine website Components to an existing site (API) so that we can utilize our current website and make the weblog flow as part of the website. I am not looking to just theme the Blog similar to what we have, I am looking to have hooks into the blog from our current site.

 

Is this possible?

Oct 18, 2011 at 3:17 PM

Definitely possible, bit it kinda depends on two things: 1) the level of integration you are looking for and 2) the level of programming skill that you have access to.

I've been working to integrate blogengine into our online marketplace website.  So far I've been very pleased with the results and the overall code quality of the system.  In my case I run the blog from the /blog directory of our site and have set that directory as an application in IIS.  This keeps the two systems (our commerce platform and blogengine) as nice seperate entities under the hood, but the UI experiences if very much integrated through the use of a fully customized theme I created.

For further integration there are a couple choices if you go with the "seperate application" approach we did.  First, you can access the data directly if you like from your other system.  I.e. query the database or the xml files directly.  Alternatively, you could create a dll to sit along side the BE system that exposes a public facing, https accessable endpoint that provides access to any api calls you'd like to make to the BE system.  With just a little bit of glue code in that dll, you could support external calls to any aspect of the system. This is ultimately the api approach that I will be pursuing.

Hope that helps,

-Ron

Oct 18, 2011 at 3:34 PM

Thank you Ron. I think we are looking to pretty much take the modules that are being used for things like the Theme for instance and plug them into the current MVC site. So We would like to take the module that Posts the comment and place it into the current site we have. I think this is what you are implying I can do? are there API calls that I could make that if I use the seperate application approach to actually import the BlogEngine Posting module so I don't loose things like adding video's and such? Can you give a few examples of what I would need to do to accomplish this?

 

Thanks again!

Oct 18, 2011 at 3:36 PM
rclabo wrote:

Alternatively, you could create a dll to sit along side the BE system that exposes a public facing, https accessable endpoint that provides access to any api calls you'd like to make to the BE system.  With just a little bit of glue code in that dll, you could support external calls to any aspect of the system. This is ultimately the api approach that I will be pursuing.

Hope that helps,

-Ron


Can you detail this out a little bit of what you mean by the above?

Oct 18, 2011 at 8:00 PM
gcoleman0828 wrote:

Thank you Ron. I think we are looking to pretty much take the modules that are being used for things like the Theme for instance and plug them into the current MVC site. So We would like to take the module that Posts the comment and place it into the current site we have. I think this is what you are implying I can do? are there API calls that I could make that if I use the seperate application approach to actually import the BlogEngine Posting module so I don't loose things like adding video's and such? Can you give a few examples of what I would need to do to accomplish this?

 

Thanks again!

 

Specifying the blog folder as a seperate application (and putting blogengine in it) creates a certain amount of isolation between the main site platform and blogengine.  This can be a good thing or not depending on the final architecture you'd like to have.  I like the approach because the islolation keeps things clean from a code licensing and code maintence perspective.   One slight downside to the approach is that the master page or similar mvc construct needs to exist separately for both application.  This in my mind is a small price to pay for the isolation.  I can't speak to integration with an existing MVC app much given that I'm just getting going with MVC myself, but I can say that seperate application approach means that there is no problem with blogengine's using webform pages while your other app uses MVC (the beauty of isolation).  Blogengine is mostly webform based today, but doesn have support (and leverage) razor for some pages.

Using this "seperate application" approach, there is no need to make any api calls to implement blog engine on your existing site, unless you need you mvc application to have access to data or services that blog engine provides.  For example if someone goes to /blog/post/someurl.aspx page blogengine will take care of serving the page and your core site doesn't need to worry about it.  If however you need to be able to ask blogengine for something via an api call, the approach I'm planning to use is to create another project in my local blogengine solution and have that project compile into it's own dll.  This way I can add all the code I want, creating any needed API end points and the small amount of code to respond to that endpoint by making a call to the blogengine.net dlls.  The approach is fairly clean in that it reduces the need to mix custom code into the main blogengine dlls, thus making it easier apply newer blogengine versions down the road. 

Hope that helps,

-Ron

Oct 18, 2011 at 8:10 PM

Ron,

 

I see where you are going with this to keep the MVC application and BlogEngine application seperate and while I can appreciate where you are doing it and why, unless I am missing simething, I'm not sure how this would assist in what I am trying to accomplish. Lets say my mvc site is called awesomeMvc and the BlogEngine site was blogger. I want when someone Clicks a Blogging link on awesomeMvc  inside of this application to be able to call Blogger modules that will allow the user to enter in the Post WITHOUT being redirected to /blogger/post/someurl.aspx.

 

Does that make sense or am I missing something. Although a great idea, it seems like you are just creating two seperate sites and not intergrating them much at all.

Oct 18, 2011 at 8:20 PM

I'm not quite sure I understand your senerio.

Are you saying that if your site is www.awesomemvc.com and the blog is located at www.awesomemvc.com/blogger that you don't want blogengine.net to handle the ui for the /blogger portion of your site, you want to handle that in your own mvc code and make calls to blogengine at an api level for all interactions between your blog pages and your user (i.e. recreating _all_ the code necessary for the ui aspects of blogengine.net)? 

-Ron

Oct 18, 2011 at 8:27 PM

Yes i think you got it. So what my boss is looking to do is take BloggerEngine and our intranet site and allow the intranet site to be the front end for the BlogEngine. Basically if there was a way to import the Modules / controls somehow. I think the only way to do it remotely even close to what he wants is use MetaWeb API, but from what I see, you will havea headache and ahalf trying to do this and still have lots of limitations. I personally would rather see the BlogEngine be a link off the main site, but my boss is trying to make everything use a single knowledgebase type of thing.

 

Thoughts?

Oct 18, 2011 at 9:00 PM

Hmm.  Gotcha.  One thing to consider is that the UI makes up a substaintial part of a system.  Needing to recreate the while UI would be a serious amount of work.  I don't have any great suggestions for you on that.  Many of the controls are webform controls, so hosting them on an mvc page would be challenging as best. 

"I personally would rather see the BlogEngine be a link off the main site, but my boss is trying to make everything use a single knowledgebase type of thing" -- with regard to serving up the blog pages or administering the site, I _totally_ agree.  Now if you want to display the search box or recent posts or such on the main site, that'd be alot more doable, you'd just need to roll a few Api's on the blogengine side (could be done with the approach I mentioned in prior comments) and then call them from the main site to get the data and display it on the main site.

-Ron