Skip to main content
Inspiring
May 13, 2008
Question

Convert CFM to HTML

  • May 13, 2008
  • 4 replies
  • 3031 views
I have a large SQL Server DB which contains articles. These articles are dynamically generated on the web site and are also searchable within the web site. However, to make the site more search engine friendly, how can I convert my dynamic database content to static HTML pages?
    This topic has been closed for replies.

    4 replies

    ssailerAuthor
    Inspiring
    May 13, 2008
    Yes, this worked great! Thank you!
    Inspiring
    May 13, 2008
    ssailer wrote:
    > Actually, I played around with CFFILE and got it to output all of the articles
    > as a separate HTML file, but the formatting sucks. I can't figure out a way to
    > include formatting within the CFFILE tag. Any ideas? If there was a way to
    > attach a template to these newly created pages, that would work, but I can't
    > figure it out...
    >


    Method one. Run the CFML code like you normally do, but capture the
    output with <cfsaveconent...> and save that string. <cfinclude...>
    would probably simplify this.

    <cfsavecontent variable="htmlOutput">
    ...
    CFML
    OR
    <cfinclude ...>
    ...
    </cfsavecontent>

    <cffile ... output="#htmlOutput#">


    Method two. Configure your web server to process the HTM|HTML extension
    with the ColdFusion application server. Then all the search engine
    don't know that these pages are static.

    ssailerAuthor
    Inspiring
    May 13, 2008
    Actually, I played around with CFFILE and got it to output all of the articles as a separate HTML file, but the formatting sucks. I can't figure out a way to include formatting within the CFFILE tag. Any ideas? If there was a way to attach a template to these newly created pages, that would work, but I can't figure it out...
    Inspiring
    May 13, 2008
    You can probably write out the CFM output into HTML by using CFFILE. I don't have the exact code in mind but that's how I would approach it.