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

cachePush

  • Updated

<&cachePush:()> is the first part of a pair of Custom Translate Script functions which together allow text to be moved within an asset.

The classic example of its use would be to move a photo credit from before the caption/description to after it. That particular option, however, can be enabled by BLOX Digital (formerly TownNews) without using the pair of cache functions.

Another example of its use might be to rearrange the headers in some reverse publish calendars. While harder to implement, it could even be used to move columns of text in agate. That won't be quick to implement nor to place/translate, so consider if it really matters before walking down that path.

Function Details

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

cachePush details

This table lists details on calling the <&cachePush:()> function.

Title Details
Name cachePush
Generic Calls <&cachePush:()>|
Sample Calls <&cachePush:()>|<&cachePush:(777)>
Parameters One optional parameter.
p1 The number for the cache to use. This would be any integer. For example, 0, 1, 2, etc

Example of Moving a Photo Credit

The classic example of using <&cachePush:()> and <&cachePull:()> translate script functions is moving a photo credit/byline to after the photo caption/description. 

The basic call to push that credit on the cache would look like this:

cachePush to grab a photo credit

This sample call of <&cachePush:()> will take the text inside the <photoCredit> and </photoCredit> tags and place it in cache 0 (zero). 

Oddities of Using <&cachePush:()>

This function REQUIRES both a `Start Tag` and an `End Tag`. If you only provide the `Start Tag` there won't be any text to place in the cache. If you just want to remove some text and then insert that same text in other places you can use the normal rule of just a start tag to remove it. Then use <&insert:()> to insert that text anywhere you want. 

If you specify both the original `Start Tag`/`End Tag` pairs and then also specify a `Start Tag Replace` and/or `End Tag Replace`, the text added to the cache will be wrapped with the replacement tags. And it can all match like this:

cachePush rule for photo credit storing original tags

This rule shows moving text for a photo credit to an unnumbered cache. Because normal ruleset behavior applies, this rule will run twice because both a Start tag and an End tag is specified.

Because both the Start tag and End tag are present, the rule will run at least twice. Don't call this function on text that you need to find multiple times as you'll only have the final found text in the cache.

The <&cachePush:()> function itself will completely ignore both the `Paragraph Style` and the `Character Style` functions. But additional Translate Script commands might still use them. To format text, use the <&cachePull:()> function.

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.