printformer BlockAttributes
Block attributes as well as settings and restrictions define the editing options of individual blocks for the printformer editor
Additional properties (attributes) can be added to each tagged block. These determine, for example, which adjustments can be made to the element or how the element behaves in different scenarios.
The attributes are added (instruction) to the respective block (tag) with name and value in the InDesign document as described in the table below.
If settings or restrictions are to be used across templates (for all existing blocks or blocks added by the user), this is possible via BlockSetting Presets and Block Restrictions, which are created directly in the Admin area).
BlockAttributes
Name | Value (Limitations) | Usage | Example of use |
---|---|---|---|
All blocks | |||
condition-json | Block is displayed only if conditions are fulfilled. | ||
settings | Limitation of the editability of blocks (e.g. no moving of a block possible) | ||
tags | One or more tags (comma separated).
| Container template: If a tagged article template is dragged into the editor workspace, all containers that may be filled with this article are marked. Additionally, all article templates can be filtered by their tags (via the search function). | |
content-identifier | Usage for template type group, customizable bundle or for containers (article templates): when changing template, layout or article template, the content (text or asset) of the block is kept (but the formatting of the text itself is not maintained when changing). | A text block is included in several article templates and tagged with content-identifier. If its text (in the container) is changed in the editor and then another article template is moved into the container, the edited content (text) remains. | |
content-validation | This attribute can be used to assign a block content validation (JSON condition) to the block. The identifier of the desired block content validation is entered as the value. | A text block must not be filled with the letter combination "XX"; a respective block content validation is created for this purpose. If "XX" is now entered in the block in the editor, the (freely selectable) error message appears (short pop-up and note). | |
Assetblocks (image, PDF blocks) | |||
These attributes are created directly at the block (tag in the structure) via New Attribute… | |||
data-keys | One or more DataKeys (comma separated) used to search for content for the block in the current data sources. | Text placeholder | |
data-key-value | is used in combination with media-hunter, e.g. a file name (incl. suffix) or a URL can be used as value. | A picture from a website is to be inserted into an imageblock. Note: printformer saves the image from the URL when the template is opened for the first time and does not query it afterwards again. If the image is updated on the website, the former version remains in the template. | |
media-hunter | external-url, custom-attribute, catalog-product-media, system-media | (Value = sources: external link, user-defined attribute, article template, system media)Attribute of an imageblock to search for images; defines the source of the image with which the block is to be filled. Used in combination with the block attributes data-keys or data-key-value. | If an imageblock contains a reference to a file in the system media, this file (e.g. logo) only has to be replaced in the system media when updating and is then automatically used for all templates that have not yet been produced. |
h-align | left, center, right | Automatic horizontal alignment of the asset on initial or media source filling | If an asset block is filled with an image that has a smaller format width, then it is placed horizontally centered (without h-align). |
v-align | top, center, bottom | Automatic vertical alignment of the asset on initial or media source filling | If an asset block is filled with an image that has a smaller format width, then it is placed vertically centered (without v-align). |
Block-Settings | |||
When creating a block setting attribute, "settings" is always entered as the name. | |||
all blocks | |||
block-disable-interactions | true or false | If this value is true, any interaction with the block and its content is prevented. | blocks with text placeholders in which nothing should be changed except the text content. |
block-actions | delete, move, vmove, hmove, | (v = vertically; h = horizontally; zindex = layer) If move is not allowed, resize and rotate should also be prohibited. | In case of several overlapping shapeblocks, only the order (which block is in the foreground, which blocks behind) should be adjustable, all other edits are locked. |
tresize, trresize, rresize, brresize, bresize, blresize, lresize, tlresize | *for the Scale function, an anchor point can also be selected to specify the direction in which the scaling is to happen. | For a text block, only the font size should be changeable, the distance to the object below the block is fixed. | |
block-map-colors | true or false | If this value is true, colors of single elements from SVG graphics can be selected and changed individually. | A shape in the template may be adjusted, but the color should be unchangeable |
block-prevent-clipping | true or false | Does the block have to be entirely on the page or within a CCA? | To avoid that elements are outside the printable area (and thus are cut off, for example) |
block-effects | Selection of multiple effects for an imageblock. | Vectorize SVG graphic and convert to CMYK | |
block-effects-active | Blockeffectidentifier | Each imageblock can be assigned one existing block effect, there is no way to deselect it in the editor. | stamping a graphic |
prevent-white-gaps | value in pt | Validation of Bleed and Safety Distance. | For a business card, a safety distance of 2 mm to the edge should be maintained additionally, for elements falling off the edge, a bleed is necessary, which the user should be made aware of (if he does not consider it) { "prevent-white-gaps" : 6 } |
block-scaling | size, position, font, container-content* | Comma separated list of allowed scaling actions An empty string means no allowed scaling actions, if this setting is not set all scaling actions will be applied. | If new page dimensions are entered when the template is opened, this setting can be used to specify whether the individual blocks/texts should be scaled and/or repositioned according to the new format. |
block-scaling-keep-proportions | true or false | If new page dimensions are set when the template is opened, this setting can be used to specify that the blocks should be scaled proportionally to the new format. | Images should not be distorted despite format adjustment |
block-scaling-keep-distance | boolean | If this setting is set, the block always keeps the same distance to the canvas (regardless of the original size), i.e. the block is scaled according to the given page dimensions. | A safety margin to the format edge is to be displayed in the editor:
CODE
|
Textblocks | |||
text-write | true or false | Darf Text überschrieben werden? | Predefined wording which should not be changed, but the formatting of the text may be adjusted. |
text-format | font, fontsize, font-family, font-style, color, valign, | Comma-separated list of allowed formatting options. | Highlighting is allowed in the text, but otherwise nothing may be reformatted |
text-select | true or false | Content of the text frame is selected when the block is activated. | The written content of a block is to be overwritten completely |
text-fit | true or false | Should the font size of the text be automatically reduced (to max. 30%) if the content does not fit into the text frame. Can also be used in combination with the block restriction | Limited space for a headline, but font size should be as large as possible. |
text-grow | t, b, l, r, | With this attribute, the block automatically expands as soon as the amount of text exceeds the original size of the text frame. The reference point is specified by the value( The combination with the | A text block should be enlarged to a maximum size of 300x200 pt, if further text is entered, the font size should be reduced automatically. |
Assetblocks (image-, PDF-blocks) | |||
use-box | trim, art, bleed, crop, media | This setting can be used to define which Box of the PDF is used while placing it into an imageblock (similar to import options in InDesign).
Note: Even for PDF files that are already placed as default in the IDML, this attribute must be set on the block, otherwise the box trim will be applied. (Possibly not all boxes are defined in the PDF file). | A PDF file contains bleed and crop marks, but in the editor it should be placed only in the format including bleed (without the additional white space for the crop marks) { "use-box": "bleed" } |
asset-cut-out | true or false | If this value is false, the user cannot change the image detail in the editor. (No controls in the sidebar) | Image motif is already defined by the IDML, can be placed differently by the user, but otherwise not customized. |
asset-fill-block | true or false | Does the image frame have to be filled completely? (If this value is true, the shorter side of the picture is scaled to the width or height of the frame and thus a part of the picture is cut out.) | To avoid empty areas in the template the image block must be filled completely |
asset-replace | true or false | Is it allowed to replace the image? | The image section can be changed, but the image itself must not be changed. |
Block-Restrictions | |||
When creating a block setting attribute, "restrictions" is always entered as the name. The restrictions block-size-max/min; text-font-size were stored as settings on the block in an earlier printformer version. Due to the now existing separation of settings and restrictions, there is no need for adaptation. IDML files in which these restrictions are stored as settings will continue to work. | |||
all blocks | |||
block-size-max | width, height | Maximum dimensions (width and height) of the block in pt. If the value is empty, no limitation of the corresponding dimension is applied. (Not applicable for ShapeBlocks, since they generally cannot be scaled in the editor). | A text frame may be extended to any height, but the width is limited. |
block-size-min | width, height | Minimum dimensions (width and height) of the block in pt.If the value is empty, no limitation of the respective dimension is applied. (Not applicable for ShapeBlocks, since they generally cannot be scaled in the editor). | A text frame may be extended to any height, but the width is fixed (combination with block-size-max). |
Textblocks | |||
text-font-size | min, max | Limitations of the font size: minimum and maximum size in pt | minimum font size 16 pt and maximum font size 20 pt |
Kombination text-fit mit text-font-size | If the attributes text-font-size and text-fit are combined, please note that these settings refer to the complete block. The adjustment always starts from the smallest size and the minimum font size must not be smaller than 30% of the default size. (Depending on the line spacing different results may occur). | { | |
Assetblocks (image-, PDF-blocks) | |||
provider | userMedia, systemMedia, media | This restriction defines from which source assets can be loaded into an imageblock (only system media or own). | For an imageblock, a selection of pictures is available, but the user should not be allowed to use his own pictures. { "provider": ["userMedia"] } |
types | image, graphics (SVGs), pdf | This allows to specify (independently from the media restriction of the general system settings) what kind of image (file format) may be loaded into an imageblock. | Only vectorized logos may be inserted into an imageblock |
dpi | error, perfect | Here you can set the minimum resolution (error) in dpi as well as a recommended resolution (perfect) for an imageblock. | Minimum resolution is 150 dpi, recommended is 200 |
Tag specific attributes | ||
Tag | Usage | |
---|---|---|
Links to the corresponding attributes of the tags will follow | ||
PFBarcode | ||
Attributes Barcodes | Codes (QR, EAN13 or Code128) can be generated from standard text, using the form editor or via a data source. | |
PFPlaceholder | ||
Attributes Placeholder | Text placeholders to include content via the form editor or automated via an external data source. | |
PFContainer | ||
Attributes Container | Containers are placeholders for article templates. They can be filled with one article template each, for which limitations can be set via attributes. | |
PFGridContainer | ||
Attributes GridContainer | GridContainers are placeholders that can be filled with several article templates according to a grid specification (e.g. 2x3 units). The grid of the container is defined in the InDesign document by tag and attribute. | |
PFPage | ||
Attributes PFPage | Creation of a print sheet (panel template), on which individual pages of a printformer template can be placed as desired. | |
PFPrintArea | ||
Attributes PFPrintArea | Creation of a print sheet (panel template) on which predefined areas (or objects) of another template can be placed as desired. |
JSON
general introduction to JSON at json.org
Example JSON content of a BlockSettings attribute
{
"block-actions": "move,resize",
"text-write": false,
"text-format": "fontsize,color",
"text-font-size": {
"min": 5
},
"block-size-max": {
"width": 50,
"height": 50
}
}
Explanation:
(1) open
(2) the block may be moved and scaled,
(3) the text content may not be changed,
(4) the font size and color may be changed,
(5) font size (interlacing): open
(6) at least 5 pt
(7) close,
(8) at least 5 pt (interlacing): open
(9) width = 50 pt,
(10) height = 50 pt
(11) close
(12) close
Condition JSON
With condition-json
you can define wether a block is disolayed or not.
If all conditions are fulfilled the block is displayed, if they are not fulfilled the block is not displayed. If errors occur when checking the conditions, the block will still be displayed.
(JSON will be checked in printformer if there are errors the template can’t be saved.)
In the IDML, the condition-json
is specified as the value of an attribute of the (block) tag, name: condition-json.
A condition consists of 2 values (left, right) and an operator. left
and right
can either be simple values or references to values from a data source (customer CSV, catalog product, ...).
Logical operators
and
or
xor
(either or)
Comparison operators
Comparing within strings is CaseInsensitive
equal
not-equal
contain
not-contain
in
(List in right value contains left value)not-in
(List in right value does not contain left value)
References must be marked as follows:
${data-key}
Samples
ext field with three placeholders "Field1", "Field2", „default text". If the fields "Field1" and "Field2" are both filled, the "default text" will be shown (the attribute will be assigned to the "default text" placeholder).
{
"left": {
"left": "${Feld1}",
"operator": "not-equal",
"right": ""
},
"operator": "and",
"right": {
"left": "${Feld2}",
"operator": "not-equal",
"right": ""
}
}
ext field with three placeholders "Field1", "Field2", „default text". If the fields "Field1" and "Field2" are both filled, the "default text" will not be shown (the attribute will be assigned to the "default text" placeholder).
{
"left": {
"left": "${Feld1}",
"operator": "equal",
"right": ""
},
"operator": "or",
"right": {
"left": "${Feld2}",
"operator": "equal",
"right": ""
}
}
Value from the data source with data-key 1|quality
contains the value DB
{
"left": "${1|quality}",
"operator": "contain",
"right": "DB"
}
Value from the data source with DataKey 1|quality
contains one of the Value from the list of the right operands
{
"left": "${1|qualitaety}",
"operator": "in",
"right": ["IA/DV", "IA/DD", "IA", "C%", "EG"]
}
The values of 1|price
and 2|price
are not equal, or the values of 1|content
and 2|content
are equal.
{
"left": {
"left": "${1|price}",
"operator": "not-equal",
"right": "${2|price}"
},
"operator": "or",
"right": {
"left": "${1|content}",
"operator": "equal",
"right": "${2|content}"
}
}