Mura CMS Full Day Training Course on April 21, 2010

How would you like to spend a full day with the folks who created Mura CMS from the ground up? Are you in or around the Minneapolis, Minnesota region ... and if not, can you get there by April 21, 2010?

Well, Team Mura recently announced they would be offering an in-depth, full-day "Programmers Guide to Mura CMS" on Wednesday, April 21st, 2010. This is technically a "cf.Objective() 2010 Pre-Conference" event, however, you don't have to attend the full conference to take advantage of this great opportunity.

Here are a few of the topics that will be covered:

  • Programmatically working with content in Mura CMS
  • Working with Mura CMS objects
  • Understanding the Mura CMS event model
  • Integrating Existing or 3rd Party Applications
  • Building Mura CMS Plugins
  • Extending and customizing Mura CMS while staying on the upgrade path

This full day course will be limited to the first 20 students and costs only $500. Considering the number of Team Mura developers that will be on hand, you probably won't be able to find a better student to instructor ratio. Oh, and for what it's worth, I'll be there too!

Before you say no to this awesome deal, I ask you to take something else into consideration. Have you ever attended a training event only to go back to your office, sit at your desk and not truly applied the newly learned knowledge? If you are a web site developer and have either looked at, used Mura CMS, or are even a seasoned Mura CMS developer and want to build sites more efficiently while allowing your clients the ability to manage their own content ... then you will most definitely be able to bring what you've learned back to your office and apply it to your job the very next day. Yes, I mean that if you attend on Wednesday, by Thursday you will be more productive, period.

Again, only the first 20 students will be accepted, so register now before it's too late!

Using jQuery to Pass an Index Value to a Shadowbox.js Gallery

I ran into a bit of a hair-pulling incident recently and I really couldn't find any help on the web with this one. So I thought I'd share my frustration and the solution I came up with in case anyone else runs into a similar problem ... or heck, maybe you've got a better solution for me. In short, I needed to be able to pass an index value to Shadowbox.js when a gallery was launched so that it would begin at the desired position. However, I personally find it more interesting to understand the evoution of the problem and the eventual solution. If you're not like me, feel free to jump down to the jQuery and HTML code below.

The Problem Challenge

Well, this all started out when one of my clients wanted one of those fancy-dancy "hover-over-a-group-of-thumbnails-and-swap-a-medium-sized-image" thing-a-ma-bobs. Trust me, this was not the challenge ... using a few lines of jQuery and fancy-dancy-be-done.

Then, after looking things over a bit, the client wanted to be able to click on the thumbnail and open a modal window of the original, much larger, image. Again, no worries ... using a bit of Shadowbox.js magic, and client-be-happy.

Finally, after reviewing my jQuery/Shadowbox/programming magic, the client was happy ... but they wanted one more thing ... to be able to click on the medium-sized image and have it launch a modal window of the original, much larger, image too. So, after a little extra thought and tweaking around, I got it working ... well, sort of.

Here's the Deal

Everything worked just fine except for the fact that if I enabled the 'continuous' attribute so that people could click "Next" and "Previous" links, something odd occurred.

If I clicked a thumbnail, the Shadowbox opened and did its thing as expected. If there were four (4) image thumbnails, then when the modal window opened, the "Next" and "Previous" links would cycle through four (4) images. But when I clicked the medium-sized image, the larger version of the image would appear twice in the modal window for a total of five (5) images.

Anyway, I realized fairly quickly that by default, Shadowbox creates a cached array of things such as all links with a 'rel' attribute of 'shadowbox' when the page loads. You can easily override this feature in the Shadowbox init() method by setting the 'skipSetup' attribute to true. But that's not what I really needed, or wanted, to do. I already had the thumbnails working and just wanted to get the 'Medium' sized image to also open the Shadowbox.

The My Solution

Ultimately, I needed a way to keep track of the index of each Shadowbox link element so that I could use it when calling a Shadowbox function I hadn't used before called "Shadowbox.open()." I knew there just had to be a way of passing the index value to Shadowbox so that way when the modal window would open, it would just cue up to the cached index in Shadowbox.

