Flowgroups

Note: Only use Flowgroups if you're moving template objects both horizontally and vertically, otherwise using Relative To fields will suffice. While the Flowgroup would still do the job, it would be unnecessarily overcomplicating the template.

On the Relative Positioning page, you were shown how gaps between text objects can close automatically when the customer deletes a field's contents. In this case, the text objects were positioned relative to each other. This is fine for some scenarios, however, sometimes a finer degree of control is required. When using a flowgroup of placeholders, it is the placeholders that are positioned; not the text objects. When the text objects are assigned to the flowgroup they automatically populate the placeholders.

With ePrintcost's Flowgroup feature you can set up a number of placeholders so text objects automatically relocate themselves (flow) from one placeholder to another. The placeholders can be positioned anywhere on the document.

Only use a flow group when you need to control where text objects are to be relocated on the page.

Note: Flowgroups is an advanced ePrintcost feature that is designed for a specific purpose. Please only use flowgroups for the purpose described on this page. If you want to simply close a gap when the customer leaves a field empty, try Relative Positioning. In particular, have a look at "What You Need to Know to Make Relative Positioning Work".

Group of Text Objects Centred on CardWhen the customer leaves some of the contact details in a child document out, the remaining text objects automatically relocate themselves (flow) from one placeholder (fixed location) to another.

On this page:


Table of Contents:


What is a Flowgroup

Introduction

A flowgroup is a set of placeholders that text objects can be assigned to. The flowgroup determines where these text objects are displayed within the document.

Example

The following picture shows a child document with the contact details (eight text objects) laid out using flowgroup placeholders. The placeholders are never visible. Only the contact details that have been entered in the fields to the left will be displayed on the document. In this example, the location of the Fullname field is not determined by the flowgroup, and is therefore not part of the flowgroup.

Five Fields Populated by CustomerFive Fields Populated by Customer

The following picture shows eight coloured regions. The regions are where we expect the:

PlaceholdersText Regions - Where we expect the contact details to be displayed in a child document.

Technically, these regions are not the placeholders because they do not exist. The placeholder is actually a single point in space that you specify when laying out a flowgroup. When specifying this point:

Any one of nine points (relative to the anticipated text object) can be chosen.

Placeholder PointsA Single Placeholder Region and Available Points

In the example below, I chose the left-baseline point of each region, which means the text will always be to the right of this point and positioned vertically at the baseline.

Placeholder PointsPlaceholder Points

If, for example below, you choose the left-baseline point of the region (that will be filled by a text object), then when you set the co-ordinates for the placeholder, you will be setting the coordinates of this point.

Placeholder PointsPlaceholder Point Coordinates

If you change the co-ordinates of this point (see below), the placeholder shifts to a new location.

Placeholder PointsPlaceholder Point - Change in Coordinates

The advantage of using flowgroups is that you can position your placeholders anywhere, and the text fields in the child document will fill the placeholders accordingly. That is, the text objects will appear to flow from one placeholder to another depending on how many are used by the customer.

Placeholder PointsPlaceholder Points Placed on a Curve


What your Customer Sees

Once you have set up a flowgroup, you can assign a set of text objects to it. For example, in the child document below, there are nine text objects: four of the text objects are labels (P:, M:, F: and D:) and five are customer editable text objects that contain the person's name and contact numbers. To the left, the five editible text objects have been populated. To the right they are all displayed. The contact details are displayed in the order that was set up in the template and displayed at the coordinates set up within the flowgroup.

With the exception of the Fullname field, the remaining text objects (contact labels and fields) are all assigned to the same flowgroup. The first placeholder (filled with the characters 'P:' ), is set relative to a point on the Fullname text object. If the Fullname text object is moved within the template, the contact labels and fields will move relative to the Fullname field.

Five Fields Populated by CustomerFive Fields Populated by Customer

When the customer deletes the mobile number and clicks 'Update & Save Preview', both the label 'M:' and the cell phone number disappear and the fax label and fax number text objects automatically fill the third and fourth placeholders respectively. The direct dial text objects automatically fill the fifth and sixth placeholders.

One Empty FieldOne Empty Field

When the customer deletes the fax number and clicks 'Update & Save Preview', both the label 'F:' and the fax number disappear and the direct dial number automatically fills the third and fourth placeholders.

Two Empty FieldsTwo Empty Fields

Reordering Text Objects

The picture below shows the Edit Template Page with nine text objects that have been set up. They are:

With the exception of the Fullname field, all the other text objects are assigned to the one flowgroup.

Edit Template PageEdit Template Page

The order in which the objects are listed in the rendered page (above right) is determined by the order in which they are listed under Text Objects (above left). If you rearrange the order of text objects, for example, if you move the mobile label and mobile number up to the top of the list on the left (below left), the mobile label and number moves to the top of the list on the rendered page (below right).

