Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Get the total count of current master page


Level 2

I have two master pages in my form,i have to get total count of current master page.

$layout.pageCount()--> total page count(including all master pages)

But  i have to get the  total count of current master page.

2 Replies


Level 10

One way to count specific master pages is to use the resolveNodes menthod-


// Count all instances of master page "MP2"



If I understand you correctly then you can try the library object Master page n of m which I think does want you want:


When you place it on your Master page you get the page x of y, y=number of sheets on this masterpage.


Current page is  this.rawValue = this.parent.index + 1;
Number of pages on Masterpage:  this.rawValue = this.parent.all.length;