So I created a custom attribute for the "a" link of the thumbnail images called "idx" and since I was already outputting the thumbnails from a query, this was pretty easy to do. However, since I was using a ColdFusion loop to output an array of the images, I couldn't just use the index value of the loop since ColdFusion arrays start at 1 while just about every other programming language, including JavaScript, have their arrays start at zero (0). So for you ColdFusion peeps, just remember you'll want to add your own "counter" variable that starts at zero and then increment it at the end of each iteration of the loop.

Once I had an attribute I could access using jQuery, I knew I was in business. The next thing I needed to find out was how to pass this index value to Shadowbox. Again, nothing on the web helped me out here. I did stumble across someone's post in the Shadowbox forum about how they modified the source code to accommodate something like this, but I chose not to go that route. In addition, this was a site using Mura CMS and I really didn't want to make any alterations to any included third-party code if I really didn't have too.

After studying the Shadowbox source code for a bit, I found this line of code in the Shadowbox.open() method (around line 2122):


// is it a link?
if(isLink(obj)){
    if(typeof obj.shadowboxCacheKey == 'undefined' || typeof cache[obj.shadowboxCacheKey] == 'undefined'){
        // link element that hasn't been set up before
        // create an object on-the-fly
        obj = this.buildCacheObj(obj, opts);
    }else{
        // link element that has been set up before, get from cache
        obj = cache[obj.shadowboxCacheKey];
    }
}

Notice the "shadowboxCacheKey" bit? Bingo! Now I knew all I needed to do was tweak my jQuery code to add this sweet little attribute to the link and then call the Shadowbox.open() method along with some options to tell Shadowbox which gallery I wanted to use and at what index to begin! Can you tell I was a little excited?

So instead of continuing to bore the crap out of you, I'll just go ahead and show you what I came up with.

The jQuery


$(document).ready(function() {
    $(".imageThumb").hover(
        function() { // handlerIn
            var mediumImage = $(this).find('a').attr('medium');
            var imgLink = $(this).find('a').attr('href');
            // this holds the 'Shadowbox' cacheKey index value!
            var imgIndex = $(this).find('a').attr('idx');
            $('#swapImg').attr({src:mediumImage}).fadeIn(800);
            $('#swapLink').attr({href:imgLink,idx:imgIndex});
            return false;
        }
    );

    $("#featuredImage >
a#swapLink").click(function(event) {
        event.preventDefault();
        // grab the 'Shadowbox' cacheKey index value
        var idx = $('#featuredImage').find('a').attr('idx');
        // now add the index key to the link so that when we call open, it knows this link already exists
        this.shadowboxCacheKey = idx;
        Shadowbox.open(this,{gallery:"products",continuous:true});
    });

});

The HTML


<div id="imageThumbs">
    <div class="imageThumb"><a rel="shadowbox[products];options={continuous:true};" idx="0" href="img1.jpg" title="" medium="img1-med.jpg"><img src="img1-thumb.jpg" alt="" width="70" height="70" /></a></div>
    <div class="imageThumb"><a rel="shadowbox[products];options={continuous:true};" idx="1" href="img2.jpg" title="" medium="img2-med.jpg"><img src="img2-thumb.jpg" alt="" width="70" height="70" /></a></div>
    <div class="imageThumb"><a rel="shadowbox[products];options={continuous:true};" idx="2" href="img3.jpg" title="" medium="img3-med.jpg"><img src="img3-thumb.jpg" alt="" width="70" height="70" /></a></div>
    <div class="imageThumb"><a rel="shadowbox[products];options={continuous:true};" idx="3" href="img4.jpg" title="" medium="img4-med.jpg"><img src="img4-thumb.jpg" alt="" width="70" height="70" /></a></div>
</div>
<div id="productImages">
    <div id="featuredImage"><a idx="0" id="swapLink" href="img1.jpg" ><img id="swapImg" src="img1-med.jpg" border="0" alt="" /></a></div>
</div>

That's it! I hope this helps someone else and saves some hair pulling. Enjoy!

Issue with Mura CMS, ColdFusion, ISAPI and IIS6

Awhile back I ran into an issue installing Mura CMS on a dedicated Windows server running, ColdFusion, ISAPI and IIS6. The issue wasn't blatantly obvious at first because Mura would install just fine and the home page would show up so I thought everything was just fine. However, once I began adding pages to the site and then attempted to view those pages, they wouldn't show up. I would get the ever popular 'The page cannot be found' screen. The first thing I did was check some other Mura sites I had already had installed on the server and each one of them had the same issue. This was extremely odd to me because all of my Mura sites had worked just fine before and I never noticed any problems.

