Jump to content

Flowing text with Multiple front/back options


jl_arnold

Recommended Posts

I have a simple two page newsletter, front and back.

 

Users will choose one of three design options for the front, and one of three options from the back.

 

Text flows from the main area on the front to the main text area on the back.

 

 

I'm at the point where I am setting up the text flow.

 

On page 1, the text frame is named "MainArticleBodyCopy".

The text frames on back are "BackBodyCopy", "BackBodyCopy2" and "BackBodyCopy3".

 

I am trying to figure out how to setup the flow so that a user selects Front-1 and Back-2 (BackBodyCopy2), that these text boxes are linked.

 

 

The problem I am having is that I can only link one frame to one frame. So after I setup "MainArticleBodyCopy" to "BackBodyCopy2", it loses the link to "BackBodyCopy"

 

 

The only way I can think to accomplish what I need would be to copy the MainArticleBodyCopy frame three times, and rename it. Then link one frame to the BackBodyCopy, another frame to BackBodyCopy2 and the Third layered frame to BackBodyCopy3. Then I would repeat this on Front-2. If I do this, I would have 3 MainArticleBodyCopy on pages 1-3 and 9 BackBodyCopy frames on each of the back three pages.

 

 

Is there another (or better) way to do this? I have attached my collected zip file.

 

Thanks!

CCHMC Newsletter_BluePurple_FINAL.zip

Link to comment
Share on other sites

I am trying to figure out how to setup the flow so that a user selects Front-1 and Back-2 (BackBodyCopy2), that these text boxes are linked.

 

The problem I am having is that I can only link one frame to one frame. So after I setup "MainArticleBodyCopy" to "BackBodyCopy2", it loses the link to "BackBodyCopy"

Yes, you can link a text frame to only one other text frame.

 

Are there really nine different possible combinations?

  • Front 1, Back 1
  • Front 1, Back 2
  • Front 1, Back 3
  • Front 2, Back 1
  • Front 2, Back 2
  • Front 2, Back 3
  • Front 3, Back 1
  • Front 3, Back 2
  • Front 3, Back 3

The only way I can think to accomplish what I need would be to copy the MainArticleBodyCopy frame three times, and rename it. Then link one frame to the BackBodyCopy, another frame to BackBodyCopy2 and the Third layered frame to BackBodyCopy3. Then I would repeat this on Front-2. If I do this, I would have 3 MainArticleBodyCopy on pages 1-3 and 9 BackBodyCopy frames on each of the back three pages.

 

Is there another (or better) way to do this?

Yes. One way would be to have three different copies of each of the "MainArticleBodyCopy" frames on each of the three "front" pages, and three copies of each of the each "BackBodyCopy" frames on each of the three "back" pages, each of which is connected in a set. So on page "Front-1", you would have these frames, connected to back page frames like so:

  • "MainArticleBodyCopy1-Back1" -> "BackBodyCopy1-1"
  • "MainArticleBodyCopy1-Back2" -> "BackBodyCopy1-2"
  • "MainArticleBodyCopy1-Back3" -> "BackBodyCopy1-3"

And on page "Front-2", you would have:

  • "MainArticleBodyCopy2-Back1" -> "BackBodyCopy2-1"
  • "MainArticleBodyCopy2-Back2" -> "BackBodyCopy2-2"
  • "MainArticleBodyCopy2-Back3" -> "BackBodyCopy2-3"

And on page "Front-3":

  • "MainArticleBodyCopy3-Back1" -> "BackBodyCopy3-1"
  • "MainArticleBodyCopy3-Back2" -> "BackBodyCopy3-2"
  • "MainArticleBodyCopy3-Back3" -> "BackBodyCopy3-3"

Then, assuming that the data fields have values like "Front-1" etc., you need to do this in OnRecordStart:

var frontNum = Field("Front Design").slice(-1);
var backNum = Field("Back Design").slice(-1);
for (var f = 1; f <= 2; f++)
{
   for (var b = 1; b <= 2; b++)
   {
       var enable = (f == frontNum && b == backNum);
       FindTextFrame("MainArticleBodyCopy" + f + "-Back" + b).suppress = !enable;
       FindTextFrame("BackBodyCopy" + f + "-" + b).suppress = !enable;
   }
}

