Mango Blog Plugin 1.0 beta Released

Okay! There's finally a working plugin for Mango Blog. :)

It did take a bit longer to get this done than I'd hoped, but I'm glad to have a first release available.

It's on the webservice for plugins, so if you've already downloaded a copy of the onTap framework, just go to your Plugin Manager, select the "more" tab and type "mango" into the search form. From there press the install button and it will walk you through the rest of the installation. This version uses the Members onTap user/security plugin to manage users, roles and permissions, instead of the Mango Blog user system. So if you haven't already installed Members onTap, it will walk you through that first (including the DataFaucet installation it needs).

I can't say for certain, but I suspect that Mango Blog was easier to integrate than BlogCFC would have been. One reason is that BlogCFC places a bunch of objects directly in the application scope. So it was a pleasant surprise that Mango Blog used just the one Application.blogFacade. Although I personally would have preferred simply Application.mango since I think it's less likely to cause a namespace conflict, I really can't fault Laura for doing such an excellent job in that respect. And plus that I'm doing something here that's not very common in the ColdFusion community (yet).

Laura also included another feature that made this integration easier, which is delegated user authentication. The plugin doesn't actually use the Mango Blog login, it uses the Members onTap login, however the back-end code for handling delegated logins made it much easier to sync the blog with the existing Members onTap user management and security plugin.

On the flip side of the coin, it was the display elements that were the most challenging to address. The plugin actually downloads the full version of Mango Blog 1.4 during installation and places it in the framework's includes directory. Most of the CFCs are referenced via the org.mangoblog mapping (which the installer creates automatically on CF8). This makes the paths for that a piece of cake. The real challenge came with assets -- images, style sheets, javascript libraries and flash movies. Unfortunately there's no equivalent to cf mappings for these in HTML. So when Mango Blog displays an image with src="assets/images/blah.png" the browser doesn't find it, because the correct path would be "../_tap/_includes/mangoblog/assets/images/blah.png".

I didn't want to move any of the directories out of the includes directory because I wanted to keep the original Mango Blog installation in one piece, the way it was when I downloaded it. So I opted to add some custom versions of templates labelled "tap_x.cfm". So there's a tap_index.cfm for the home page, etc. In these custom versions of the Mango Blog files I'm then able to modify the display templates with the correct paths for these external files.

The file manager is still not working, but I decided to release it now anyway, since the bulk of the blog seems to be working.

What would have been really nice for the display templates and would have helped significantly in creating this plugin integration, is having a CFC that manages paths for external files. And it occurs to me that it wouldn't be too difficult to create one. Just initialize it with a root path and then call getImage() or getStyle() to return a url for the file you need. This would not be just for Mango Blog. I think this might help improve collaboration within the community as a whole, that way it's much easier to carry display templates from one site to another, since they all use this CFC. Have a problem migrating to a new site? Simple - extend the CFC to behave however you need. :)

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress