How can I create a status message of X of TOTAL pages under a parent? I have a Structure section with an ordered number of entries under a parent. On each entry I would like to add a status message of the user's current progress... i.e. You are on page 1 of 5 pages.

The total was easy... 

{% set total = entry.getParent(entry).getDescendants().count() %}


How do I get the current page (child) number within the total number of children.

Thanks!
I assuming the pages are one level down from the parent?

Parent
  | Child (1)
  | Child (2)
  | ... etc


You can do this:

{% set topLevel =  entry.parent %}
{% set totalPages = topLevel.getDescendants().count() %}      
{% set entryIds = topLevel.getDescendants()|group('id')  %}
{% set currentPageNumber = (entryIds|keys)|indexOf(entry.id) + 1 %} 

{{currentPageNumber }} of {{totalPages}}


Basically we're making an array (list) out of just the entry IDs by grabbing the descendants from the parent. Then we use Craft's group function to give us an array, grouped by key (in this case the ID). Since we know the current page's ID, we can find it in the array and return its position. Since arrays are indexed starting with 0, we just add 1 to it.