Expand my Community achievements bar.

Get page numbers specific to each template language and instance when template itself repeatable

Avatar

Level 6
We have a template, which consists English and Spanish pages. Also in one single request, we have a chance of repeating the template itself. With the scenarios mentioned, is there a way we can try to keep page numbers specific to each template?
 
lets say if template generated for 2 instances in same request, can the page numbers get specific to language and instance rather referring to total page count when referring with Master page or total page counts? As template can be generated to any number of instances in single request. can this be possible to get page numbers like below?
 
Template Instace1 page numbers:
          English Page 1 of 2 Page 2 of 2
          Spanish Page 1 of 2 Page 2 of 2
 
Template Instace2 page numbers:
          English Page 1 of 2 Page 2 of 2
          Spanish Page 1 of 2 Page 2 of 2
 
Please review the attached sample template for the same, help or guidance much appreciated.
 
Thank you.
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Employee

Hi @AEMFrmsDev,

To answer your question, in theory, it is possible, but only if you design the XDP in a way that resets pagination at logical boundaries (template instance + language) instead of relying on the document-wide page counter.

By default:

  • page n of m on a master page always refers to the entire rendered document and not individual pages.

  • Repeating a subform or generating multiple instances in one request does not reset page numbering automatically

  • Master pages cannot “see” template instance boundaries unless you explicitly design for it

So you cannot get this behavior automatically just by repeating the template.

 

To achieve the use case, you can follow one of the following, and that should help you fix the issue.

1. One Template Instance = One Root Subform (repeatable)

Create a repeatable subform that represents one full template instance:

form
└── TemplateInstance (subform, repeatable)
├── EnglishSection
└── SpanishSection


Set:

  • TemplateInstance → Repeat Subform for Each Data Item
  • Pagination must reset inside this subform

2. Use Page Sets (not just Master Pages)

Inside TemplateInstance, define multiple page sets:

TemplateInstance
├── PageSet_English
│ └── MasterPage_English
├── PageSet_Spanish
│ └── MasterPage_Spanish


Then:

  • English content flows only into PageSet_English
  • Spanish content flows only into PageSet_Spanish
  • Use page break at the end of each language section
  • Example:

    • English → break to Spanish Page Set

    • Spanish → break to next TemplateInstance

This is critical — page sets are the only supported way to isolate pagination scopes.
Thanks
Pranay