So after tinkering around a little I began thinking about any software I had installed recently that might even remotely affect what was going on. Well, the only thing I could think of was ISAPI. I had just installed it with the previous day or so and wasn't really using ISAPI yet. So I uninstalled it, then checked my sites and they all seemed to work just fine. Well, that's great, isn't it? Sure, if you don't really use or need ISAPI, which was my case at the time so I just went about my business and never dug any further into the issue.

So, a few months went by and some developers who were in the process of evaluating Mura shot me a message asking for a little direction on a problem. "We have Mura up, but cannot go to sub pages. I think it is a SEO URL thing that IIS6 is not handling correctly ..." and they attached a couple of screen shots for me to look at. It took me a minute to remember, but I asked them if they had ISAPI installed. Sure enough, they did. So I proceeded to let them know if my recent experience, but wasn't able to help them really solve the problem ... because see, they actually used ISAPI and needed to have it play nicely with Mura.

A short time later, one of the developers had a "eureka!" moment. In hopes of guiding any other people running into this problem, I've opted to post his entire response below. Many thanks (and congrats) to Ken Payne for solving this problem!

Steve,

I just figured out our iis6/cf8 404 problem and I thought you might like to know what its was.

By default CF8 is not SES enabled.  I saw how to correct this early on in my investigation, by uncommenting the appropriate entries in the web.xml file.  This had no apparent effect and we assumed it wasn't even hitting CF anyway since it was a IIS 404 error.  So after your hint that it may be ISAPI we edited IIS and did a restart and voila the SES URL's now worked.  On 1 but not on the other 2 installs.  I hadn't restarted the other 2 cf instances after editing their web.xml... 

So after monkeying with restarting IIS and the other CF instances they magically worked at some point.  Enter the new developer with his own CF instance and we have the same problem.  It didn't take me long to puzzle it out by dumb luck on my first try.

So the correct sequence is:

  • Edit web.xml to enable ses
  • Restart the CF instance
  • Restart IIS
  • Done!

So simple once I see what's going on.   IIS was smart enough to know that CF didn't have a servlet for handle the ses url so it just didn't pass it.  This was not obvious since at one point it did indeed pass it on during my testing when I re-commented the ses servlet declarations and tried accessing with ses url.  But of course I had not restarted IIS yet so it thought CF could handle it etc.

Hope that made sense.

Launched ColdFusion + Mura CMS Powered Sites for EBL Canopy Zipline Tours

EBL Canopy Tours, launched their completely revamped online presence at www.ebl.org. Technically speaking, three (3) separate sites have been launched for EBL. The main site has become more of a "landing" page allowing visitors to choose the direction they wish to proceed: Canopy Zipline Adventures and Canopy Zipline Installations. The "adventures" site is geared towards those seeking zipline and canopy tour adventures, while the "installations" site is geared towards those seeking the "premier installer of Canopy Zipline Tours."

All of the sites are powered by Adobe® ColdFusion® and Microsoft® SQL Server with online content management provided via Mura CMS. Jaci M.'s fully customized designs were easily integrated into Mura CMS to allow our client the ability to add and edit content while maintaining the original design's integrity.

The sites feature a brand new Mura plugin I've developed called MuraMediaPlayer™ which will soon be released to the general public. MuraMediaPlayer allows our client to easily add media files to any page on their site. I also set up an Amazon S3 for storage of site assets and Amazon CloudFront account to allow for streaming video. In addition, the adventures and installations sites both feature a "weighted-randomized" header for the home pages. Using some Mura class extensions, I enabled the client to upload a header, location details, up to five (5) additional location images and also determine the "Weight for Randomness" for each canopy zipline tour location.

This was definitely a fun project to be a part of and hopefully one of these days, our client will invite us to one of his canopy zipline locations (hint hint!). Congratulations to everyone at EBL, and I look forward to working with you again soon.

EBL
Designer: Jaci M. | Developer: Stephen Withington | Content Management System: Mura CMS

