We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17750
    • 78 Posts
    Use two snippets getPage for a page like this:

    <div class="NavPg"><span class="pgnt">[[+page1]] of [[+page1Count]] | </span> [[!+page.nav1]]</div>
    [[!getPage@Pgn1? ... param ... ]]
    
    ... code ...
    
    <div class="NavPg"><span class="pgnt">[[+page]] of [[+pageCount]] | </span> [[!+page.nav]]</div>
    [[!getPage? ... param ... ]]
    
    


    In snippet getPage -> Properties I add Property Set "Pgn1" and pageVarKey with value: page1, and pageNavVar with value: page.nav1

    If in the first instance of the snippet remain placeholders page and pageCount, they will accept the values ​​of page and pageCount from the second instance. There should be different placeholders by name to convey values ​​to the page "# of ##".

    Proposes to add the following 2 lines in the code snippet getPage after line 70:
    line65: } else {
    line66:        $properties[$properties['pageNavVar']] = getpage_buildControls($modx, $properties);
    line67:        if ($properties['page'] > 1) {
    line68:            $qs[$properties['pageVarKey']] = $properties['page'];
    line69:        }
    line70:    }
    
    $modx->setPlaceholder($properties['pageVarKey'], empty($qs[$properties['pageVarKey']]) ? 1 : $qs[$properties['pageVarKey']]);
    $modx->setPlaceholder($properties['pageVarKey']."Count", $properties['pageCount']);
    
    
    


    Thus in the example given above, placeholders "page1" and "page1Count" will take their values ​​when trying to deduce Page 4 of 15 (for example). This will apply to all instances of getPage regardless of their number on the page.

    This has been proposed, but here we can discuss if this is appropriate.