Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old September 4th, 2020, 07:19 AM
sschardan sschardan is offline
Regular Contributor
 
Join Date: Oct 2008
Location: St. Louis, MO
Posts: 100
Default Another way to read page number?

For many years we have used a different software for personalized images. That software creates the images and creates an appended data list, such that the name of each unique image is in a new field named "Field1", "Field2", "Field3", etc. I bring that appended data into a simple template that I use to keep an updated contact sheet. Each page consists of 8 picture and text frames using the rules below:

Text frame rule called label1:

HTML Code:
return (((FusionPro.Composition.currentPageNumber-1) * 8) + 1)
Graphic frame rule called graphic1:

HTML Code:
var pic = CreateResource(".//images//" + Field("Field" + Rule("label1")), "graphic", true)

return pic
Theses rules are duplicated 7 more times and customized for each position.

This works great. As I get more images, I duplicate as many pages as necessary, and it keeps bringing in the appropriate images and labels. Right now, I am up to 134 images.

Now we are using FP Expression. So I thought I could continue with a similar style by using this rule:

HTML Code:
var ResourceName = Rule("label1"); 
var Field1 = "First"; 

var myPI = Resource(ResourceName);
myPI.AddData(UntaggedRuleOrField(Field1) || " ");


return myPI;
and then name my FP Expression resources beginning at 135 to pick up where the other images ended.

This is not working, because the call to create the Expression images happens before composition, so it is not bringing the composition page number into the label rule calculation, thus resulting in not being able to find resource 0, resource -1, resource -2, etc.

Is there an alternative way to read the template body page number so it can be calculated up front?

Thanks
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:03 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.