Publishing Examples

Publishing functions can be used to pull information from objects within the publication hierarchy, such as:

  • The values of metadata attributes on publication group, publication, and section objects
  • The name of a publication
  • The name and/or ID of a currently selected publication version
  • The first and last page numbers of the DTP pages saved to a section
  • The page number(s) on which a product appears in a publication

These functions are most commonly used within calculated attributes whose values display on InDesign pages created with Print Publisher. They can also be used in formulas that display in publication-related locations in the workbench, such as the Tables preview and in Flatplanner Sticker Book views, baskets, and financial reports.

Prerequisites

A publishing function will not return a value unless a publication version is selected. Additionally, the selected version must typically be relevant to the object on which the calculated attribute appears. One example would be for a product that appears on a DTP page that is saved in a particular publication. If a version from a different publication is chosen, then values such as page numbers will not display on the product, since it does not appear on any pages within that publication.

The examples in this topic show how calculated values from publishing functions display on product objects in the STEP Workbench Tree. To choose a version for testing purposes, go to View > Select version in the menu bar, then choose the relevant publication version.

Sample Formulas and Values

This section provides basic examples of calculated attribute formulas that use publishing functions, along with illustrations of the values they return. Where applicable, links are provided to more detailed topics that appear in other sections of the STEP Online Help. Though the examples provided are basic, they can be embedded within more complex calculations.

For the full list of publishing functions and brief descriptions of their intended purpose, refer to the Publishing Functions section of the STEP Functions documentation here.

getInheritedPublicationValue and getInheritedPublicationHierarchyValue

The getInheritedPublicationValue and getInheritedPublicationHierarchyValue functions are very similar. When used for product objects, both return metadata values from attributes on publication groups and publications, whereas the getInheritedPublicationHierarchyValue also returns values from sections.

Since the getInheritedPublicationValue function returns values from publication groups, publications, and sections when used to mount metadata using publication templates, it is more commonly used for mounted pages, whereas getInheritedPublicationHierarchyValue is more commonly used for products. The publication template scenario is only relevant to the Print Flatplanner and Print AutoPage components. For more information, refer to:

  • Using the getInheritedPublicationValue Function in Flatplanner in the Print Flatplanner documentation here
  • Using the getInheritedPublicationValue Function in AutoPage in the Print AutoPage documentation here

The following example uses the getInheritedPublicationHierarchyValue function to pull metadata from a section onto a product, using the formula getInheritedPublicationHierarchyValue('SectionTheme'). 'SectionTheme' is the ID of the source attribute on the section.

The selected product is linked into two sections of the publication—'Party Hats' and 'Birthday Hats.'

On 'Party Hats,' the value of Section Theme (SectionTheme) is 'Party Hats Section.'

On 'Birthday Hats,' the value of Section Theme (SectionTheme) is 'Birthday Hats Section.'

With the product selected in the Tree, the value of Section Theme (SectionTheme) from both sections displays in the ObtainAttrValueFromSection calculated attribute field. Values are sorted as they appear from top to bottom in the publication hierarchy, and are separated with a slash (/).

Similar values will be returned if the calculated attribute formula includes the ID of a metadata attribute that appears on a publication group or publication.

getPublication

Use this formula to return the name of a parent publication using the getPublication function:

 iterate(getPublication(),"stepname()")

getPublicationVersionID and getPublicationVersionName

The below example uses the simple formulas of getPublicationVersionID() and getPublicationVersionName() to return the ID and Name of the current publication version.

The following image shows the ID (250051) and Name (English US) of the selected publication on the Version tab.

Below, the product is selected and the values of the publication ID and Name display in the calculated attribute fields.

pagenumbers

This formula uses the pagenumbers function to return a list of page numbers (separating each with a comma and a space) on which a product appears in a publication:

list(sortnumeric(pagenumbers()), ", ")        

The below screenshot shows the Page data tab of two selected DTP pages. The products that appear on the pages are listed under the Products flipper. This example uses a product named 'Confetti Maker,' which appears on both page 4 and 6 of the publication.

When the Confetti Maker product is selected in the Tree, the page numbers on which it appears display in the calculated attribute field, e.g., pages 4 and 6.

sectionFirstPageNumber and sectionLastPageNumber

Use the formulas sectionFirstPageNumber() and sectionLastPageNumber()to return the values of the first and last page numbers of the DTP pages saved within a section. Typically there will be more than two pages, but for this basic example, only two DTP pages have been saved into the Tools section.

For a scenario using the SectionFirstPageNumber and SectionLastPageNumber functions to create a table of contents, refer to Creating a Table of Contents Product Template in the Print Publisherdocumentation here.