Home » Tutorials » ColdFusion » Introduction

Introduction

Coldfusion is written right along side your HTML code. ColdFusion is a little different from other server side languages because it is written almost entirely <tags>, just remember that when you are programming. While ColdFusion is very relaxed when it comes to syntax, it is import to maintain a proper variable naming scheme and to have consistency throughout your pages. Well, that was a quick introduction, now let’s’ write our first ColdFusion script! To create your first ever ColdFusion file, give it a name followed by “.cfm” This is the file extension for ColdFusion. What we are going to do here is to write something to the document. If you ever want ColdFusion to output something, you must have the output in the <cfoutput> and </cfoutput> tags.

Example
<html>
    <body>
        <cfoutput>
            ColdFusion Wrote me
        </cfoutput>
    </body>
</html>
Result ColdFusion Wrote me

As you can see, it is pretty easy. I would recommend breaking your pages into a logic section where you put all of your important code and an output section wrapped with <cfoutput> and ending it with </cfoutput> that way you wouldn’t have to keep putting it around each new thing you want to write to the document. Separating your code into logic and outputting (views) is a great practice. Personally, I recommend them being two different pages and using classes, but we won’t dive into OOP in the ColdFusion tutorial. Most of it is written using a procedural coding practice anyway.The above example was how to output data to the DOM, but ColdFusion has different ways to specify outputting html and to output actual ColdFusion values. You will see how to do this in variables.



Link/cite this page

If you use any of the content on this page in your own work, please use the code below to cite this page as the source of the content.

  • Stewart, Suzy. "Introduction". After Hours Programming. Accessed on March 16, 2024. https://www.afterhoursprogramming.com/tutorial/coldfusion/introduction-coldfusion/.

  • Stewart, Suzy. "Introduction". After Hours Programming, https://www.afterhoursprogramming.com/tutorial/coldfusion/introduction-coldfusion/. Accessed 16 March, 2024.

  • Stewart, Suzy. Introduction. After Hours Programming. Retrieved from https://www.afterhoursprogramming.com/tutorial/coldfusion/introduction-coldfusion/.



4 thoughts on “Introduction”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.