Mindfly Website Design Studio

Mindfly Web Designer Favorite

Blog

Our Posts on Web Design

Adding Controls from Boogaloo to BlogEngine.NET

by Janae Wiedmaier January 26, 2010 1:01 PM

Cross-compatibility is probably my major complaint in about every aspect of my life.  If css isn't cross-compatible with browsers and my new shoes aren't cross-compatible with all my different sweaters, then there's a definite hitch in Fate's threads.  I shake my fist at you, Fate, and demand that you allow neon orange and pink to go together.  Okay, not really.

The big kicker, in this case, is cross-compatibility between different frameworks.  I know that you're guessing that I'm talking about glasses and photographs, but what I'm really discussing are the different CMS/E-Commerce/Blog/etc. programs that I get to "code" (I say this with quotation marks, because any developer out there would tell you that I do not actually code) in every day.  In specific, the primary ones are Boogaloo, AbleCommerce, and BlogEngine.  RSS feeds port over pretty nicely between them, but getting AbleCommerce controls to work in Boogaloo or Boogaloo controls to work in BlogEngine turns me into a pestering little chinchilla that hounds Rusty until his ears bleed (I think I saw it happen once.  Maybe.  You could ask him).

Today, Rusty and I specifically scheduled an hour of time to take some controls from Boogaloo and add them into a blog (BlogEngine) for a client.  It makes it easy(er?) in this case because we're going from one .NET application to another.  Surprisingly, I think I understood enough of it (except the one menu control that had to be ported from VB into C#) that I can tell you how to take your Boogaloo controls and slap them nicely into BlogEngine so you only need to make your changes in one place.  And what a miracle it would be, if life were always so compatible and simple.  Perhaps Fate thinks that brown is the new pink?

I make a few basic assumptions (and statements) in this post.  First off, I assume that you have both Boogaloo and BlogEngine already installed.  Second, I state that you can have either type of Boogaloo or BlogEngine installed, by which I mean that you can have installed Boogaloo on either SQL Express or SQL Server, and you can have BlogEngine installed with either XML or SQL Server or SQL Express as well.  Since the sites don't specifically interact with each other, the database types don't matter.  Thirdly, I assume that your install of BlogEngine is not in a sub-directory of Boogaloo, but is rather being hosted separately with its own sub-domain, etc.  I'm not going to be talking about having a blog installed "inside" Boogaloo, as that's another host of issues that I know next to nothing about.  So, if all of these base assumptions are correct, we're ready to move over into actually adding Boogaloo to BlogEngine.

