Forum

Thread tagged as: Problem, Runway

Runway: page_links not outputting for collection

I have a paginated collection. Everything is working except for <perch:content id="page_links" encode="false" /> which doesn't seem to be outputting. <perch:showall/> shows page_links as blank:

<perch:showall/>:

paging  true
total   26
number_of_pages 2
total_pages 2
per_page    18
current_page    1
lower_bound 1
upper_bound 18
prev_url    
next_url    /products?page=2
prev_page_number    
next_page_number    2
first_page_url  /products
last_page_url   /products
first_page  true
not_last_page   true
page_links  
perch_item_first    true

Page:

                <?php perch_collection('Ring & Pinion',[
                    'sort'=>'title',
                    'sort-order' => 'ASC',
                    'paginate'=>true,
                    'count'=>18,
                    'page-links'=>true,
                    'page-link-style'=>'all'
                ]); ?>

Template:

<perch:before>
<perch:if exists="paging"><div class="paging">
    <perch:showall/>
    <perch:content id="page_links" encode="false" />
  Page <perch:content id="current_page" type="hidden" /> of <perch:content id="number_of_pages" type="hidden" />
  <perch:if exists="not_first_page"><a href="<perch:content id="prev_url" type="hidden" encode="false" />">Back</a></perch:if>
  <perch:if exists="not_last_page"><a href="<perch:content id="next_url" type="hidden" encode="false" />">Next</a></perch:if>
</div></perch:if>
</perch:before><a href="/products/ring-and-pinion/<perch:content order="2" id="slug" type="slug" for="title" editable="true" indelible="false" label="Slug" help="Appears in product URL" />">
    <span class="img" style="background-image:url('<perch:repeater order="4" id="images" label="Images"><perch:if exists="perch_item_first"><perch:content type="image" id="image" label="Image" width="800" quality="80" bucket="ring_and_pinion" /></perch:if></perch:repeater>');"></span>
    <span class="info">
        <strong class="font-dinpro-medium"><perch:content order="1" id="title" type="text" label="Title" required="true" title="true" /></strong>
        <span><strong>Part#</strong> <perch:content order="3" id="part_number" type="text" label="Part Number" required="true" /></span>
        <perch:if exists="equivalent_product"><span><strong>Lightning#</strong> <perch:related order="9" id="equivalent_product" collection="Ring & Pinion" label="Lightning/Non-Lightning Equivalent" size="m" ><perch:content order="3" id="part_number" type="text" label="Part Number" required="true" /></perch:related></span></perch:if>
    </span>
</a><perch:after>
<perch:if exists="paging"><div class="paging">
    <perch:content id="page_links" encode="false" />
  Page <perch:content id="current_page" type="hidden" /> of <perch:content id="number_of_pages" type="hidden" />
  <perch:if exists="not_first_page"><a href="<perch:content id="prev_url" type="hidden" encode="false" />">Back</a></perch:if>
  <perch:if exists="not_last_page"><a href="<perch:content id="next_url" type="hidden" encode="false" />">Next</a></perch:if>
</div></perch:if>
</perch:after><perch:content suppress="true" order="5" id="ratio" type="text" label="Ratio" divider-before="Specifications" /><perch:content suppress="true" order="6" id="tooth_count" type="text" label="Tooth Count" /><perch:related suppress="true" order="7" id="family" collection="Ring & Pinion - Family" label="Family" size="m" divider-before="Sorting" ></perch:related><perch:content suppress="true" order="8" id="lightning" type="checkbox" label="Is this a Lightning version?" value="yes" />

Diagnostics:

Perch Runway: 3.0.8, PHP: 5.6.14-1+deb.sury.org~trusty+1, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Linux, apache2handler
Installed apps: content (3.0.8), assets (3.0.8), categories (3.0.8), perch_forms (1.9.1)
App runtimes: <?php $apps_list = [ 'perch_forms', ];
PERCH_LOGINPATH: /usg-admin
PERCH_PATH: /var/www/public/usgear.dev/usg-admin
PERCH_CORE: /var/www/public/usgear.dev/usg-admin/core
PERCH_RESFILEPATH: /var/www/public/usgear.dev/usg-admin/resources
Image manipulation: GD Imagick
PHP limits: Max upload 2M, Max POST 8M, Memory: 128M, Total max file upload: 2M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
HTTP_HOST: usgear.dev
DOCUMENT_ROOT: /var/www/public/usgear.dev
REQUEST_URI: /usg-admin/core/settings/diagnostics/
SCRIPT_NAME: /usg-admin/core/settings/diagnostics/index.php
Shane Lenzen

Shane Lenzen 18 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What does debug give you?

I should have checked that!

Template file not found: /var/www/public/usgear.dev/usg-admin/templates/pagination/page-links.html

What should that file contain? It doesn't seem to be included in the Runway package.

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hey Shane,

Here is perch/templates/pagination/page-links.html:

<perch:before><ul></perch:before>
<li<perch:if exists="selected"> class="active"</perch:if>>
    <perch:if exists="spacer">
        <perch:pages id="page_number" />
    <perch:else />
        <a href="<perch:pages id="url" />"><perch:pages id="page_number" /></a>
    </perch:if>
</li>
<perch:after></ul></perch:after>

Works great, thanks Hussein!