Launched ColdFusion + Mura CMS Powered Site for Mitchell Swaback Charities

Every once in awhile, I'm fortunate enough to be involved in projects that truly "make a difference." This, for me, is one of those projects.

Mitchell Swaback Charities, formerly known as The Mitchell Swaback Foundation, launched their new web site at www.mitchellswabackcharities.org. Mitchell Swaback Charities was started in 2004 by family and friends of Mitchell Swaback after he suffered from a fatal accident on August 14, 2004. They wanted to continue Mitch's "compassion to serve in missions, the church and to honor God in the way Mitch did on a daily basis." For over five years now, they have been busy fulfilling their mission through a variety of projects and events that continue to impact people throughout the world.

The site is powered by Adobe® ColdFusion® and Microsoft® SQL Server with online content management provided via Mura CMS. I was able to fully integrate Jaci M.'s completely custom "bloggishy" design into Mura CMS without a hitch. I leveraged a number of class extensions and custom display objects in Mura CMS to pull everything together.

I was even able to pull in my cfMediaPlayer project from RIAForge to allow the client to upload and display video quickly and easily. Luckily, Amazon added streaming capabilities to CloudFront just in time for me to allow our client to stream their video as well.

Along with a typical "donate online" feature, the client had a few unique needs such as the ability to "flag" nearly any project as "supportable" which would then allow a visitor to direct their donation amount(s) towards that particular project. Other custom e-commerce applications included a "charity event participant sponsorship" application and a complete "golf outing sponsorship and registration" application.

I truly felt privileged to be a part of this project and hope that my work further enables MSC to continue thriving and growing in their mission to "Advance the Kingdom of Christ by Reaching Out to Others." Congratulations and thank you to everyone at Mitchell Swaback Charities.

Mitchell Swaback Charities
Designer: Jaci M. | Developer: Stephen Withington | Content Management System: Mura CMS

Adding Custom CSS Style Options to the Mura CMS Content Editor Toolbar

If you would like to add your custom CSS styles to the Mura CMS content editor toolbar, also known as a the FCKeditor toolbar, then read on!

First, let's make sure we're all on the same page. If you have access to the "Admin" area of a Mura CMS site, you can login, go to the Site Manager and select a page to edit content on. In the 'Content' area, a toolbar containing buttons to format the text, insert pictures, etc. runs across the top. This is the toolbar to which I'm referring. Here you will find a 'Style' dropdown.

This dropdown is controlled by an .XML file located under /{siteid}/includes/themes/{themename, i.e., 'merced'}/css/fckstyles.xml. Here is the basic content of that file:


<?xml version="1.0" encoding="utf-8" ?>
<Styles>
    <Style name="Align Image Left" element="img">
        <Attribute name="class" value="left" />
    </Style>
    <Style name="Align Image Right" element="img">
        <Attribute name="class" value="right" />
    </Style>
    <Style name="Intro" element="p">
        <Attribute name="class" value="intro" />
    </Style>
    <Style name="Centered Text" element="p">
        <Attribute name="class" value="center" />
    </Style>
    <Style name="Call to Action" element="a">
        <Attribute name="class" value="callToAction" />
    </Style>
    <Style name="Call to Action" element="li">
        <Attribute name="class" value="callToAction" />
    </Style>
</Styles>

In order to get your custom styles to appear in the dropdown, we would then obviously need to edit this particular file. To test this out, let's add some <Style> elements to this file.


    <Style name="Paragraph" element="p" />
    <Style name="Heading 1" element="h1" />
    <Style name="Heading 2" element="h2" />
    <Style name="Heading 3" element="h3" />
    <Style name="Heading 4" element="h4" />
    <Style name="Heading 5" element="h5" />
    <Style name="Heading 6" element="h6" />
    <Style name="Italic" element="em" />
    <Style name="Blockquote" element="blockquote" />
    <Style name="Preformatted Text" element="pre" />

Be sure you place these just after the opening <Styles> tag! Save the file, upload it to your site and navigate to your Admin > Site Manager, then select a page to edit.

Hey! Where's My Styles?

The first thing you'll probably notice is that nothing has changed. If this is the case, trust me, your changes are there, you just can't see them yet. Unfortunately, a <CTRL> + <F5> won't be enough to remedy this situation either, and this is probably where some people have thrown up their hands in frustration. Don't worry, we'll get this fixed in a snap.

