Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Convert CFM to HTML

Participant ,
May 13, 2008 May 13, 2008
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?
2.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 13, 2008 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 13, 2008 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...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2008 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 13, 2008 May 13, 2008
LATEST
Yes, this worked great! Thank you!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources