BlogCFC Tweaks: Bug Fix for viewByCategory.cfm

I recently posted a blog entry with some code and instructions to allow drilling down into categories to view the posts in that category. Unfortunately, it had a bug. The meat of the viewByTemplate.cfm file should look like this:


<cfmodule template="../tags/datatable.cfm" data="#entries#" editlink="entry.cfm" label="Entries"
         linkcol="title" defaultsort="posted" defaultdir="desc">

    <cfmodule template="../tags/datacol.cfm" colname="title" label="Title" />
    <cfmodule template="../tags/datacol.cfm" colname="released" label="Released" format="yesno"/>
    <cfmodule template="../tags/datacol.cfm" colname="posted" label="Posted" format="datetime" />
    <cfmodule template="../tags/datacol.cfm" colname="views" label="Views" format="number" />
    <cfmodule template="../tags/datacol.cfm" label="View" data="<a href=""#application.rooturl#/index.cfm?mode=entry&entry=$id$"">View</a>" sort="false"/>
</cfmodule>

Notice the missing "querystring" attribute on the datatable module. If you don't remove that bit, clicking on a blog post link from the category view wont take you to that blog post at all. I've updated the code in the relevant zip.

 

Related Blog Entries

Comments

Jon in Chicago, July 2008

I'm Jon Hartmann and I'm a C# .Net developer by day, a ColdFusion guru by night, and all around Javascript fanatic. Stay right here to read my technical posts as I grapple with mysterious error messages, user interface design questions, and all things baffling and irksome about programming for the web. Learn more about me.

Post a job. Find one. authenticjobs.com

Interested in becoming a sponsor? Contact me.