The problem is merely that the contents of the XML file have been cached. So, let's 'officially' clear the cache, shall we? In Firefox, at the top of the Firefox window, click on the Tools menu, and select Options. Select the Advanced panel, then click on the Network tab. In the Offline Storage section, click the Clear Now button. Then click the OK button to close the Options window. If you're using Internet Explorer, then use Firefox. Just kidding ... but seriously, use Firefox.

If you're like me and have taken advantage of the 'Web Developer' toolbar add-on for Firefox, it's even simpler. Just click the Miscellaneous button on the toolbar, hover over Clear Private Data, then click Cache. That's it!

Show Me More!

So now you should see your 'new' styles appearing in the style dropdown. However, you want more don't you? Of course you do. Luckily, there is some pretty good documentation on the CKEditor site at http://docs.cksource.com/FCKeditor_2.x/Developers_Guide/Configuration/Styles. There you should be able to learn more about the XML file, Style nodes, Attribute nodes, "Object" elements, and more.

I hope this helps!

Integrating Your Custom Web Site Design with Mura CMS

Are you tired of trying to shoe-horn your custom web site design into someone else's content management system? Drop in and learn how to fully integrate your custom CSS and HTML with Mura CMS, a comprehensive, ColdFusion-powered, open source content management system. In less than sixty minutes, I'll attempt to cover:

  • Exploring Mura templates & themes
  • Integrating your custom CSS & HTML
  • Creating Mura components
  • Creating Feeds/Indexes
  • Creating Custom Feeds/Indexes

If you haven't already done so, it might behoove you to catch part one, "Getting Started with Mura CMS", offered on the CFmeetup on Nov 12, with the recording here.

Where: The presentation will be online and free to anyone who's interested. The meeting will also be recorded for those who are unable to make it to the live presentation. Visit http://www.meetup.com/coldfusionmeetup/calendar/11981239/ for more information and to RSVP.

When: Thurs. Dec 3, 12:00pm US ET (UTC/GMT-5)

Feel free to stop by!

Getting Started with Mura CMS: a ColdFusion-Powered, Open Source Content Management System

Are you looking for a ColdFusion-powered, open source content management system? Drop in and learn how to have a site up and running in less than sixty minutes! Within one hour, I'll walk through each of these steps to help you get started using Mura CMS:

  • Installing Mura CMS
  • Creating your first site
  • Setting up navigation
  • Creating a custom 404 page
  • Exploring some built-in features and objects
  • Creating your first Mura component
  • Creating your first form

Where: The presentation will be online and free to anyone who's interested. The meeting will also be recorded for those who are unable to make it to the live presentation. Visit http://www.meetup.com/coldfusionmeetup/calendar/11838818/ for more information and to RSVP.

When: Thurs. Nov 12, 12:00 pm US ET (UTC/GMT-5)

Hope to see you there!

Catch My BFusion Presentations on CFMeetup!

I received confirmation from Charlie Arehart, the online ColdFusion Meetup organizer, that I'll be giving both of my BFusion presentations on CFMeetup. So the good news is if you won't be able to attend BFusion/BFlex this year, then at least you'll still be able to see my presentations. However, they won't be "hands-on," which will hopefully allow me to trim my 90-minute presentations down to the typical 60-minute mark we've grown accustomed to on CFMeetup.

So, if you're interested, please mark your calendars!

Getting Started with Mura CMS

November 12, 2009, 12:00 p.m. (noon) Eastern

Looking for a ColdFusion-powered, open source content management system? Drop in and learn how to have a site up and running in less than sixty minutes!  Within one hour, I'll walk through each of these steps to help you get started using Mura CMS:

  • Installing Mura CMS
  • Creating your first site
  • Creating your first form
  • Creating your first Mura component
  • Setting up navigation
  • Creating a custom 404 page
  • Exploring built-in features & objects
  • Exploring Mura templates & themes

Integrating Your Custom Design with Mura CMS

December 3, 2009 12:00 p.m. (noon) Eastern