Note: In this example, the mobile label and mobile number have been moved up the list by clicking the objects' up arrow.

Note: The letter U indicates that the text object is unlocked, that is the textbox can be edited by the customer.

Edit Template PageEdit Template Page

And, this is what the customer sees. The fields are re-ordered, and the mobile label and mobile field are now the first set of contact details to be displayed.

Fields RearrangedFields Rearranged


What You Need to Know to Make a Flowgroup Work

Setting up a flowgroup, involves setting up flowgroup placeholders. A text object that is assigned to the flowgroup will have its location determined by one of the flowgroup placeholders. A placeholder's point can be set relative to:

Example 1: Contact Labels and Contact Numbers Are Vertically Aligned

Flowgroup Setup

The following table shows the flowgroup setup for eight placeholders. These placeholders will be used for a set of contact details. The aim in this example is to ensure vertical alignment of the contact numbers, irrespective of a contact labels' widths.

????????A Flowgroup Set Up for vertical alignment of contact labels and contact numbers.

How to Interpret the Flowgroup Table

The Intersection of Horizontal Align (Left) & Vertical Align (Baseline)The Intersection of Horizontal Align (Left) & Vertical Align (Baseline)

A row in the table above has been highlighted pink to show you what each item means.

Placeholder Points

Placeholder PointsPlaceholder Points

With Printcost, you can choose from the following points of a placeholder or text object.

Ensure there are no spaces (e.g., between the comma and the word that follows) when entering the placeholder name.

Note: The top of the placeholder will be determined by the amount of linespacing specified in the text object that fills the placeholder. If there is no linespacing, the top will be the top of the typeface's ascenders. The bottom will always be the bottom of the typeface's descenders.

Bringing It All Together

In the example (above and below):

Note: With the above setup, a fixed distance (z) separates each contact label from its adjacent contact number. This ensures that the contact numbers have vertically aligned left edges.

Note: The width of the placeholder is not specified. Only the position of each placeholder is specified

Note: The placeholders are the points. The coloured regions indicate what will happen when text objects are assigned to the placeholders.

The following diagram is indicative of the above flowgroup setup.

????????Flowgroup with Four Contact Details

Note: The line spacing is added to the text objects; not the flowgroup's placeholders. In this example, the line spacing is only added to the labels and not the fields, because each field is always accopmpanied by a text label. You can add the line spacing to every text object if you want to.

When the customer leaves one of the contact details empty, the following diagram illustrates how the fixed distances are maintained.

????????Flowgroup with Three Contact Details

Example 2: Only Contact Labels Are Vertically Aligned

Fixed Width Between Contact Labels and Contact Numbers

The following table shows a 1 mm distance between the right of each contact label and the left of the corresponding contact numbers.

Fixed Width Between Contact Labels and Contact NumbersFixed Width Between Contact Labels and Contact Numbers

The following picture shows the left edges of the contact label placeholders vertically aligned. There is a 1 mm gap (distance z) specified between the right side of the contact label placeholders and the left side of the corresponding contact number placeholders. This means that the contact numbers may not be vertically aligned, but will always be offset distance (z) from the right of the contact labels.

Only Contact Labels are Vertically AlignedContact Labels Left Edges Always Vertically Aligned

When the customer leaves one of the contact details empty, the following diagram illustrates how the fixed distance (z) is maintained.

Distance 'z' is MaintainedDistance 'z' is Maintained

Note: Point K collapses onto Point J because there is no text object to give it any width.


Tutorial: Creating a Flowgroup

In this tutorial, we will start with a variation of the business card that was created on the Basic Templates page. Firstly, we will set up two text objects; one for the cardholder name and one for the address. The assumption is that for this business, there is only one address and it does not need to be edited by the customer. Also, because it's position is not going to change, it does not have to be part of the flowgroup.

Rendered PageRendered Page

To this business card, we will add a flowgroup made up of six placeholders. These placeholders will be used to position the following text objects:

The contact detail text objects won't be linked to the flowgroup until after the flowgroup placeholders have been set up.

Before you begin

Before creating a flowgroup, ensure that:

Direction of Flow

In the picture below, when the customer leaves the Fax number field empty, the Mobile contact details will relocate themselves to placeholders 5 and 6 respectively. If the DDI number field is also left empty, the Mobile contact details will relocate themselves to placeholders 3 and 4 respectively.

The Flowgroup Direction for this TutorialThe Flowgroup Direction for this Tutorial

This does highlight a problem that needs to be resolved. That is, if there are only two contact details, they will fill placeholders 1 to 4, and this will create an undesirable gap between the contact details and the address (below-left).

With some relative positioning applied within the flowgroup, we can close the gap automatically (bottom-right).

The Flowgroup Direction for this TutorialGap (Left), Gap Closed (Right)

