Jump to content

obscure variable data program uses js- need help for placing image & defining positioning


smartin

Recommended Posts

Hello all,
Context:
I work at a small print shop; I'm in charge of my company's online storefronts where customers can order printed goods. We use EFI Digital StoreFront and just got a new extension/program/plugin called Directsmile that lets us offer products with variable data and mailing lists.
The program works with InDesign; I build the art file in InDesign and Directsmile links to InDesign to add variable data fields to InDesign's text fields and image frames.
When multiple data fields are used together, their rules need to be defined so if one field is not used, the others will move up to fill in the gap. Extra characters like divider characters and phone number labels (eg. "fax 123.456.7890") are also defined in the rules, so they only appear when the associated field is in use. I define those rules using Directsmile. I can choose to either use the built in tool to define the boolean properties of the variable data fields, or for more complicated formatting, I can use javascript. See below for an example of how phone numbers are formatted on a business card:
post-189830-0-67903800-1443212370_thumb.jpg
post-189830-0-40080400-1443212371_thumb.jpg
The Problem:
The people who designed Directsmile figured that if somebody wanted to use variable data for an image, it was going to be fixed in one place, and wouldn't be positioned in relation to the other fields. Directsmile supports variable data images placed in fixed positions on the page, and it supports very flexible variable data text with positioning relative to other variables in the same text box, but it does not support image frames inserted into text boxes. When I try it, the image frame vanishes.
Because of this, there is a problem with variable images inserted between sections of variable text:
post-189830-0-95690900-1443212371_thumb.jpg
The customer can choose to fill in any of the fields, or none, so the positioning of every element varies with each data merge record. I can't put the image inside the text box; they have to remain as independent elements. But as independent elements, they will not be placed properly on the page; the image will remain entirely static, and text that runs too short will leave a gap where text that runs long will run over/behind the image. Also, if the customer chooses not to use the image field, the second section of text will be orphaned down the page instead of moving up to fill in where the image would have been.
The Solution?
The only potential workaround I can think of would be to use js on a text box (like the "numbers" field in the business card example) to define:
-placement of text and image
-if there is an image, then insert appropriately sized space between sections of variable text
-if there is text above the image, the image is moved down the page one line height for every line of text above
Except, I don't know how to use javascript to place an image, or how to position it according to how many lines of text are preceding. I don't even know if that's possible. If I could be pointed in the right direction, I would be so grateful.
I'm a print designer, not a programmer; I consider myself proficient at HTML and CSS but javascript is like trying to read a foreign language- I can pick up on the gist of things, but I have a LOT of difficulty writing it and knowing exactly what each bit does. I am learning, but commerce waits for no man and I will likely need a solution before I can come up with one independently so I'm trying to head this off. I've already talked to product support for help, and they didn't know of a way to achieve this, though they couldn't think of anybody who'd ever tried it, either, so I would really appreciate any help or tips you could give me. I'm sorry I don't have any script to show for this particular project, but I don't even know where to begin! Please bear with me in my ignorance. I know this is a really weird application of javascript and it doesn't help things any.
Thank you all for reading that wall of text, and for any assistance!
Link to comment
Share on other sites

Directsmile exports the product as a .zip file. In the .zip are the Directsmile file, the InDesign file, and a few others. I can check what exactly those other files are on Monday, but I'm fairly certain none of them are web pages or javascript files or anything.

 

The .zip is uploaded to the Digital Storefront when I create a new variable data product. On the product page I can choose to add additional restrictions to the data fields (regex, how many lines, drop down menu instead of text field, etc). Then I can publish the product to the Storefront.

 

Here's an example storefront EFI made. The products in the Variable Data Product category were made with Directsmile; this is what the customer sees when a product is published. (bbcode not working for some reason) formulaoneprint.myprintdesk.net/DSF/SmartStore.aspx

 

At no point in the process do I touch any code except for whatever javascript I put into Directsmile.

 

EDIT: Here are the contents of a .zip file:

 

Business Cards.DSM (folder)

DSM Fonts (folder of fonts)

DSMPDFs (folder of pdfs to use as proofs and previews)

DSMTexts (folder)

Txt360.DSMT

Txt360V.DSMT

Txt367.DSMT

Txt367V.DSMT

Txt391.DSMT

Txt391V.DSMT

Txt468.DSMT

Txt468V.DSMT

Business Cards.dsmi

Business Cards.DSMM

DataInterface.xml

DirectSmileTemplate.xml

Thumbnail.jpg

Thumbnail_001.jpg

Thumbnail_002.jpg

Business_Cards.dmdb

Business Cards.indd

contents.xml

DirectSmileTemplate.xml

Edited by smartin
Link to comment
Share on other sites

Most of the time Javascript is used for interacting with a web browser on a web page, I'm not sure if that's the case here. If that's so, then it's hard to suggest what you might need to change to do what you need, you might have more luck on a forum dedicated to the programs you're using.

Link to comment
Share on other sites

Yeah, it's tough- seems like there aren't many customers for this product yet. They aren't even completely done translating it from German. The EFI Digital Storefront forum has maybe three active users with Directsmile, and the DirectSmile forum similarly has a very small EFI DSF presence and most posts are bug reports. I'll try crossposting though! Maybe I'll luck out.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...