![]() | |||||
![]() |
|||||
|
Setting Up Multiple MangoBlog Instances with Shared Code and Database
MangoBlog is a sweet (ha ha) ColdFusion-based blog, but it doesn't currently support creating multiple blogs using the same codebase. You can easily make a copy of the code and create another blog that way, but if you're looking at 3, 4, or more blogs, then it's going to start getting out of hand, especially if you want to share the same basic styles for all of the blogs. (Styles can change, of course!) One thing that I didn't hear suggested on the MangoBlog forums was to simply create a virtual directory on the webserver in order to create another blog using the same code as an existing blog, and that turned out to work really well. I wanted to document the steps I took to set that up for the benefit of my future self and others. Set up Application.cfc The first thing is to set up Application.cfc to support multiple blogs. At the top of Application.cfc I added this (my first blog was in a directory called "blog" and all the new ones are in other subdirectories): this.blogid = ListFirst(cgi.SCRIPT_NAME,"/"); Then I included the blogid in the application name: this.name = "mango_#right(hash(GetDirectoryFromPath(GetCurrentTemplatePath())),50)#_#this.blogid#_v1_4_2"; Then I used that blogID in the OnApplicationStart: <cfset facade.setMango(createobject("component",variables.componentsPath & "Mango").init(getDirectoryFromPath(GetCurrentTemplatePath()) & "config.cfm", With that initial setup, creating a new blog is a 3 step process: 1. Create new blog and blog author records, copying settings from the default blog The sql below is what I used DECLARE @blogid nvarchar(32),@basePath nvarchar(32) 2. Copy the blog settings in config.cfm Make a complete copy of the node that starts "<node name="default">" and change "default" to your new blog subdirectory name. Since the config settings for all of my blogs are the same, it would be nice if I could just tell it to use the default configuration, but that doesn't seem to be possible without changes to the MangoBlog code. 3. Create a virtual directory in IIS Just point the new directory to your original blog directory. I assume that you can do the same thing in Apache, but I don't have much experience with that. That's it! Posted on March 24, 2010 3:37:42 PM EDT by David Hammond CommentsTopics for this page: |
August 2010 -- Modern Signal completes integration of new design for Teaching Strategies.com.
July 2010 -- Modern Signal launches new site for the NAHB International Builders'Show, the largest residential building industry tradeshow in the world.
July 2010 -- Modern Signal awarded contract to build a social media plan for The International Manufacturing Technology Show, one of the largest industrial trade shows in the world, with more than 1,100 exhibitors and over 92,000 visitors.
July 2010 -- Modern Signal completes launch of Teaching Strategies GOLD, a brand-new assessment tool with feature-rich tools for teachers, administrators, parents and trainers.
June 28, 2010 -- Modern Signal launches redeveloped website for National Health Policy Forum, a nonpartisan research and public policy organization at The George Washington University. The new site includes admin tools to manage email announcements, event invitations and RSVPs, surveys, and an extensive library of publications and meeting materials. The site also features a customized Google Search integration, and a new content management system was integrated within the existing design and information architecture of the site. -View-
April 22, 2010 -- Modern Signal launches a redesigned website for The NALP Foundation for Law Career Research and Education, a nonprofit organization that works to ensure that the legal community and society at large have a reliable, objective, and affordable source of information.The site includes a content management system; bookstore; and news, events, leadership, and products tools to manage the featured homepage content. -View-
April 5, 2010 --
|
||||
I'm curious -- how have you dealt with the implementation of separate styles for multiple blogs that nevertheless share some pieces of code in common with pages elsewhere on the site but outside the blog? In other words, say you want to integrate multiple blogs into an established site and use existing code from it for, e.g., a sitewide navigation bar on the blog pages. I know that I need to create custom themes, but so far anything I've tried to "include" code from outside the blog code directories hasn't worked.
Posted on March 29, 2010 2:26:47 PM EDT by Rick
If you need different styles for different blogs, you could create several skin directories and use the BlOG_blog.skin database field to specify the skin for each blog. In my case, I wanted the same style for all the blogs, so this wasn't an issue.
Posted on March 29, 2010 3:05:09 PM EDT by David Hammond
Posted on March 29, 2010 4:25:13 PM EDT by Rick