The Actual "How-To":

  1. I find the best way to do this (if possible) is to open two windows and have your Boogaloo file structure in one window and your BlogEngine file structure in the other.  Windows 7 nicely lets you split the screens, or if you have two monitors like me, you can put one in your left and one in your right monitor.  Whatever works best for you.
  2. Bin files: The first thing that you'll need to do is take these three files from Boogaloo and copy them into the bin folder in BlogEngine.  Since they have the same basic .NET file structure, it should be easy to locate both places.  Here are the files:
    1. Boogaloo.Base.dll
    2. Boogaloo.Core.dll
    3. Boogaloo.Syndication.dll (this one isn't specifically necessary, but good to have nonetheless)
  3. Config files: Due to the way Boogaloo is set up, you shouldn't have to worry about having strange conflicting config files.  Simply copy from the App_Data folder in Boogaloo the following files to the App_Data folder in BlogEngine:
    1. Boogaloo.config
    2. Database.config
  4. Web.config file editing: After you have copied over the first initial steps, the next thing to do is connect BlogEngine to Boogaloo.  This is done in the Web.config (which you do not need to copy over, we'll be merely editing the one that is already in BlogEngine) and Database.config files.
    1. Open the Web.config file in the root BlogEngine directory.
    2. Underneath "configurations" and inside the first "configSection" tag, add the following (This can be found inside Boogaloo's Web.config file):
      <sectionGroup name="Mindfly">
          <section name="Boogaloo" type="Boogaloo.Base.Configuration.BoogalooSection, Boogaloo.Base"/>
      </sectionGroup>
    3. Cut everthing inside the "connectionStrings" section from the Web.config file and paste it inside the "connectionStrings" in the /App_Data/Database.config file
    4. Back in the Web.config file in the root, take the now empty "connectionStrings" section and remove the opening and closing tags.
    5. Where the "connectionStrings" were, paste the following (This can be found in Boogaloo's Web.config file):
      <!-- Database Connection Strings -->
      <Mindfly>
           <connectionStrings configSource="App_Data\Database.config"/>
      </Mindfly> 
    6. Save the Web.config and Database.config files!
  5. Controls: Now its time to actually move over the controls that you're wanting to use on your blog.
    1. Make a new folder in the root BlogEngine directory and name it "Controls".  You will want to mimic the path structure that Boogaloo uses, since we will be referencing them in the same way that we would in the masters or embedded controls in Boogaloo itself. (Note: You will not need to copy over any Editor controls.  Since those are being used in Boogaloo, only the front-end controls (ones that do not have "Editor" in the filename) will be needed in BlogEngine)
    2. Once you have added your Controls folder, add the folders inside it that have the location of the controls that you wish to copy over.
    3. Copy over the controls from Boogaloo's location to the new folders that you have created in BlogEngine.
  6. Add your controls to your theme's site.master: Once you've finished copying the controls over, it's time to add them to the master page.  The most common use for controls from Boogaloo to BlogEngine is for embedded controls that are going to be edited in Boogaloo and you want to update in BlogEngine.  I'm going to specifically focus on getting the information from those for this tutorial.
    1. Open your web browser and your website, and log into Boogaloo.  Once again, I am making the assumption that if you're going through the trouble to do all this, you already know how to use Boogaloo enough to log into it.
    2. Drop down the "Settings" link and click on "Embedded Controls".
    3. Click on the name of the Control that you are wanting to add to BlogEngine.  (I'm using an example from the Mindfly site and clicking on my "Janae's Blog" Control)
    4. At the bottom of the control, you will see "Information for your web designer".  That would be you!  Copy everything from the first carrot to the last one.  In my case:
      <%@ register tagprefix="mfb" tagname="rssfeedlist" src="~/Controls/MIND/RSSFeed/RssFeedList.ascx" %>
      <mfb:rssfeedlist runat="server" node_control_id="77" />
    5. Paste the code into your master in the location you want the control to be located.
    6. Optionally, then cut out the register (<%@ register tagprefix="mfb" tagname="rssfeedlist" src="~/Controls/MIND/RSSFeed/RssFeedList.ascx" %>) and paste it at the top of the master with the other registered controls.  I like to do this so that everything stays neat and tidy.

And that just about covers everything.  You've copied over your core Boogaloo components (.dll), added your important Boogaloo config files, and then added your controls and synced them all into a nice tidy package through your Web.config and site.master pages.  The last step to do is test it out.  You should find that every control that you make (or use that comes standard with Boogaloo), barring extra back-end compiled configuration should work just as easily in BlogEngine as it does in Boogaloo.

Permalink | Comments (0) | Post RSSRSS comment feed

Importing BlogML.xml to BlogEngine

by Erica Quessenberry December 23, 2009 9:22 AM

I was recently given the task of upgrading Moxie Mom's blog, one of our bloggers for Neighborhood Kids, which runs on BlogEngine.Net - our studio's blog of choice seeing how we are and ASP.NET shop and it's an ASP.NET blog making it integrate quite nicely with Bloogaloo, our open source CMS. Now my blogging background is in WordPress (which is PHP), so I have to admit that I come kicking and screaming when it comes to BlogEngine. Though it's like comparing apples to oranges, or any other fruit for that matter, despite my attempt at keeping an open mind, I find I am still partial to the latter. However, I am determined to conquor and master what I don't know. That being said, while there were some things on the upgrade that I couldn't find (for example, the header tags for the "related posts" seem to live off-planet I had to style them to make them look like <h4> tags since I could not find them to make them actual <h4> tags), I did conquor the importation of posts from the old site, something that's given all of us nothing but frustrating errors for the past couple of weeks. After I figured it out, I felt kind of dumb, but I'm guessing I can't be the only one who's had this problem.

I found limited documentation online for this but lots of people who had the same problem, so I am reposting my triumph in the off chance that someone else needs it and can't find a well written explanation as well (plus if I have to do this again, I know where to go to reread the directions!). 

When I first clicked on import, FireFox, my browser of choice, tried to download an application. I thought that was odd, but went with it. However, it would not run. So I thought it was a Windows 7 compatibility issue since we've run into several of those since we've upgraded (surprise surprise). So after much frustration it finally occured to me to try it in Internet Explorer. And voila. That problem was solved.

So once that hurdle was overcome, I input all my paths to and from the data and got a username/password error. Hmm.... After a little (ok a lot) of searching online, I finally discovered the root of the problem was a date/time thing being masked by a login error. So to fix this, I went to the API folder and found the BlogImporter.asmx file. Opened it with Notepad++, found the line "post.DateCreated = import.PostDate;" (mine was around line 88) and inserted the following line under it: "post.DateModified = import.PostDate;" So your section of code should look like the following with the new line of code in it:

Post post = new Post();
post.Title = import.Title;
post.Author = import.Author;
post.DateCreated = import.PostDate;
post.DateModified = import.PostDate;
post.Content = import.Content;
post.Description = import.Description;
post.IsPublished = import.Publish;

My only gripe about it now is that it did not import the tags or the comment meta data, but I suppose since it got the bulk of it, I shouldn't complain too much... but I probably will anyway. Not super user friendly, BlogEngine! I think my bias stands... for now.

Permalink | Comments (0) | Post RSSRSS comment feed