Entries for month: February 2006

Dreamweaver CFC Bean Generator Dreamweaver CFC Bean Generator Dreamweaver CFC Bean Generator

I've been using Jon Block's wonderful online CFC generator for a while, but I always secretly hoped that he was going to create a Dreamweaver extension for it. I decided it was going to happen (he's more likely a CFEclipse user ;), so I did a quick google and found the CFC Bean Generator on the Exchange (thanks for posting about it Rob!)

I got it installed, and everything is working wonderfully. I went in and edited the js file to suit my own style a bit more (I don't like using single quotes for attributes, which is what the extension generates) by replacing all single quotes with double quotes, and changing the way variables are initially set. But Adam (the author) is definitely saving me a ton of time, and I can now generate my CFCs at 30,000 feet without having to worry about having any pages saved locally to do it through a browser. I just generated a very compact 300 line CFC in a matter of a minute and a half. Ya just can't beat it...

Continuing with Virtual Directories Continuing with Virtual Directories Continuing with Virtual Directories

Continuing on from my post yesterday regarding virtual directories, another nifty tip is that when including files in ASP, you can use either a file or virtual include. Here are two examples:

<!-- #include file="mydirectory/somefile.asp" -->
<!-- #include virtual="/mydirectory/somefile.asp" -->

The first include would pull the file "somefile.asp" off of the disk in the mydirectory folder. The second include would first look for a virtual directory called mydirectory. If it finds it, it loads somefile.asp from that virtual directory. If it doesn't find it, it would then load somefile.asp from the physical mydirectory on disk, just like the first include.

That's it for virtual directory fun for now :).

New Template Updating Feature in DW 8.01 New Template Updating Feature in DW 8.01 New Template Updating Feature in DW 8.01

With little fanfare (blow your trumpets please!) Macromedia Adobe introduced a new feature in the Dreamweaver 8 updater regarding template paths (see the full technote for more information).

What this means for us lowly developers, is that if we're using includes or folder specfic images and such inside Dreamweaver, we can have each file in a directory include another file inside the child page's directory... As I read that again it doesn't make a lick of sense, so here's an example:

Let's assume that every folder in your site relates to a specific section. And let's assume that you want to have a section image unique to each section. When you're looking at the rum section in the /rum folder, you want /rum/section.gif to display. When you're perusing the whiskey section at /whiskey/index.cfm, you want /whiskey/section.gif to display. A simple request right? Well it wasn't an easy task to accomplish before the latest updater.

Now, if you link to any file inside the Templates directory from a .dwt file, then when child pages are updated, any links to pages inside the Templates folder will not be rewritten. So let's assume the following directory structure:

wwwroot
|--Rum
|  |--index.cfm
|  |--section.gif
|--Templates
|  |--SiteLayout.dwt.cfm
|  |--section.gif
|--Whiskey
   |--index.cfm
   |--section.gif

Inside SiteLayout.dwt.cfm you have an <img> tag like so:

<img src="section.gif" />

Now, when you create a child page from the SiteLayout.dwt.cfm file, that image link won't be &amp;lt;img src="../Templates/section.gif"&amp;gt; as it would have been in Dreamweaver 8.0. Instead, it will be &amp;lt;img src="section.gif /&amp;gt;, which means that each page based on the template will link to the section.gif file in its own folder.

Now that's just good stuff I tell you... If you don't like that feature however, you can turn it off by editing your Site Definition, clicking on the Templates category, and unchecking the "Don't rewrite document relative paths" checkbox. This will revert Dreamweaver 8.01 to Dreamweaver 8's default behavior.

Have fun!

Another one bites the dust... Another one bites the dust... Another one bites the dust...

I finished up the new Dreamweaver 8 Beyond the Basics title for lynda.com on Friday. After 4 solid days in a little sound-proof room, it's time to head back home and catch up on all of the emails and questions from readers. The Beyond the Basics title covers advanced template usage, building multi-column CSS layouts, using some rapid coding techniques in Dreamweaver you might not have known where there, as well as a chapter on getting your feet wet with dynamic development in Dreamweaver 8.

Before I left I also recorded a few pick ups for the Dynamic Development with Dreamweaver 8 title, which should hopefully be released in the next week or two.

Discovery of the Day Discovery of the Day Discovery of the Day

I'm a big fan of virtual directories. I like sharing assets across sites without having to duplicate a bunch of folders. Angela and I were doing some planning for a site and she asked if you created a Virtual Directory in IIS, what would happen if you also had a physical directory of the same name. Well it turns out that if you have a Virtual Directory defined in IIS, the server will completely ignore the contents of any physical directory in the same location. So if you had this:

assets
wwwroot
|--myassets (virtual directory pointing to assets above root)
|--myassets (physical directory on the disk)

Then all files and folders in the physical myassets folder will be completely ignored.

Powered by Mango Blog.