Before creating the flowgroup, we will also set up the following text objects:

Cardholder Text Object

Set up the Cardholder text object using the information below.

Cardholder Text ObjectCardholder Text Object

Rendered PageRendered Page Showing Repositioned Cardholder Text Object

Cardholder Alignment and Positioning ValuesCardholder Text Object - Alignment and Positioning Values



Address Text Object

Using the information below, set up the Address text object relative to the Cardholder text object.

Note: In this example I have set the left-bottom point of the Address text object relative to the left-bottom point of the Cardholder text object.

Rendered PageRendered Page Address Text Object Set Relative to the Cardholder Address Object

Cardholder Alignment and Positioning ValuesCardholder Text Object - Alignment and Positioning Values

To add the first flowgroup placeholder:

Follow these steps to add the first flowgroup placeholder.

Settings for First PlaceholderEdit Template Page

  1. At the bottom of the Edit Template page, click 'Edit Flowgroups'.
    • Result: Two links are displayed. They are called 'New' and 'Return to edit template...'
  2. Click New.
    • Result: A list of fields is displayed.
    • Note: These fields determine the position of the first flowgroup item.
  3. Complete the following fields using the information to the right.
    • PageID: The actual Page ID is displayed at the bottom of the list. In this example, it's 2179, but on your screen it will be a different number. Enter the Page ID number from your screen into the PageID field.
    • Name: In the Name field, type the flowgroup name. The name can be whatever you want; but only use alpha characters; do not use numerals. For this tutorial, type 'Contact'.
    • Sort Order: Ensure that this number is unique. For the first flowgroup placeholder, type '1'. You can change the sort order at any time.
    • Horizontal Align: In this example, the left edge of the text that will fill this placeholder will be aligned with the left edge of the Address text object. Type 'Left'
    • Horizontal Position (mm): We do not want the text object that fills this placeholder to be offset from the left edge, so the horizontal position from the left edge is zero. Type '0'
    • Vertical Align: The bottom of the text object that fills this placeholder will be offset from the top of the Address text object. Type 'Bottom'.
    • Vertical Position: In this example, the left-bottom of this placeholder will be offset 5.7 mm from the top of the Address text object. Type '5.7'.
    • Relative: Select (tick) this option.
    • Link to Object: This is the text object that the placeholder's position is being offset from. Type Address.
    • Link at Position: Because we are offsetting the left-bottom of the placeholder from the left-top of the Address text object, type 'Left,Top'. Ensure there is no space between the comma and the words.
  4. Click Insert.
    • Result: The flowgroup item is displayed in table format.

Flowgroup Placeholder SettingsFlowgroup Placeholder Settings

Complete the Flowgroup

Using the information below, set up the remaining placeholders for this flowgroup.

Note: Ensure the PageID you enter matches what is displayed on your screen; not what is displayed below.

Flowgroup Placeholder SettingsFlowgroup Placeholder Settings

Whats Next?

Now that the flowgroup has been set up, it's time to add the text objects that will fill the flowgroup's placeholders.

Add Text Labels & Text Fields

It's time to add the text fields that will fill the flowgroup placeholders.

With the Phone Label seat up, using the information from the tables below, add the remaining text objects:

Note: With regard to all the other field values and controls, we will leave them as they are for this tutorial.

Text Object DataText Object Data

Your list of text objects and their layout should look like this:

Text Fields AddedText Fields Added

What's Next?

Test the template by creating a child document. When the user creates a document from this template and leaves a phone, mobile or fax number field empty, the corresponding label will be hidden, and any gaps will be closed up automatically.

Card for SantaA User-Editable Child Document

Card for RudolphA User-Editable Child Document; No Fax

Card for Mrs ClausA User-Editable Child Document; No Fax, No DDI

What's Next?

The last thing to do is apply a few changes to the flowgroup so that when there are only one or two contact details, these contact details migrate to placeholders 5, 6, 7 & 8, respectively thereby eliminating the undesirable gap between the contact details and the address.

Edit the flowgroup and make the changes that are highlighted pink below.

Flowgroup Placeholder SettingsFlowgroup Placeholder Settings

Note: The left-bottom point of placeholder 5 (Contact5) will be offset 2 mm vertically from the left-top of the address. The left-bottom point of placeholder 1 (Contact1) will be positioned relative to the top-left point of placeholder 5. When there are only two fields populated by the customer, these two fields and their labels will automatically migrate:

What's Next?

Test the template by creating a child document. When the user creates a document from this template and leaves a phone, mobile or fax number field empty, the corresponding label will be hidden, and any gaps will be closed up automatically.

Card for SantaA User-Editable Child Document

Card for RudolphA User-Editable Child Document; No Fax

Card for Mrs ClausA User-Editable Child Document; No Fax, No DDI, and No Gap