rjay23 Posted June 17, 2019 Share Posted June 17, 2019 Is it possible to make rule that would switch composition to different text frames depending on certain conditions? I have a letter with a variably sized list in it. If the list in the letter will contain five or less items, it needs to be in a single column. If it contains more than five items, it needs to be in a three column frame. I thought I can draw two frames on top of each other, making one of them 3 columns and give the frames different names. But I don't know how to proceed from there. I need to make a rule to switch to the 3 column frame if the letter will contain more than 5 list items if that's possible. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 18, 2019 Share Posted June 18, 2019 You're on the right track with the two named overlapping frames. I don't know exactly what's in your data that controls whether "the list in the letter will contain five or less items," but you can put the same content into both frames and do something like this in OnRecordStart: var frameToSuppress = (numListItems > 5) ? "OneColumn" : "ThreeColumn"; FindTextFrame(frameToSuppress).suppress = true; Quote Link to comment Share on other sites More sharing options...
rjay23 Posted June 18, 2019 Author Share Posted June 18, 2019 Thank you Dan. This looks like what I need. Quote Link to comment Share on other sites More sharing options...
DSweet Posted June 19, 2019 Share Posted June 19, 2019 Dan, this is not for any project currently going ... just my mind wandering a bit with the proposed solution. Is there a way to have an OVERFLOW into one frame or another based on the condition such as above? i.e. Three frames where "BaseStory" is the original frame and the frame "OneColumn" is where the overflow would occur based on the condition of 5 or less items and "ThreeColumn" if over 5 items? Just wondering? . Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 19, 2019 Share Posted June 19, 2019 Is there a way to have an OVERFLOW into one frame or another based on the condition such as above? i.e. Three frames where "BaseStory" is the original frame and the frame "OneColumn" is where the overflow would occur based on the condition of 5 or less items and "ThreeColumn" if over 5 items? Any Body page text frame (flow) can have its own Overflow conditions, including flowing to new Overflow pages. If that primary Body page text flow is suppressed, then all Overflow pages which may have been generated for that text flow will be suppressed as well. So the answer to your question is Yes. Set up two different text frames, with different Overflows, and conditionally suppress one of them. The code will be similar to what I posted above. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.