Skip to main content
Participant
December 9, 2009
Question

How do you organize your web root?

  • December 9, 2009
  • 1 reply
  • 805 views

Hello,

I'm working on an internal web application for our office. I'm fairly new to ColdFusion, but I've been using other languages for a long time. I'm most familiar with Python and the Django framework.

I'm a little lost as to how to keep my web root directory organized. I understand that in ColdFusion 9 it is suggested that I package various things into their own applications, and in the web root they're under their application directory path. I plan on doing this. What about things like re-usable html templates? Is there a nice way to create html templates, and render a page using them? Or does ColdFusion only offer the PHP-like "include 'template.cfm'" method of doing this? For some reason this just feels messy to me.

How do others organize their web root directories?

Thanks,

Ryan

    This topic has been closed for replies.

    1 reply

    Inspiring
    December 9, 2009

    Hi Ryan,

    You can use the <cfinclude> tag for including your html templates,

    For eg,

    <cfinclude template = "footer.html">

    Refer the documentation for more info,

    http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000277.htm

    Participant
    December 9, 2009

    Yea, I knew about that. That's what I'm currently doing, but it doesn't feel intuitive. Including portions of your page at various locations could get ugly. Like, my footer template has only a few lines of html in it to wrap up the <body> and <html> tags. What if somehow it got included in the wrong location, or not at all?

    Inspiring
    December 9, 2009

    Well.. If you really want to separate your code as views, business logic then you there are lot of MVC frameworks available for ColdFusion.

    FuseBox (http://www.fusebox.org) is one good framework though which you can acheive the MVC.

    If you look for a basic solution then, you can go for html frames.