All, My mistake - I forgot to include ALL of you in my previous response. I had not checked e-mail and only had Lee's last post open. I am going to save all of them as resources. I am slowly getting the hang of Fusebox - so far the layouts have been the worst. I am sure I will find other stumbling blocks but you are are great! Thanks again, Loryn
John Quarto-vonTivadar wrote: > > I have an application with several circuits. In 3 of the circuits > > I want the parent layout to be applied. > > In 2 of the circuits I DO NOT want the parent layout applied. I > > want different layouts applied within those circuits depending > > upon which fuseaction is being called. > > Hi Loryn, > > It's not as hard as it seems right now (much like riding a bike). > > Since you're talking about turning off *some* layout but not all, you then > have to decide if your > "parent" circuit is your top-most circuit. If it is, then the solution is > even easier; here's how > you might approach it: > > As Ron Gallant mentioned in an earlier email today, you could set a variable > such as > attributes.SuppressParentLayout (reserving attributes.SuppressLayout for > use later when you need to suppress layout *generally*). [By the way I could > not tell from your example if when you said "parent circuit" you meant a > circuti literally called "parent", or if you meant a circuit directly above > the circuit(s) in question, or if you meant the top-most circuit] > > in the parent circuit's fbx_layouts file have > <cfparam name="attributes.suppressParentLayout" default="false" > type="boolean"> > and then > <cfif attributes.suppressParentLayout> > <cfset fusebox.layoutfile = ""> > <cfset fusebox.layoutdir = ""> > <cfelse> > <cfset fusebox.layoutfile = "layParent.cfm"> > <cfset fusebox.layoutdir = ""> > </cfif> > > Then, in any child circuit that needs to turn off the parent circuit layout, > you just throw > <cfset attributes.SuppressParentLayout = TRUE> > in the fbx_layouts file for that circuit > > If the Parent circuit is not your top-most circuit, then you have to write a > slightly more general solution. This is where #fusebox.thiscircuit# will > come in handy for those cases where you have to apply some additional > layout, but only when certain circuits are involved. If you do it as above, > then you'll have to have variables for any and all circuits that you'll need > to tweak--that will be cumbersome. But if you use only a reference to > #fusebox.circuit# then the layout for the parent will only get turned off > when THAT circuit is the target circuit -- what about if you later on add > some additional sub-circuits? Then what you want is that any time you *pass > through* these special circuits, you want to have different parent circuit > layout occur -- this is where #fusebox.thiscircuit# will come in handy, > since it "knows" in which circuit it is in on the way through the Settings > files, down to the Switch file, and up the Layouts files. > > By the way, do you already know why the <cfset > attributes.SuppressParentLayout = TRUE> mentioned has to be in the > fbx_layouts file rather than the fbx_settings file? If so then you > *definitely* understand layouts better than you think, and just happened to > get yourself into a funk on this little problem. So don't sweat it. > > > > > If I get it so that the circuit layout is applied in the child > > circuit correctly, the parent layout is not applied when I switch > > back to the parent. The home/fbx_layouts file is skipped > > completely! > > > > yes, that is what will occur if you alternately turn off and on the > suppresion of layout *generally*. For what you've described you want to > conditionally affect only one particular circuit's layout decision process. > > you'd also asked what to do so that *sometimes* a fuseaction should in fact > not suppress the Parent's layout but other times it should. First question > would be, what happens *most* of the time? If most of the time you want to > suppress the parent layout but then in a few fuseactions you want to not > suppress it, then I'd set it to suppress generally as outlined and then > write a few CFIFs (or even a CFSWITCH if need be) to set it to not suppress > in those cases. If most of the time you want to not suppress the parent > layout but in a few fuseaction you do want it suppressed, then just reverse > the logic. If it's 50-50 I'd do two things: (1) leave it et to not suppress > since your other circuits don't seem to suppress the parent layout, and (2) > more importantly take a good hard look at your app. When you start doing a > lot of conditional code for a layout, it is often a good indication that > that particular layout is too "high" up in the app's tree and should be > moved "down" the tree until it gets to a circuit where it's easier to > handle. > ==^================================================================ This email was sent to: [email protected] EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9 Or send an email to: [EMAIL PROTECTED] T O P I C A -- Register now to manage your mail! http://www.topica.com/partner/tag02/register ==^================================================================
