Andrew's Ramblings

Where personal space is never enough

Adding multiple pages to ContentBox blog posts

Awhile ago I was curious to see, how easy it would be to add multiple page support to blog posts, within ContentBox. The solution was fairly simple, so I thought I would write up this quick post. Not just to show how to add multiple pages for posts, but to also demonstrate how easy it is to manipulate the content before it gets displayed.

Before we can do this, lets look at how ContentBox displays blog entries. If we go and locate the file called entry.cfc, which can be found in the templates folder for each theme. This is how a group of blogs or the entire entry is displayed, and looks like the code below.

Anyone who has been following my rants with ColdFusion 10 and the need to have the CGi module installed for IIS, would know that I have been asking this question from Adobe since ColdFusion 10 was released. Today I got the answer I was looking for and I must admit that it surprises me that Adobe once again, didn't think about the situation, or at least the answers provided give that impression.

Up until the final release of ColdFusion 10, Adobe had never bothered to do a check to see if ColdFusion when being installed, that IIS had the CGI mode enabled on IIS 7 and above. So my question was very simple, why does ColdFusion 10 now require the CGI mode to be enabled.

And it is still a good question that Adobe still can't provide an answer for, so lets look into the situation with a bit more detail.

First lets look at the difference.

Alternative Media Server for PS3 and other devices

Awhile ago I blogged about the problems that I was having with PS3 Media Server, since upgrading over to Windows 8, PS3 Media Server has just stopped working. Since looking around at some many alternatives, I ended up settling for one called Plex Media Server and it hasn't really let me down.

On the PS3 there is an issue playing MKV formats, where the FF/RW will cause the Film or Show to stop playing and hopefully they fix this rather soon. However on an over all the features and interface that Plex Media Server offers is gaining grounds and great improvements.

So lets go into a bit more of these features.

Adding widgets to your ContentBox modules and themes

In a previous post I talked about how you can add interceptors to your ContentBox themes, today I am going to show how easy it is to do the same with widgets, not only to your themes but also to your modules as well.

This example will also use the techniques that I used to also be able to create your own HTML Helper, so that we can then call the widgets inside our templates if needed. The only downside at the moment is that this technique will mean that the widgets can't be added to the content, via the Entry Editor. At the moment this is a small downside, but one I am sure is a small inconvenience, as one could easily adopt a plugin for the editor to add this to the Entry Editor or Page editor.

With that out of the way, lets see how easy it is.

I came across a post by John Wish that showed an example of Closures, however I saw an immediate issue with the very first example. When it was raised on the Railo mailing list, I am shocked to see that people have not seen this issue, or have misunderstood the issue.

The post can be found here http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/386

Now as you can see if you run this in Railo it will run and give the results that John says it does, however in ColdFusion it will error and for very good reason too. The code is as follows.

Adding interceptors to your ContentBox themes

If you have played around with ContentBox then you would know that this is a great CMS Application, it is entirely flexible and scalable. However the one thing that it is lacking at the moment is to be able to create a theme that is technically a self contained theme, I will call them themes as this is what they are, and ContentBox calls them layouts. So when I mention themes I am going to call them themes, so as not to confuse them with the actual page layouts used by the theme.

By self contained, I am mean that the theme has its own widgets, interceptors and services etc. Which is not a big deal in itself, however I prefer to have them all contained in one location that way if I remove the theme, or deactivate the theme then all the widgets and interceptors are also then deactivated along with the theme.

Today I am going to show how you can do this, with the addition of one module.

Commenting your Code, the argument for why you should

Over the years I have seen this question come up time and time again, and the people who argue against it are the people who really should know better. That is not to say they are not good or excellent developers, it means that these people tend to foget what comments in code can provide. Put your hand up if you have revisited code a few years later, and forgot why you wrote something the way you wrote it and then you think I should have rewritten it this way because it would be easier.

Then find out that you broke the code?

ColdFusion Arrays and using Java to split strings

I wanted to touch more on this as I got a few emails about the problems with this when using array functions and tags, the one thing to note is that ColdFusion since version 6 is built on top of Java, so when converting a string or a list to an array with split is actually not returning an array that ColdFusion would normally understand.

But certain ColdFusion functions and tags still work, so why do some tags and functions work where others fail.

Using Interceptors in ColdBox for greater scalabaility

The other day I spoke about how to create your own CBHelper and inject it into the request for later usage, today I want to to touch a little more on this with the use of interceptors to expand the application further, which will also allow for grater scalability of the application you are writing.

Nolan asked a question on the ColdBox mailing list that I thought I would blog about this, as I think it is a good topic and demonstration of how powerful using interceptors are. Nolan's question was about adding extra things into the header of a document, which he has working to a degree, but has the problem of it duplicating his code.

So lets discover why this is works, and is scalable.

Update: ColdFusion 10 - Windows 8/2012 update and not updating

I wanted to write this as an update to a post I wrote the other day, as I have some more information on how to do this cleanly. The problem is that to get ColdFusion installed on Windows 8 / Server 2012, one has to manually create all the IIS settings, and to have ColdFusion boot up will need to install ColdFusion as a service.

Now the trick was how you do that, because if you install the service with an account that ColdFusion is not running under, then the updater will actually fail. This applies to all the updates from 4 onwards, as they must all have changes to the Windows Service.

« previous 1 2 3 4 5 6 7 ... 41 42 next »