jeffcoughlin.com

How'd he do that? Dynamic Anchor Links using CFMX and jTidy

On a recent site I worked on (www.middlesexhospital.org) one of the requirements was to take the body from dynamic content pages and make an unordered list of anchored links pointing to the <h*> heading tags on the page.

Example body textMost copywriters today write correctly using headings (and nested headings).
(Click on the example image to the left).
<h1 id="Heading-1a">Heading 1a</h1>
<p>Some paragraph text.</p>
<h2 id="Heading-2a">Heading 2a</h2>
<p>Some paragraph text.</p>
<h2 id="Heading-2b">Heading 2b</h2>
<p>Some paragraph text.</p>
<h3 id="Heading-3a">Heading 3a</h3>
<p>Some paragraph text.</p>

Example unordered listReferencing the id attributes for the <h*> heading tags you can now provide anchored bookmark links pointing to them in an unordered list (apply styles as needed).
(Click on the example image to the right)
<ul title="Page navigation tree">
<li><a href="#Heading-1a">Heading 1a
<ul>
<li><a href="#Heading-2a">Heading 2a</a></li>
<li><a href="#Heading-2b">Heading 2b</a>
<ul>
<li><a href="#Heading-3a">Heading 3a</a></li>
</ul>
</li>
</ul>
</li>
</ul>

So given the body, how do we create the unordered list dynamically? Also, I don't want to make my users have to know how to set id attributes in <h*> heading tags (especially if they are using a WYSIWYG editor such as FCKEditor or htmlArea to edit their content).

Read more in this tutorial.


Going Down to CFUNITED-05

I've been trying to decide for the last few months whether or not to go to this year's CFUNITED conference and I finally gave in to my temptations.

I don't mind driving down there (should only be half a day's drive) however this can get pricy, fast (gas, hotel, admission, etc). So I'm planning to ask around the Hartford area (probably at the next Hartford CFUG meeting) to see if anyone is interested in carpooling and/or sharing a suite or something.

[more]


ColdFusion's Evlauate() Function

Lately I've been doing my best to use coldFusion's Evalaute() function less and less (due to all of it's performance issues). I have only found one case so far where I haven't gotten away from using it (and I'm pretty sure that there is a way around taht as well).

A friend recently noted that I was setting dynamic variable names using the Evaluate() function. He noted that I should be using the setVariables() function instead (because its faster). Sounded good to me at the time.

Today I discovered that as of CFMX this function is "no longer required in well-formed ColdFusion pages" (I'd almost venture to say Deprecated, but the CFMX docs didn't say that). You can read more about it on the Macromedia Live Docs.

So what do you replace it with? Believe it or not you can just set the new variable name using quotes.

New Way:
<cfloop index="i" from="1" to="5">
  <cfset "myVar#i#" = i />
</cfloop>

Old Way:
<cfloop index="i" from="1" to="5">
  <cfset Evaluate("myVar" & i & " = " & i) />
</cfloop>

Not only is this much faster, but it is much easier to read when we start getting into more complex algorythms on the right-hand side of the set statement.


New Website Was a Big Success

It’s official now. The new website for Middlesex Hospital has been a big success. Requests have been pouring in for more features and enhancements (enough to keep me busy for some time). Other clients of mine have seen this release and are aware of some of its great features and have already shown some interest in a Farcry-based website (don't worry, my current projects come first :) ).

There are so many people I'd like to thank. In particular I'd like to thank Spike Milligan. Although this project has been in the works for over seven months, we flew Spike in to help out during the last two weeks. After what seemed like endless hours and sleepless nights we were able to get the product production-ready.

Spike and I were working at my home during the weekends (my wife's cooking is better than hospital food any day :)).

Thanks again Spike for your hard work and dedication. We wouldn't have been able to get those remaining CF code portions done in time without you.

Now that I've been able to catch up on a little sleep I've been able to take a step back and breathe a little (seriously, I was working 18+ hour days the last 6-8 weeks. I ran my body down so much that I'm sicker than you can imagine. I'll heal though :)).

 

[more]


New CFECLIPSE Build is Out

Spike is at it again. Go over to his blog to get the latest nightly build of CFECLIPSE (build 1.1.18.9). Several new features/bug fixes were added. My favorite is the introduction of ctrl+m which now works as it did in CFStudio and Homesite+.

Just be careful. This version has some updates to the snipets feature. After upgrading I lost all of my snipets. Someone posted a possible remedy to get them back, but I haven't tried it yet.


New Site Launch

Well we got the site out on time. There are a few pieces missing from site launch (still in development; almost done), but for the most part I am quite pleased with the final product.

Have a look and see what all the fuss is about.

The site was coded in 100% Farcry. Okay, technically there are some old pieces they wouldn't let me incorporate into Farcry just yet, but we'll just pretend they aren't there at the moment :) .

The site uses all sorts of fun things... From web services (SOAP on the Your Health pages) to dynamic promo boxes in the right pane (and much more).

Now its 2:30am and I need to get home and get some sleep (and its my birthday :) ).


1 Day Before Site Launch

Here I am one day before site launch. I see the light at the end of the tunnel, but its still far off in the distance. There is so much coding left to be completed and content entered into the system. Its going to be another long day+night.

Two months of 18-hour work days really puts a toll on the human body. When this project is complete I plan to take some time off and rest. I won't want to see another Email or script for a while (maybe I'll go to a tropical island for a weekend with the wife... no computers :) ).