There are other possibilities, depending on how much the layouts of all of the pages vary. If you are composing with FusionPro VDP Producer or Server, or via a web-to-print app utilizing FP Server (such as MarcomCentral), then you could theoretically only have one front and one back page, and change the positions of the frames on each page with JavaScript.

 

By the way, I see that you finally took my advice about the "single line" frames and gave up trying to copyfit them.

 

Also, if you set all of your pages to be unused, then your entire OnRecordStart rule (other than the code I suggest above) can be reduced to this:

FusionPro.Composition.SetBodyPageUsage(Field("Front Design"), true);
FusionPro.Composition.SetBodyPageUsage(Field("Back Design"), true);

Except for these last six lines, which do absolutely nothing, since FusionPro.Composition.CurrentFlow is not set at that time that OnRecordStart is called:

if (FusionPro.Composition.CurrentFlow.name == "MiscNewsletterInfo")
{
FindTextFrame("MiscNewsletterInfo").textWrap = false;
}
if (FusionPro.Composition.CurrentFlow.name == "MiscNewsletterInfo2")
{
FindTextFrame("MiscNewsletterInfo2").textWrap = false;
}

The right way to do that would be just:

FindTextFrame("MiscNewsletterInfo").textWrap = false;
FindTextFrame("MiscNewsletterInfo2").textWrap = false;

Although you don't even need to do that, since text wrap is already turned off for those frames (in the Text Frame Properties palette).

 

Finally, many of your rules seem to define exactly the same "replaceFunction" function. It's not clear to me what this function does, but but you could paste it just once into the JavaScript Globals and remove all the other copies from the other rules.

Link to comment
Share on other sites

Finally, many of your rules seem to define exactly the same "replaceFunction" function. It's not clear to me what this function does, but but you could paste it just once into the JavaScript Globals and remove all the other copies from the other rules.

 

That's great to know! I had tried to figure out a way to apply this to all fields easily but was not able to get it to work properly. This rule converts single and double quotes to typographer quotes and is used for all fields (even number only fields... per client request).

 

 

 

Except for these last six lines, which do absolutely nothing, since FusionPro.Composition.CurrentFlow is not set at that time that OnRecordStart is called:

Code:

if (FusionPro.Composition.CurrentFlow.name == "MiscNewsletterInfo") { FindTextFrame("MiscNewsletterInfo").textWrap = false; } if (FusionPro.Composition.CurrentFlow.name == "MiscNewsletterInfo2") { FindTextFrame("MiscNewsletterInfo2").textWrap = false; }

The right way to do that would be just:

Code:

FindTextFrame("MiscNewsletterInfo").textWrap = false; FindTextFrame("MiscNewsletterInfo2").textWrap = false;

Although you don't even need to do that, since text wrap is already turned off for those frames (in the Text Frame Properties palette).

 

 

The last nine rules in OnRecordStart was meant to suppress the unused frames, the same with the code you have provided. The Text Wrap is trying to set textwrapping for the linked frames. The back option #3 (page 6) has an photo and a text frame. I was trying to get the text to wrap around the photo and text so that copyfitting will work appropriately, instead of just moving the photo and text to the front layer.

 

Is it possible to set textWrap to true for linked frames?

 

 

I'm also not having much success with the suppression rule you provided. I feel like I only need a portion of the code since linking the frames converts the BackBodyCopy frames to MainArticleBodyCopy1-3.

 

       FindTextFrame("MainArticleBodyCopy" + f + "-" + b).suppress = !enable;

 

and delete:

FindTextFrame("BackBodyCopy" + f + "-" + b).suppress = !enable;

 

I can tell that text is not suppressed because the output files contains darker text on the front page, due to the multiple layers on the first page. But I'm not sure why it's not working. Any suggestions?

 

Thanks!

Jason

Link to comment
Share on other sites

