Archive

Author Archive

Content Management and the Splash CMS — Introduction

March 5th, 2010

Splash CMS is an open source content management system that runs on top of CFWheels. It’s designed to be a simple, but elegant content management solutions for websites that are managed by small teams.

CFWheels is an open source ColdFusion framework that is inspired by Ruby on Rails. Besides being easy to use and learn, using CFWheels lets you adapt great ideas from Ruby on Rails (RoR) applications. RoR has the Radiant CMS, and Splash is the ColdFusion/CFWheels adaptation!

You can easily download Splash from http://wiki.github.com/russjohnson/SplashCMS/. The documentation for Splash is still kind of sparse, but the Radiant documentation is mostly applicable, and you can easily see how most things are supposed to work. Then, if you get stuck, email the Google Group.

Splash Layouts, Snippets, and Pages

Splash uses Layouts, Snippets, and Pages to build a website.

A layout, as you might imagine, is like a skin for an entire website. You can have multiple layouts and use different layouts for different pages.

Pages are specific URLs on a Splash site, and each page has a specific layout specified. A page can have multiple “page parts.” Most pages will have a “Body” part, but some might also have a “Sidebar” or other parts.

Snippets are reusable content chunks. You might have a navigation snippet that displays the main navigation for your site. Headers and Footers are other common snippets.

Splash Tags

There is one other very powerful component to Splash — Splash Tags. These are ColdFusion custom tags that extend ColdFusion and HTML to work with Splash. Here’s a simple example: the <s:title /> tag. This tag just retrieves the page’s title from the page object and inserts it in place of the tag. So, in your layout, you would typically have something like:

<title><s:title /></title>

The pages title information from the database is then easily inserted into the HTML title tag!

There are a lot more tags, so see the Wiki.

Splash in Action

I recently completed the DonorUp.com website using Splash. I was really pleased with how easily I was able to get many thing to come together. So, try Splash and leave a comment to let me know how you like it!

Clarke Bishop CFWheels, ColdFusion, Splash CMS , ,

Learning CFWheels — Debugging

February 24th, 2010

CFWheels has some great documentation and examples, but there is still a small learning curve. As you are getting going, it helps to have a few debugging tips. So, keep reading …

On the CFWheels Google Group, Cathy recently asked about the sendEmail() function. This is a pretty good example to show you some debugging tips.

sendEmail() wraps the cfmail tag. Here’s some more information:

CFWheels on sending email.

This all looks pretty straightforward, but what do you do if it’s not working?

First, setup a test view page. Go to the Wheels views folder and add a new folder called test. Then create a new file called index.cfm in the test folder. The path should be /views/test/index.cfm.

In the index.cfm file you just create, put the following:

1
2
3
4
5
6
<cfset
  set(functionName="sendEmail",
  server="yourServer",
  username="yourUsername",
  password="yourPassword")
>

This will trigger the sendEmail() function. You can access the test page at http://localhost/index.cfm/test. But, if you go to this page, you’ll get an error because we didn’t create myemailtemplate, yet. So, make another CFM page in /views/test/ called myemailtemplate.cfm. The content can be anything you want. Something like “Test email” is fine.

Wheels knows you are in the Test controller, so it looks for templates in the /views/test folder. Wait a minute! You never said anything about creating a controller. That’s one of the cool things about Wheels. Even without a controller, it will still show you the view page, and things still work!

Now, go back to the test page at http://localhost/index.cfm/test. If everything is working, you should get an email message. If it’s not working, you can put other stuff in your test page. Try these out:

  • <cfdump var=”#params#”> will show you the params structure with your actions, controller, data you’re passing, etc.
  • <cfdump var=”#wheels#”> will show information on your filters.
  • <cfdump var=”#application.wheels#”> will show all the wheels settings, functions, routes — All kinds of cool things.

Now sendEmail() is a little trickier. It uses ColdFusion’s <cfmail> tag. Put this in your /views/test/index.cfm file:

1
2
3
4
5
<cfmail from="me@mydomain.com"
   to="me@mydomain.com"
   subject="Test Message">
  This is a test
</cfmail>

If this won’t work, then it’s your server configuration, not Wheels. You may have to specify your server name or login information. That’s pretty easy, too. Just put the following in your config/settings:

1
2
3
4
5
6
<cfset
  set(functionName="sendEmail",
  server="yourServer",
  username="yourUsername",
  password="yourPassword")
>

I hope this helps!

Clarke Bishop CFWheels, ColdFusion