I totally agree with Raymond but have one comment to make:

"I'll go out on a limb here and say if your site will not work
when using <cf_foo></cf_foo> versus an include, then you have other
problems."

There are special issues when you use the closing </cf_foo> tag because CF will 
call your tag twice, once for the opening tag and once for the closing tag.  
Tags can be written to handle this properly but I almost never do (unless the 
tag is designed to work with a closing tag).  So, yeah, this calling style can 
hurt a site, so use just <cf_foo> to replace <cfinclude template="foo">

        Mark



-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 30, 2004 1:59 PM
To: CF-Talk
Subject: Re: CFMODULE vs. CFINCLUDE


I'd agree with Simon, specifically the "not that it's a huge big
deal". I'll go out on a limb here and say if your site will not work
when using <cf_foo></cf_foo> versus an include, then you have other
problems.

Yes, cf_foo (or cfmodule) is slower than cfinclue.
But don't worry about it.

Unless you are running Spectra and have 500 or so custom tags running
at once, it will never be a real issue.

I'd always go for the custom tag solution since it protects your
calling documents from having their variables screwed up by the
customtag/cfinclude code.

"e) Allows you to cycle in special headers/footers at any time rather than
editing a central display template."

You can also just simply not use the custom tag on a page that needs
something special.

"Also, all content between the tags is loaded into a variable called
generatedcontent. "

I don't think it's copied, I'm pretty sure it is a reference. Did you
notice that you can modify this value and it changes what is between
the tags? You don't have to return anything, just reset it.

If I can summarize, I do not believe the performance reasons are a
valid concern. I'd go with the syntax you are most comfortable with.
Just remember that, all things being considered, the custom tag method
is safer to your calling document.


On Tue, 30 Nov 2004 18:22:37 +0000, Simon Horwith <[EMAIL PROTECTED]> wrote:
> Not that it's a huge deal, but don't forget that cfmodule also requires
> a single file compilatation as opossed to two file compilations, as well ;)
> 
> ~Simon
> 
> Simon Horwith
> Chief Information Officer, AboutWeb
> http://www.aboutweb.com
> Member of Team Macromedia
> Macromedia Certified Master Instructor
> Editor-in-Chief, ColdFusion Developers Journal
> Blog - http://www.horwith.com
> 
> 
> 
> 
> Katz, Dov B (IT) wrote:
> 
> >CFModule encapsulates the layout nicer than 2 isolated CFINCLUDES...
> >
> >You have a single layout.cfm which detects if #thistag.executionmode# is
> >"start" and shows the header or footer.   It makes for an easier read if
> >the module is CF_TAGNAME'd..
> >
> >Example... You have layout.cfm, so you can do this:
> >
> ><CF_LAYOUT>
> > my page
> ></CF_LAYOUT>
> >
> >That's more elegant than cfinclude header, cfinclude footer, and allows
> >you to pass in custom arguments since it's using cfmodule under the
> >covers.
> >
> >That's my take on things
> >
> >-dov
> >
> >-----Original Message-----
> >From: Michael Dinowitz [mailto:[EMAIL PROTECTED]
> >Sent: Tuesday, November 30, 2004 12:46 PM
> >To: CF-Talk
> >Subject: CFMODULE vs. CFINCLUDE
> >
> >I'm rewriting Raymond's Lighthouse Bugtracker (not my idea) and one
> >piece bought up an old question I had. Is there any performance
> >difference between a CFMODULE acting as a layout wrapper or 2 CFINCLUDE
> >templates with layout?
> >In the first case, your code is:
> ><cfmodule template="layout.cfm">
> >Display stuff
> ></cfmodule>
> >
> >In the second  case you have:
> ><CFINCLUDE template="header">
> >Display Stuff
> ><CFINCLUDE template="footer">
> >
> >Because of the nature of the CFMODULE, it's called twice and various
> >variables are created in its process. The CFINCLUDE method uses 2
> >CFINCLUDES, but there's nothing special about them. No extra variables,
> >etc.
> >
> >Logic says that the CFINCLUDE method of template layout is more
> >efficient, but I'd like to know what others think?
> >
> >I'll ask the question about what people think of the pagecontext include
> >vs.
> >cfinclude another time. :)
> >
> >
> >
> >
> >
> >
> 
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185736
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to