We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13730
    • 149 Posts
    Modx : 2.07 (french)
    getpage : 1.0.0
    getresources : 1.2.2

    I only want to navigate between the resources of folder (container), therefore I only want to see the [[!+page.nav]] output.

    My snippet call - this call is base on the example of getReources (Dashboard)
    [[!getPage? &element=`getResources` &parents=`26` &tpl=`myRowTpl`]]
    <div class="paging">
    <ul class="pageList">
    [[!+page.nav]]
    </ul>

    First, when I use the snippet call without the &tpl argument, the page display the Array of each resources, therefore I assume that I have to use the &Tpl argument.

    My question, is it possible to use getpage without the &Tpl argument? Because I only need to see the [[!+page.nav]] ouput.

    Second, the [[!+page.nav]] display nothing. When I open the source code of the rendering page I get this

    <div class="paging">
    <ul class="pageList">

    </ul>
    </div>

    Did someone has encountered this problem and how can it be resolved?

    Thank you for your help.


      • 23459
      • 9 Posts
      I’ve got the same problem with displaying [[!+page.nav]]
        • 34108
        • 66 Posts
        Me too, could an awesome person please take a minute to explain how to do this? It seems overly complicated for something that should be very straightforward...
          • 22303 MODX Staff
          • 10,725 Posts
          I can’t reproduce this problem—how many Resources are you getting returned; the default limit is 5; if there are not more than 5 Resources it would not create the paging controls... huh
            • 34108
            • 66 Posts
            Thanks OpenGeek smiley I’ve got it working now on a live environment, looks like it may have been a localhost issue. One final question - can I specify a template to over-ride the way the page numbers are outputted, e.g. <div class="paging"><ul class="pageList">[[!+page.nav? &tpl="XYZ"]]</ul></div> ?

            For the other posters - I’ve put my code below, and you can see the working example here - http://ironhouse.walkerdesigns.com.au/news/ - please let me know if you have any questions. You may have the same problem as me with localhost so try this on a live environment.

            Packages which are installed for this to work

            News Page (Template)
            [[!getPage?
            &elementClass=`modSnippet`
            &element=`getResources`
            &parents=`9`
            &depth=`3`
            &limit=`4`
            &pageVarKey=`page`
            &includeTVs=`1`
            &includeContent=`1`
            &showHidden=`1`
            &sortby=`menuindex`
            &sortdir=`ASC`
            &tpl=`latest-news_template`
            ]]
            <div class="paging">
                <ul class="pageList">[[!+page.nav]]</ul>
            </div>
            


            latest-news_template (chunk)
            <div class="news-item">        
                <h2><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h2>
                <p>[[+content:notags:limit=`120`]]...</p>
            </div>
            


            CSS I’ve used to hide the bits in page.nav I don’t want
            .news-item {
            	position: relative;
            	float: left;
            	width: 230px;
            	margin-right: 50px;
            	font-family: Arial, Helvetica, sans-serif;
            	font-size: 14px;
            	line-height: 19px;
            	margin-bottom: 30px;
            }
            	.news-item>h2 {
            		font-size: 120%;
            		font-weight: bold;
            		line-height: 22px;
            		margin-bottom: 0px;		
            	}
            	ul.pageList {
            		clear: both;
            		width: 200px;
            		float: right;
            		margin-right: -95px;
            		margin-top: 10px;
            	}
            		ul.pageList li {	
            			float: left;
            			font-size: 13px;
            			font-weight: bold;
            			padding-right: 10px;
            			margin-right: 10px;
            			border-right: 1px solid #999;
            		}
            		
            		ul.pageList li.control {
            			display: none;
            		}
            


            Result
            http://ironhouse.walkerdesigns.com.au/news/
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: harmonysteel at Apr 05, 2011, 01:14 AM

              Thanks OpenGeek smiley I’ve got it working now on a live environment, looks like it may have been a localhost issue. One final question - can I specify a template to over-ride the way the page numbers are outputted, e.g. <div class="paging"><ul class="pageList">[[!+page.nav? &tpl="XYZ"]]</ul></div> ?
              You can override those in a Property Set value directly (NOTE it will not work in the tag string itself)—I always use Property Sets anyway and I encourage everyone to do the same. FWIW, there is a request to allow those to be overridden via Chunks and this will be implemented in a future release of getPage.