BTW,

 

This is pedantic, but I would prefer to do something like.

 

<cfswitch expression=#thisTag.executionMode#>

<cfcase value eq "start"> <cfset doStartTag() /> <cfbreak> </cfcase>

<cfcase value eq "end"> <cfset doEndTag() /> <cfbreak> </cfcase>

</cfswitch>

 

<cffunction name="doStartTag">

</cffunction>

 

<cffunction name="doEndTag">

</cffunction>

 

Refactoring the code like this makes it a bit more maintainable as well as
easier to follow in case the code blocks get fairly big.

 

 


Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273

 

 

From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Carl Vanderpal
Sent: Tuesday, 28 August 2007 4:33 PM
To: cfaussie@googlegroups.com
Subject: [cfaussie] Re: Random image inside cfmodule start and end tag

 

Doh, (slaps forehead..)

Thanks Steve..

On 8/28/07, Steve Onnis <[EMAIL PROTECTED]> wrote: 



<cfif thisTag.executionMode is "start"> 

    <cfset myRandomImage = RandRange(1,5)>
    <cfset thisTag.imageName = myRandomImage />
 <div id="headerImage_#thisTag.imageName#">header image</div>

<cfelse>

 <div id="sideImage_#thisTag.imageName#">side image</div> 

</cfif>

 

Try that

Steve

  _____  

From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Carl Vanderpal
Sent: Tuesday, 28 August 2007 4:26 PM
To: CF Aussie - Google
Subject: [cfaussie] Random image inside cfmodule start and end tag

Hello all,

Just having one of those moments when brain wont kick into gear..!!

I have a random image that is being called for a header graphic and a side
bar background, which are called by css id's

One is part of the "start tag" in the cfmodule and the other is at the
"end", how do I get them to pass the same number?

eg. 

#headerImage_1, #headerImage_2, #headerImage_3, #headerImage_4,
#headerImage_5 

and the side bar equivalents 

#sideImage_1, #sideImage_2, #sideImage_3, #sideImage_4, #sideImage_5


layout.cfm page 
===============
<cfset myRandomImage = RandRange(1,5)>

<cfif thisTag.executionMode is "start">

 <div id="headerImage_#myRandomImage#">header image</div>

<cfelse>

 <div id="sideImage_#myRandomImage#">side image</div> 

</cfif>


Thanks


====================================
Postal: Po Box 3462 Dural, NSW 2158
Email: mailto:[EMAIL PROTECTED]  <mailto:[EMAIL PROTECTED]> 
Skype: skype:carlos-amigos?call

 




-- 
====================================
Postal: Po Box 3462 Dural, NSW 2158
Email: mailto:[EMAIL PROTECTED] 
Skype: skype:carlos-amigos?call


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to