Skip to main content
You have permission to edit this article.
Edit

insert

  • Updated

insert

The insert function is similar to certain forms of the <&placefile: function in that it can insert text at specific locations. But <&insert: can insert text that is supplied as an attribute as well as special strings such as Adobe InDesign or Adobe InCopy text variables and other internal data such as page name, color, or content type.

Compared to text based PlaceFiles, <&insert: is easier to setup and use. Also, the Translate Script section of the rulesets can handle a much longer string of text compared to what you can insert into either of the replacement fields of a ruleset. Thus, to prevent needing to break a really long string of boilerplate text into multiple rules, you could use: <&insert:(text,

Most useful version of <&insert:

The original purpose of <&insert: was to add to the text being translated the publication code of the active page. Then from that inserted code, jump to rulesets specifically designed for handling those publication code. Here is an example from the top of a client ruleset:

Most common use of

Sample Ruleset showing a rule for adding the current publication code, branching to three custom 'default' rulesets for three publication codes and then removing any remaining publication codes. 

Other practical uses for <&insert:

Since both the page's section letter and page number can be inserted into the asset being translate, then the translation can become special for certain sections, or more commonly for the first page of the section.

For example if the page was ‘01’ then you might want to use a different color for kickers. Or if a column ran on page ‘01’ then you might import a color column sig versus a black and white version. We know of sites that use unique date lines on section fronts and this too can be automated using <&insert:

Some sites have specific pages for specific content. Besides pleasing the readers to have consistent placement, it also makes it possible to do certain translations.

For example if the Opinion page runs on A4, then you can use that information to handle assets on that page uniquely as opposed to relying up other tags.

Other oddities

Because it can insert text into an asset, this could be used to do things like force bylines or taglines that would normally be handled by regular ruleset functions. What's unique here is the access to the various locations. Normal translation doesn't have many options to to location things - usually just the start or end of the <content> tags. But <&insert: can go to specific paragraphs if that is helpful. 

Insertion order

If you are inserting multiple items, keep in mind that the first one inserted will be the last one in text to translate. Here is an example Translate Script portion with 3 insertions that don't specify placement locations.

<&insert:(pubcode)>|<&insert:(ncd,S)>|<&insert:(page)>

The result for a document named ‘TRN_2013-02-14_B_009’ would be this combined string:

<page>9</page><ncd/S>B</ncd/S><pubcode>TRN</pubcode>

Notice that that effectively places the items in reverse order.

Surrounding Tags

As shown in the above example, the inserted text is always wrapped in tags that match the insert function’s p1, and p2 parameters. If p2 is used it will be prefixed by a / (forward slash) as shown in the ncd example above.

Function Details

The table below shows the details for the <&insert: function:

insert Details

This table lists details on the <&insert:()> translate script function.

Title Details
Name insert
Generic Calls <&insert:(p1)>|<&insert:(p1,p2,p3,p4,p5)>
Sample Calls <&insert:(pubcode)>|<&insert:(color)>|<&insert:(section)>|<&insert:(page)>|<&insert:(naming,Y)>
Parameters A maximum of 5 with only the first required.
p1 The insertion Type. This includes things such as: pubcode, page, section, naming, etc.
p2 The naming parameter. Used with naming and its shortcut ncd.
p3 Optional Insertion Paragraph Index. This accepts positive and negative integers as well as 0. The default is 0. 0 is the first paragraph. 1 is the second paragraph. -1 is the last paragraph. -2 is the penultimate paragraph.
p4 Optional Insertion Word Index. This accepts positive and negative integers as well as 0. 0 is the first word. 1 is the second word. -1 is the last word.
p5 Optional Insertion Point Index. Accepts all integers. As above, 0 is the first insertion point, 1 is the second and -1 is the last.

Insertion Types

The following Types of text can be inserted:

 
Sample CallDescriptionSample ResultNotes
<&insert:(app)>Application running the client<app>Adobe_InDesign</app>Adobe_InCopy is only other option
<&insert:(automated)>Is Automated Production Active <automated>false</automated>Does not actually indicate that the translation was started by Automated Production
<&insert:(color)>The known page color. <color>b</color>Requires Page Color to be Enabled.
<&insert:(distributed)>The current user's mode.<distributed>Normal</distributed>The three options are Local, Normal, and Remote. 
<&insert:(domain)>The current domain <domain>training.local</domain>Useful if the rulesets are actually hosted by a different domain.
<&insert:(naming,H)>|<&insert:(ncd,N)>Any of the naming convention options controlled by the page/document name.  <naming/H>January</naming/H><ncd/N>Publication Name</ncd/N>Access to ALL Folio Text Variables
<&insert:(page)>The page number.  <page>1</page>

This is coming from the document name. Readers don't like jumps.

Can be a different result than <&insert:(naming,G)> which might have leading zeros.

<&insert:(pubcode)>The current publication code.<pubcode>TRN</pubcode>The same result as <&insert:(naming,B)> but easier to remember.
<&insert:(section)>The section letter of the document.<section>A</section>The same result as <&insert:(naming,S)> but easier to remember.
<&insert:(source)>Is this a normal asset translation or did it start from a blob of pasted text translated with a utility script?<source>translateArticleAsset</source> 
Will show 
'translateToEnd' when translating pasted text.
<&insert:(text,Exclusive)>Any blob of text.<text>Exclusive</text>Can't use apostrophes in the text to insert. 
 <&insert:(type)>The page's Applied Page Content Types<type>front</type>Multiple <type> tags can be inserted. The first of which would be the primary Page Content Type.
<&insert:(variable,File Name)>Any Adobe InDesign Text Variables including built in and Folio Text Variables.<variable/File Name>GAM_2022-08-05_A-001</variable/File Name> Same as the <&insert:(naming, except with access to Adobe InDesign's Text Variables.
<&insert:(versioniscc)>A true/false indication of this being run within Adobe Creative Cloud Versions <versioniscc>true</versioniscc> Some features aren't available to the users of the unsupported Creative Suite versions. 

Additional Notes

automated

This doesn't indicate that the translation came from an Automated Production placement. Just that Automated Production is enabled on the current domain. However, the source will be set to `automated`.

color

This has three values. It will be `true` when the page is marked as color. It will be `false` if it is marked as black and white. It will be `null` if the page's color hasn't been indicated.

distributed

Has three options. `Normal` is what you would normally see. `Local` and the more common `Remote` are the two other options. No idea what this might actually be usable for. 

naming, ncd, & variable

These 3 have lots of overlap! naming and ncd are 100% the same. Consider ncd just a shortcut or abbreviation for naming. The options that are available are listed in the link below:

Default Folio Text Variables

This table outlines the Folio Text Variables available with version 5.53.19, or newer, of the BLOX Total CMS client for Adobe InDesign. For support of all of the items listed, your client needs to be at version 5.63.x or newer.

Variable Name Sample Values Notes
A Count of All pages 24 Set when using BLOX Total CMS > Documents > Advertising > Create Pages...
B Publication Code NYT
B0 Publication Code NYT The same as B
B1 Publication Name New York Tribune The same as N
B2 Publication Symbol Frequently used in output
B3 Publication URL help.townnews.com Whatever text is in the URL field in the Publication Details dialog.
B6 Publication Language en Can show `en`, `es`, or `fr` according to value set in publication. And from that can drive translation.
D Publication Date of Month 7
D0 An Ordinal Date 7th As D above, but with ordinal suffix
D1 The Date of Month for the day after the Publication Date 8
D2 Publication Date of Month with 2 characters 07 As D above, but padded to 2 characters
D6 Publication Date as Roman Numerals VII
D8 The Date of Month for the two days before the Publication Date 5
D9 The Date of Month for the day before the Publication Date 6
E Edition Code
E0 Edition Code The same as E
E1 The Edition Description
E2 The Edition Symbol
F Publication Day Folio Friday, January 7, 2022 All these F Text Variables are new for 5.53.19 though some sites will override it
F0 -reserved for future use-
F1 Tomorrow's Folio Saturday, January 8, 2022
F2 Folio for 2 days past the publication date Sunday, January 9, 2022
F5 Publication Day Folio using AP Style abbreviated Months Friday, Jan. 7, 2022 Uses AP style abbriviated months
F8 Folio for 2 days before the publication date Wednesday, January 5, 2022
F9 Yesterday's Folio Thursday, January 6, 2022 As above
G Page Number 001 Will be fully padded to match the naming convention. Do not trust on multi-page document
G1 1 or more digit page number 7 Page numbers of 10 or larger will appear completely
G2 2 or more digit page number 07 Page numbers of 100 or larger will appear completely
G3 3 or more digit page number 007 Page numbers of 1000 or larger will appear completely
G4 4 or more digit page number 0007
H Publication Month as Word January
H1 Next Month February See also M5
H2 Month after Next March
H3 3 Months after Publication Month
H4 Publication Month as AP abbreviation Jan does NOT have the period. See also M5
H5 Month as AP abbreviation Jan. has the . See also M5
H6 North American Season Winter
H7 3 Months ago from Publication Month October
H8 2 Months ago from Publication Month November
H9 Last Month December
I Issue Number given Publication Schedule 69 Multiple configuration options
I6 Roman Numeral version of I LXIX
I7 Issue Number if publication happened 7 days a week 269 Requires configuration in Edit Publication
L URL/Domain Name richmond.com
M Month as Number 3
M1 The Month for the day after the Publication Date 3
M2 Month as Number padded to 2 digits 03
M5 Next Month's name as AP Abbreviation with . if applicable April See H1 and H5
M6 Publication Month in Roman Numerals I
M8 The Month for the two days before the Publication Date 3
M9 The Month for the day before the Publication Date 3
N Publication Name New York Tribune Same as B1
P Abbreviated Day of the Week for the publication day Fri All P items are 3 letter shortened versions of W
P1 Abbreviated Day of the Week Tommorrow Sat These are available in 5.67
P2 Abbreviated Day of the Week Day after tomorrow Sun
P3 Abbreviated Day of the Week 2 days following publication Mon
P7 Abbreviated Day of the Week 3 days before Tue
P8 Abbreviated Day of the Week 2 days before Wed
P9 Abbreviated Day of the Week Yesterday Thu
R Automatic publication range. Using the publication schedule Friday–Sunday, January 7–9, 2022
R0 Automatic publication range but without days of the week. Using the publication schedule. January 7-9, 2022
R1 A one day publication range Friday–Saturday, January 7–8, 2022
R2 A two publication range Friday–Sunday, January 7–9, 2022
R3 A three publication range Friday–Monday, January 7–10, 2022
R4 A four publication range Friday–Tuesday, January 7–11, 2022
R5 A five publication range Friday–Wednesday, January 7–12, 2022
R6 A week long publication range Friday–Thursday, January 7–13, 2022
R9 A two day range starting from Yesterday Thursday–Friday, January 6–7, 2022
S Section Letter C Do not trust in a multi-page document
S0 Section Letter C Same as S
S1 Section Description Sports Useable if you schedule consistently.
S2 Section Symbol C
T Plate Code Comes from the Plate tab of the Page creation settings.
T0 Plate Code Same as T
T1 Plate Description
T2 Plate Symbol
U User Name blox@domain.com The Adobe InDesign user when the folio values were set.
V Volume 123 Configure in Page Creation Settings
V0 Ordinal Volume 123rd as above
V6 Roman Numeral version of V CXXIII
W Weekday Friday Publication Day
W0 -reserved for future use- -reserved for future use- -reserved for future use-
W1 Tomorrow from Publication Date Saturday Tomrrow
W2 2 days ahead Sunday
W3 3 days ahead Monday
W4 Number for the Day of the Week 5 Sunday is 0, Monday 1, etc
W5 Number for the Day of the Week 6 Sunday is 1, Monday is 2, etc
W6 3 character short title case version of the publication day Fri
W7 3 days behind Publication Date Tuesday
W8 2 days behind Wednesday
W9 1 day behind Thursday Yesterday
Y Publication Date Year 2022 or 22 Length depends upon
Y1 Year of the day after the publication date
Y2 Publication Date Year as 2 digits 22 Always 2 digits
Y4 Publication Date Year as 4 digits 2022 Always 4 digits
Y6 Publication Year in Roman Numerals MMXXII
Y8 Year of the date for 2 days before the publication date 2022
Y9 Year of the date before the publication date 2022
Z Zone Code 00 The default zone is ALWAYS 0. The number of digits is based on the naming convention
Z0 Zone Code 00 Same as Z
Z1 Zone Description
Z2 Zone Symbol

In addition to those, it might be possible to reach other semi-hidden options from the publication details such as:

  • isDaily_b
  • pubDate (has a fixed YYYY-MM-DD format)

If you need something, please file a support ticket to request it.

variable, however, is different because it can see things that are unique to Adobe InDesign. Below is an image of the default Adobe InDesign text variables that can be inserted. 

Default Adobe InDesign Text Variables

This shows the normal dialog for Adobe InDesign text variables before the BLOX Total CMS client for Adobe InDesign injects the tens of different variables primarily intended for use in folios.

All of these variables can be inserted in text via a ruleset's translate script call like this one <&insert:(variable,Modification Date)>

Note: The naming and ncd options don't have spaces, but every one of these variables use spaces in their names.

source

The source can change during translation from the initial source to `recursive`. If you want to use it to know that the translation started from a text file translated with `translateToEnd` called by a utility like `Translate Existing Text` you should use the <&insert:(source)> in the default ruleset.

This would be most useful for handling translations from Automated Production. Those translations would be marked with a source of `automated` and this could be used to modify `copyfit` or `headfit` options. As of 2022.08.12 `automated` would only appear on Automated Production translation of Article assets. 

type

Type is used for Page Content Types. And since a page can have from 0 to many Page Content Types, there can be between 0 and many <type> tags inserted.

Placement Locations: p3, p4, p5

The final three parameters can be used to control the placement location of the text. This is most useful when you want to actually add text to the asset. In most cases they are not used, but the options exist if needed. 

As described in the table, p3 is the paragraph index. When not set the first paragraph is used. Negative indexes count from the end of the story. 

p4 is the index word of the paragraph specified by p3. Again, if not specified, then the first word is used. Negative indexes count from the back of the paragraph.

Finally, p5 is the insertion point of the word of the paragraph. 0 is the before the first character. -1 is after the last character. 

To force something to the very end, use -1, -1, -1 as in this example: <&insert:(text,Is that the end?,-1,-1,-1)>

We want your feedback!

See something that needs updating or additional clarification? Want assistance with a topic that isn’t listed here? Please let us know!

At BLOX Digital we are dedicated to providing you the information you need to be successful when you need it.

Visit our feedback page to log in, submit a support ticket, and track the progress of your open requests.