The last nine rules in OnRecordStart was meant to suppress the unused frames, the same with the code you have provided. The Text Wrap is trying to set textwrapping for the linked frames. The back option #3 (page 6) has an photo and a text frame. I was trying to get the text to wrap around the photo and text so that copyfitting will work appropriately, instead of just moving the photo and text to the front layer.

I don't understand. The frames you want to wrap around are already on the top layer. All you need to do is select each frame, and for each, click the Text Wrap button, right in the middle of the Frame Properties palette. You don't need any JavaScript.

Is it possible to set textWrap to true for linked frames?

Yes, as I describe just above.

I'm also not having much success with the suppression rule you provided. I feel like I only need a portion of the code since linking the frames converts the BackBodyCopy frames to MainArticleBodyCopy1-3.

Sorry, but again, I don't understand what you're saying. How does linking the frames "convert" anything?

I can tell that text is not suppressed because the output files contains darker text on the front page, due to the multiple layers on the first page. But I'm not sure why it's not working. Any suggestions?

I don't understand how you can tell whether a frame is suppressed by how dark some text is. I would try putting a border or fill on the frame so that it's easier to tell when it's suppressed.

Link to comment
Share on other sites

Re: Flowing text with Multiple front/back options

Quote:

Originally Posted by jl_arnold http://forums.pti.com/images/buttons/viewpost.gif

The last nine rules in OnRecordStart was meant to suppress the unused frames, the same with the code you have provided. The Text Wrap is trying to set textwrapping for the linked frames. The back option #3 (page 6) has an photo and a text frame. I was trying to get the text to wrap around the photo and text so that copyfitting will work appropriately, instead of just moving the photo and text to the front layer.

 

I don't understand. The frames you want to wrap around are already on the top layer. All you need to do is select each frame, and for each, click the Text Wrap button, right in the middle of the Frame Properties palette. You don't need any JavaScript.

 

 

For some reason, when I link the frames, it turns the textwrap button off.

 

 

 

As for the text, it's at 80% black, so when I download the press proof, I select the text and delete it, but it's still there. So I select it and delete it again, and it's still there. Finally after the text appears 80% black onscreen (which it may only be an onscreen issue), and if I delete this text, the all MainArticleBodyCopy on the first page gets deleted.

 

So suppression isn't working because of the three layers of text on the first page.

 

So I'm not sure what to fix.

 

var frontNum = Field("Front Design").slice(-1, -1);
var backNum = Field("Back Design").slice(-1, -1);
for (var f = 1; f <= 2; f++)
{
   for (var b = 1; b <= 2; b++)
   {
       var enable = (f == frontNum && b == backNum);
       FindTextFrame("MainArticleBodyCopy" + f + "-" + b).suppress = !enable;
   }
}

 

I modified the code about as all pages are named Front-1, Front-2, Front-3, Back-1, Back-2, Back-3 and all frames are named MainArticleBodyCopy1-1 and all nine combinations through MainArticleBodyCopy3-3.

 

Thanks!

Link to comment
Share on other sites

For some reason, when I link the frames, it turns the textwrap button off.

There may be a bug where that button shows that text wrap is off even when it's on. Previewing the output should show you whether it's working or not.

 

At any rate, there's nothing preventing you from placing an extra empty text or graphic frame on the page and setting its text wrap. The Frodo Travel tutorial shows an example of this.

As for the text, it's at 80% black, so when I download the press proof, I select the text and delete it, but it's still there. So I select it and delete it again, and it's still there. Finally after the text appears 80% black onscreen (which it may only be an onscreen issue), and if I delete this text, the all MainArticleBodyCopy on the first page gets deleted.

 

So suppression isn't working because of the three layers of text on the first page.

Perhaps it's working in some of the layers but you're still seeing text from the other layers? Again, try setting a different color fill on each frame, and even moving them to different positions, to see which ones actually are showing up and which are being suppressed. Once you get the suppression logic right, you can remove all the fills and put everything back.

So I'm not sure what to fix.

I'm not sure either, without seeing the updated template files.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...