Prerequisites
The Pagination module is required to access container functionality.
Sample Data
A sample workspace and document is provided for reference and relates to the example described below. Import the data source using File->New->EasyCatalog Panel->Import Data Source. This contains sample images and should open wit the required grouping (Category 1 > Category 2 > Category 3).
What are Containers?
Containers are designed to solve complex layout issues. Below is a typical use case. In this example, the page is filled with tables and images along with indicators of related product information. Only what fits makes it onto the page, which then continues to another page, numbering starting over.
Overview of Containers
A container is custom frame type, with properties describing how it gets populated . The primary property is Populate With, which defines which Formatting Rule is used to fill it. When populating, the rule is repeated until the container is full. Containers can then be ‘threaded’ to other containers, so content flows from one to another. If the Auto Recomposition menu option is enabled, the content will automatically reflow when the container is resized. Containers are shown with a dotted outline when not in preview mode.
Using the sample above, here are 2 threaded containers, set to populate with the “image” formatting rule. Dragging data to the first container will fill it and thread any overset content into the next. When a container is ‘overset’ red plus indicator will be shown, similar to a text frame. With the frame selected, this can be clicked and the threaded to another frame.
Container Panel
The Windows->EasyCatalog Container panel is used to apply and view properties of the selected container or containers. Change made are applied dynamically if the Auto Recomposition flag is enabled.
Arrange and Align
In the example, the Arrange property is set to fill across – down, meaning the second item will be placed to the right of the first, then continue to the next row if it doesn’t fit. The Align option defines the final alignment of the arranged items. In this case left aligned. Alignment options vary depending on if the container is set to populate across – down or down – across.
Spacing
Defines the vertical and horizontal spacing between the items.
Fitting
Fitting options specify the maximum and minimum width and heights of the container. This is useful when containers are embedded.
Threadable
The default option is on, which allows overset content to thread into another container
Tash Icon
Pressing this will empty the container and release the data associated with it.
Update Icon
Refreshes the container content
Release Icon
Releases the container content, which deletes the actual container frame.
Creating A Container
You can create containers by selecting the Container Tool in the Tools panel. Then press and drag to create an area where the container will go.
Combining Containers
The example uses a formatting rule that combines 2 containers, one for the images and one for the tables. The image container has an edge relationship with the table container, so when it resizes, the table is move down to maintain the space defined. Both containers have Fitting options applied that limit the depth they can extend to
When this rule is populated, each container acts independently, according to it properties. so the image container may contain more or less data than the table container.
Nesting Containers
Perhaps the most powerful feature of containers is the ability to nest them. When a container contains other containers, a ‘relationship’ is created that limits the content of each container to be the same. Now we create a container that contains the “image+table” formatting rule:
When this container is filled, both the image and table content remains the same. It’s important that that image+group formatting rule is set to paginate the level above image and table, so these can fill with the desired content. In order to determine what content fits, a trial and error technique, is used, so this takes longer than non nested population.
Now when populating outermost container, only consistent content it placed, and the outer container becomes the ‘thread’, allowing it to flow in another container. Here are 2 threaded containers with only the content that fits in each. You can see the last container is overset, indicating more content is available:
Paginating Containers
A specific type of pagination can be used to populate containers. This works at a document level. It inspects the document, and any containers found on parent pages are populated. If a containers is overset, a new parent page is inserted and threaded to, so the content flows from page to page. Any field content outside the container is populated with the entire data. In this way it’s possible to paginate a document with a start-middle-end.
Formatting Rule Properties
Formatting Rules have an additional ‘Containers’ panel, which contains various properties assocated with populating a container.
Can Split
In the example above you can see that “Steaming Pot And Frying Pan” has split between both containers, which may or may not be desirable. In this case we simply uncheck the “Can Split” option. This means the table element will never split inside the container.
Type
The normal method of placement is “Replication”. Thes means the rule is populated with data that occupies the space available and is ‘replicated’ entirely with remaining data to continue. This method allows specification of a minimum first and last record count property to control orphan and widows. A ‘Text Threading’ method of population is also available. Instead of replicating the rule placing it again with the remaining data, the text frame is resized and then text threaded to the next. Only containers which are a single text box or have a single text box nominated as a Primary Text Frame”, via the Container Panel poppet menu, can be populated this way.
First, Regular, Last
When Replication types are allowed Can Split, these allow parts of the splut to use another formatting rule. In the example below, you can see the container has split, but the split part appears as “table-continued’, which doesn’t include the Category 3 header. First is used when there is a split. It might typically container a footer with ‘continued’. Regular split is used when any split occurs, Last is optionally used for the last split. This might be used for footnotes to the entire table, etc.
Labels
To facilitate the creation 1..n labels in the above example, a “Computed Field” command is used which is aware of the position of the record in the container. The sample uses this command to create the numbering for both the image and table.
CONTAINERRECORDINDEX(field name) – Gives the record index inside the container, an optional field name will group the data by that field and give the index of group the record is in.
CONTAINERINDEX() – Gives the index of the the thread the container is in, so 1 for the first, 2 for the second etc.
This can be combined with other commands to create sequences such as A-Z or Roman numerals for the content. For performance reasons, these command should be not tagged with field markers as they are not needed once the container is populated.
The post Containers appeared first on 65bit Software.