fusiongrokker

Everything you need to know about Mango pods – Part 1: Simple Template Pods

In Mango, adding pods can be super simple — mostly html with a touch of CFML; or you can go nuts and write a plugin that adds a pod that does something crazy. In this series of posts I'll try to cover everything you could possibly want to know about pods.

Before we get started, the first thing you need is a pod-enabled theme. They aren't all pod enabled, unfortunately. If you're not sure if your theme is pod-enabled, the quick way to tell is to click the "Pod Manager" link on the left side of your blog admin. If your theme is *not* pod-enabled, you'll get a message that says Current theme doesn't have any pod locations or it is not Pod-enabled. Otherwise, you'll see the pod manager.

Toward the end of this series, I'll post showing how to make your theme pod enabled, if you're writing or updating a theme. It's not that difficult.

Template Pods

In most pod-enabled themes, there's a sidebar.cfm or similarly named file, which contains a block of code implementing the <mangox:Pods></mangox:Pods> custom tag set. It should look something like this:

...

Don't worry too much about what that does, we're just using it as a landmark. This file is where pods are rendered, so it makes sense to define some simple HTML pods here with it. You'll likely find some "Template" pods with it, and we're going to add to them. Let's say you want to add a pod with an About Me blurb. Add this block of code outside the mangox:Pods block. Techincally, it should also be inside the <mangox:PodGroup> tags. Mango supports multiple pod groups, and if your theme has more than one (more than one <mangox:PodGroup> block) you'll want to define your pod inside the pod group where you want it to be rendered.

I'm your host, Adam. I write about web development, ColdFusion, and more and more I find myself writing about Mango Blog.

If it's not instantly obvious, the part that makes Mango recognize this as a pod is the <mangox:TemplatePod id="about-me"> and everything between the tags is the content that will get rendered at the pod location.

This method is great when your pod is just some simple HTML — perhaps embedding a flash widget or including some advertising or a graphic to link to another site. It's primary drawback is that it is only available to the skin/theme you code it into. If you switch themes, you need to copy it to your new one. Obviously that's not too difficult, but it is something you should be aware of.

Next time, I'll cover writing a plugin that adds a pod.

Posted in Mango | 3 Responses  

3 responses:





Leave this field empty: