Today marks another step towards website redesign implementation. If you are lucky enough to be able to reach the redesign port, kudos to you, you may now view the development of the web site. If not, um... wait until December like everyone else. With this new port we can test all links as though they are in the root of the production server. This in turn will hopefully limit the amount of errors that occur during roll out. Anyway I had nothing to do with making the port it is just really cool.
Now off to what I did today. On the standard footer for most VCU Libraries there is a "Updated" section, this is dynamic for all pages using the .html extension. Coldfusion files on the other hand are not parsed the same way as .html files and as such do not have a truly dynamic footer. I have been researching various ways to implement this "Updated" feature, but I had only succeeded in confusing myself. When first researching I came across "event gateways" in Coldfusion which run a .cfc file when an event occurs, such as a file system change like a file addition or a file being saved. I did not realize that this was meant mainly for creating custom logging systems, not the dynamic "Updated" feature. After more research I found a code example that looked like this:
<cfdirectory action="list"
directory="#ExpandPath(".")#\"
name="qGetLastdateModified"
filter="#ListLast(CGI.SCRIPT_NAME, "/")#">
<cfif qGetLastdateModified.recordCount>
<cfoutput>Updated: #DateFormat(qGetLastdateModified.dateLastModified, "mm/dd/ yyyy")#</cfoutput>
</cfif>
Sadly this did not work, rather nothing happened and I assumed that it was just a busted snippet of code. After consulting liveDocs I decided to take apart the code and see what went wrong where. The main issue was in the line: directory="#ExpandPath(".")#\"notice the "\" at the end of the line. This code was meant for a windows system. After replacing it with a "/" the last modified date was returned as "11/13/2006". Now off to livedocs again to figure out how to use DateFormat. In the end the result for the "updated" was: <cfdirectory action="list"
directory="#ExpandPath(".")#/"
name="qGetLastdateModified"
filter="#ListLast(CGI.SCRIPT_NAME, "/")#">
<cfif qGetLastdateModified.recordCount>
<cfoutput>Updated: #DateFormat(qGetLastdateModified.dateLastModified, "mmmm dd, yyyy")#</cfoutput>
</cfif>