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"/>

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 are not allowed for this entry.
Jon Hartmann, July 2011

I'm Jon Hartmann and I'm a Javascript fanatic, UX/UI evangelist and former ColdFusion master. I blog about mysterious error messages, user interface design questions, and all things baffling and irksome about programming for the web.

Learn more about me on LinkedIn.