Friday, February 26, 2010

There are a number of reasons for including multiple blogs on a single page. Perhaps you'd like to have two or three users posting at once, but don't want the posts combined in a single blog column. Or maybe you'd like to post notes and comments in your sidebar that don't fit in with the rest of the content of your blog. It's even possible (depending on your server's capabilities) to grab blog content from another server and paste it seamlessly into your existing code. The possibilities are endless, really.

Including multiple blogs on a single page can be achieved through the use of includes. Includes are a feature on many different servers and platforms, including Server Side Includes, PHP, ASP, and Cold Fusion. The type of include method you need will depend on what kind of platform your server is running and whether or not your server has the functionality set up to do so. If you're not sure which of the following techniques are right for you, please ask your system administrator.

Say you want to post a list of books you're currently reading in the sidebar of your main blog page. First you'll need to create a new blog. Log into Blogger and click "Create a new blog" link in the right column. Specify the information requested and then click on Settings to enter additional information needed there. We'll use "books.html" as the file name for this new blog.

After you've completed your settings, open the template for this new blog by clicking on Template . Remove the It should look something like this:

Since books.html will be included within your existing page, it will use the body information provided by that file. Continue to edit the template of books.html until it matches the look you desire. Now it's time to add the includes to your page.

To add the book blog to your existing blog page, open up your main blog template and find the location in your blog's layout where you'd like the books blog to appear. Place the following line of code there, depending on your server's specifications:

Post and publish both of your blogs so that all the updated files are placed on your server. If you'd like to include another blog (let's say it's about the music you've been listening to), simply follow the same set of steps with a new file name ("music.html" for example). Make sure to post and publish before testing out the site.

The include lines will be visible when you view your Blog Template, but will be executed on your server when a visitor comes to your site. Instead of that line of code, the user will see the individual blog dynamically included in your page. It will appear seamless, and the user won't know you've used an include.

If you've followed all of these steps and the blog is displaying in the browser with Blogger tags instead of your posts, you may need to rename the main blog file name suffix to .shtml (for SSI), .php (for PHP), .asp (for ASP), or .cfm (for Cold Fusion). This is because your server may not allow files with the standard .html extension to be parsed for includes. Contact your server administrator if you have questions regarding what is enabled on your server.

2003/09/04: More advice from our friend Wieland van Dijk in Holland:

The procedure you describe to include multiple blogs on one page will work only for users with access to a server that supports either CGI, PHP or ASP, or SSI. However, more or less the same effect can be achieved easily by using iframe's - or preferably the

On the downside: multiple blogs built in this way *will* need body tags, style sheets etc., since these are not inherited from the main page, so the stripped down templates you suggest won't do here. On the upside: this allows for a lot of flexibility. You can use different designs for each 'subblog'.

For your information, I've created a very simple (and still rather ugly - due to some CSS errors I'm too lazy to fix right now) example at http://www.wieland-vd.demon.nl/multiblog.html.

0 comments:

Post a Comment