Tired of trying to shoe-horn your custom design into someone else's content management system? Drop in and learn how to fully integrate your custom CSS and HTML with Mura CMS, a comprehensive, ColdFusion-powered, open source content management system. In less than sixty minutes, I'll attempt to cover:

  • Exploring Mura templates & themes
  • Integrating your custom CSS & HTML
  • Creating Mura components
  • Creating Feeds/Indexes
  • Creating Custom Feeds/Indexes

*If you haven't already done so, it might behoove you to catch part one, "Getting Started with Mura CMS."

How to Send Confirmation Emails to Form Submitters in Mura CMS

A question came up in the Mura CMS forums about "sending a confirmation message automatically" that I thought other developers and/or users of Mura CMS might find helpful.

When you create a form in Mura CMS, there are a couple of convenient fields available. One field allows for a comma-separated list of email addresses to receive notification whenever the form is submitted. Another field is a text area for displaying a "confirmation message" to the person who submits the form.

One field that isn't currently available is a checkbox to "send copy to submitter." A good reason for this could simply be that since a form could contain any number of unique fields and field names, it could be very difficult to programmatically allow for something as unique as this.

So I wrote a simple custom display object that will essentially check for a form field called "email" and if it is valid, send a confirmation message to the submitter (assuming the submitter's email is contained within the "email" form field). Lost yet? I hope not.

First, you'll want to create a custom display object. you can copy the code below and save it to/as "[siteid]/includes/display_objects/custom/dsp_email_confirmation.cfm"


<cfsilent>
<!---

    Document:        dsp_email_confirmation.cfm
    Version:        20091005.01
    Author:            Steve Withington | www.stephenwithington.com
    
    Purpose:        I send email confirmations to form submitters.
    
    Instructions:    Assuming you've placed this file in/as:
                    "[siteid]/includes/display_objects/custom/dsp_email_confirmation.cfm"
                    
                    Go to "Forms" in your admin, select the form you want to use this script
                    in, go to the "Confirmation Message" text area, then copy + paste this:
                    
                    [mura]dspInclude('display_objects/custom/dsp_confirmation_email.cfm')[/mura]
                    
                    This could be the only line of text in your Confirmation Message text area
                    since now you can modify the confirmation text below. However, any
                    text in the "Confirmation Message" form field will also be display on
                    the screen.
                    
                    The confirmationText below can even be a dynamic field that's passed in
                    on form submission, etc.

--->

<cfsavecontent variable="confirmationText">
<cfoutput>Thank you for for your inquiry. A representative will contact you shortly. For immediate assistance, feel free to call 800.555.1212.</cfoutput>
</cfsavecontent>
</cfsilent>
<cfoutput><p class="success">#confirmationText#</p></cfoutput>
<cfif structKeyExists(request, "email") and isValid("email", request.email)>
    <cfsilent>
        <cfset site = application.settingsManager.getSite(request.siteID) />
        <cfset success=true />
        <cftry>
            <cfset email=application.serviceFactory.getBean('mailer') />
            <cfset email.sendText(confirmationText, form.email, form.email, site.getSite(), request.siteid, form.email) />
            <cfcatch>
                <cfset success=false />
            </cfcatch>
        </cftry>
    </cfsilent>
    <cfoutput>
        <cfif success>
            <!--- if successful, a confirmation message can be displayed here --->
            <p class="success"><em>A confirmation has also been sent to your email.</em></p>
            <cfelse>
            <!--- if an error occurs, an error message can be displayed here --->
            <p class="error">Sorry, we experienced a problem in our attempt to send you a confirmation via email.</p>
        </cfif>
    </cfoutput>
    <cfelse>
    <!--- you can display an error message if the email address provided is not valid --->
    <p class="error">Unfortunately, the email address you provided was not a valid email address.</p>
</cfif>

Next, you'll want to go to your "Forms" section in your admin area, select the form you want to use this script in, go to the "Confirmation Message" text area, then copy and past this in:


[mura]dspInclude('display_objects/custom/dsp_confirmation_email.cfm')[/mura]

You can then simply modify the confirmation message within the script, or even pass one in dynamically.

Hope this helps!

More Entries

© 2010, Stephen J. Withington, Jr.  |  BlogCFC was created by Raymond Camden – Version 5.9.004

Creative Commons License  |  This work is licensed under a Creative Commons Attribution 3.0 Unported License.