I am crossing my fingers and hoping we get this site completed on-time. We are to go live sometime tomorrow evening (after Spike leaves) so I am crossing my fingers we wont run into any major bugs during launch.

The website has to be live by Monday morning to cooincide with a large marketing campain (TV commercials, radio adds, newspaper, etc) advertising many of the hospital's technological features. The website needs to reflect that image.

Wish me luck.


ColdFusion MX 7 Released

I got my hands on a copy of Macromedia ColdFusion MX 7 Developer Edition. As many of you already know (from the Blackstone beta) there are come exciting new features in this version of CF. I suggest you head on over to Macromedia and take a look. When I'm done working on this software project in a few weeks I'll be able to spend some time getting my hands dirty :).


New Farcry Video

As promised I released another Farcry video. This is a "beginner's guide to upgrading Farcry" (from a previous version). The short video shows how simple and quick upgrading Farcry can be.

A special thanks to all the people who helped me test the video before release.

---- On a side note: I have been asked by one individual if I could make the Videos viewable for Mac OS X users. The video codec currently used is not supported by MacOS X's Media Player 9.

I have made a second version of the last two videos using an older video codec, however the video quality is noticably different (at least to me. Some say its not too bad). If you are interested in a copy let me know and I'll set you up with one. I may put copies of them on the website as well, but it will require some CF editing (time I don't have at the moment :).


Some stuff in the works

I've had so many great responses from people about the Farcry video tutorials. I even saw a post about the tutorials on Blog in Black. Thanks for all the great emails.

Believe it or not these do take a lot more work and time than I make them seem. I've already started work on two new ones. Unfortunately I've developed a cough that I just can't seem to shake :). So as soon as I am well enough I promise to get some more videos up soon (trust me, you wouldn't want to hear my voice today :) ).

I want to get some of the beginner guides out of the way first, however I already have some advanced tutorials in mind. There seems to be a lot of requests for help on dynamic menus and custom types. Although custom types are covered somewhat in the Farcry documentation in the "How-To" section I'd still like to cover a couple things (as well as some undocumented features about extending types). As for making a tutorial about dynamic menus... I'm thinking about making a section for for that. Perhaps a few tutorials about making dynamic menus since there are so many ways for different situations (and different menu layout). Because I have been doing a lot of work with Web Standards lately I may even ask people like Ben Bishop for assistance and ideas.

You wont likely see any advanced tutorials out before the new year, but hopefully a few beginners guides. In the meantime if anyone has any suggestions for a video tutorial that you feel will benefit the masses go ahead and give me an email or reply a comment here. Also if anyone would like to be on a list of testers for future videos let me know. If I make more detailed videos than what already exists I should probably have videos tested for errors first :).


*** Previous Entries *** / *** More Entries ***




BlogCFC 5.9.8.007 by Raymond Camden | RSS | Contact Blog Owner