Forum

Thread tagged as: Question, Problem, Runway

Runway search pagination not working

I have a perch runway site with a search form and paging enabled in the search-results.html template, but when you click on the next_url it goes to /search.php?page=2 and not /search.php?q=QUERY&page=2. This causes the page to display no results.

Is this something that can routed in perch runway or is there a different way of doing it? I will attach my diagnostics and templates in use.

Should also mention i'm running the latest version of runway and all apps in use

Thanks!

Search.php

<?php
                    $search = perch_get('q');
                    perch_content_search($search, array(
                        'count' => 10
                    ));
?>

Search-form.html

<perch:form id="search" method="get" action="../search.php">
    <div class="search_form">
        <perch:input type="search" id="q" placeholder="Search Site" />
        <perch:input type="submit" value=" " class="search_button" />
    </div>
</perch:form>

Search-results.html

<perch:before>
    <h1>Search results for &#8220;<perch:search id="search_key" />&#8221;</h1>

    <perch:if exists="paging">
        <p><perch:search id="total" /> results</p>
    </perch:if>

    <ul class="search">
</perch:before>

<li class="<perch:search id="perch_item_odd" />">
    <h2><a href="<perch:search id="result_url" />"><perch:search id="result_title" /></a></h2>

    <perch:if exists="result_excerpt">
        <p>&hellip;<perch:search id="result_excerpt" encode="false" />&hellip;</p>
    </perch:if>
</li>

<perch:after>
    </ul>

    <perch:if exists="paging">
        <div class="paging">
            <perch:if exists="not_first_page">
                <a class="link next" href="<perch:search id="prev_url" encode="false" />">Previous</a>
            </perch:if>

            Page <perch:search id="current_page" /> of <perch:search id="number_of_pages" />

            <perch:if exists="not_last_page">
                <a class="link next" href="<perch:search id="next_url" encode="false" />">Next</a>
            </perch:if>
        </div>
    </perch:if>
</perch:after>

<perch:noresults>
    <perch:if exists="search_key">
        <h1>Search results for &#8220;<perch:search id="search_key" />&#8221;</h1>
    <perch:else />
        <h1>Search</h1>
    </perch:if>
    <perch:if exists="search_key">
        <p>Sorry, there are no results for &#8220;<perch:search id="search_key" />&#8221;.</p>
    </perch:if>
</perch:noresults>

Diagnostics

Perch Runway: 3.1.2
Production mode: Production (100)
Installed apps: content (3.1.2), assets (3.1.2), categories (3.1.2), perch_blog (5.6.1), perch_forms (1.12)
DB driver: PDO
DB tables: perch2_backup_plans (0), perch2_backup_resources (0), perch2_backup_runs (0), perch2_blog_authors (4), perch2_blog_comments (0), perch2_blog_index (445), perch2_blog_posts (6), perch2_blog_posts_to_tags (0), perch2_blog_sections (1), perch2_blog_tags (0), perch2_blog_webmention_queue (0), perch2_blogs (1), perch2_categories (6), perch2_category_counts (5), perch2_category_sets (2), perch2_collection_index (3460), perch2_collection_items (273), perch2_collection_revisions (84), perch2_collections (3), perch2_content_index (13704), perch2_content_items (1312), perch2_content_locks (0), perch2_content_regions (341), perch2_forms (5), perch2_forms_responses (65), perch2_menu_items (10), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_routes (23), perch2_page_templates (12), perch2_pages (62), perch2_resource_log (863), perch2_resource_tags (28), perch2_resources (556), perch2_resources_to_tags (56), perch2_settings (27), perch2_user_passwords (2), perch2_user_privileges (45), perch2_user_role_buckets (0), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (5)
Users: 5
App runtimes:
<?php
    $apps_list = [ 
        'perch_blog',
        'perch_forms',
    ];
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins), publish_posts (1 mins), process_webmentions (1 mins)
Editor plug-ins: _ckeditor, ckeditor
H1: 00107c3d5e402c3ea3134ca1cb000021
L1: 2d867af9d415c6af77642c22d913763b
F1: 3b606135b33e6a102526838f4152a807
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.31: done
latest_version:
on_sale_version:
update_runway_2.8.31: done
perch_blog_update: 5.6
perch_blog_post_url: /news-and-views/{postSlug}
headerScheme: light
perch_blog_site_name:
perch_blog_slug_format: {postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_blog_comment_notify: 0
update_runway_2.8.34: done
update_runway_3.1.1: done
update_runway_3.1.2: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_DATABASE: ewestage_lebc
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: charlie.crossland@ewe.agency
PERCH_EMAIL_FROM_NAME: Charlie Crossland
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/Xland/Desktop/lebc/perch
PERCH_CORE: /Users/Xland/Desktop/lebc/perch/core
PERCH_RESFILEPATH: /Users/Xland/Desktop/lebc/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_MAP_JS: ../../webroot/js/perch_map.js
PERCH_GMAPS_API_KEY: AIzaSyDHzEdFhb0DNwIdjYM7YM1JLTcf9YVg4qA&callback=initMap
PERCH_RWD: 1
PERCH_DEBUG: 1
PERCH_SITEPATH: /
PERCH_RUNWAY: 1
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_ASSET_VERSION: 6738d5d5f5664f7c5e34
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/Xland/Desktop/lebc/perch/templates
PERCH_TEMPLATE_FILTERS:
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_XHTML_MARKUP:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_DEFAULT_BUCKET: default
PERCH_TRANSLATION_ASSIST:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_PRIV_ASSIST:
PERCH_CUSTOM_EDITOR_CONFIGS:
PERCH_ENABLE_EXIF: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: markdown
Hosting settings
PHP: 5.4.45
Zend: 2.4.0
OS: Darwin
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $
MySQL server: 5.7.21
Free disk space: 1.48 TB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, mysqli, PDO, pdo_mysql, pdo_sqlite, apc, posix, Reflection, mysql, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, cgi-fcgi, Phar, imap, gettext, mcrypt, pgsql, pdo_pgsql, igbinary, memcached
GD: Yes
ImageMagick: No
PHP max upload size: 32M
PHP max form post size: 32M
PHP memory limit: 128M
Total max uploadable file size: 32M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
PHP_FCGI_CHILDREN: 4
PWD: /Applications/MAMP/fcgi-bin
PHP_FCGI_MAX_REQUESTS: 200
__CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x2
ORIG_SCRIPT_NAME: /fcgi-bin/php5.4.45.fcgi
ORIG_PATH_TRANSLATED: /Users/Xland/Desktop/lebc/perch/core/settings/diagnostics/index.php
ORIG_PATH_INFO: /perch/core/settings/diagnostics/index.php
ORIG_SCRIPT_FILENAME: /Applications/MAMP/fcgi-bin/php5.4.45.fcgi
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/?extended
QUERY_STRING: extended
REQUEST_METHOD: GET
SERVER_PROTOCOL: HTTP/1.1
GATEWAY_INTERFACE: CGI/1.1
REDIRECT_URL: /perch/core/settings/diagnostics/index.php
REDIRECT_QUERY_STRING: extended
REMOTE_PORT: 52127
SCRIPT_FILENAME: /Users/Xland/Desktop/lebc/perch/core/settings/diagnostics/index.php
SERVER_ADMIN: you@example.com
DOCUMENT_ROOT: /Users/Xland/Desktop/lebc
REMOTE_ADDR: ::1
SERVER_PORT: 80
SERVER_ADDR: ::1
SERVER_NAME: lebc
SERVER_SOFTWARE: Apache
PATH: /usr/bin:/bin:/usr/sbin:/sbin
HTTP_COOKIE: cmsa=1; __utma=268180755.68263474.1536746178.1536746178.1536746178.1; __utmc=268180755; __utmz=268180755.1536746178.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); cookieconsent_status=dismiss; _ga=GA1.1.68263474.1536746178; _gid=GA1.1.556878979.1537779792; PHPSESSID=f500196de1e203b85495457784853caf
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.9,de;q=0.8,la;q=0.7
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_REFERER: https://lebc/perch/core/settings/diagnostics/
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_CONNECTION: keep-alive
HTTP_HOST: lebc
REDIRECT_STATUS: 200
REDIRECT_HANDLER: php-fastcgi
REDIRECT_TZ: Europe/London
FCGI_ROLE: RESPONDER
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1537785393.18
REQUEST_TIME: 1537785393
argc: 1
ewe agency

ewe agency 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What does your route for this page look like?

There is no route for the search page in the routes panel, should there be?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Maybe not. Is the search master page in your templates/pages folder?

No there is no search master template only search.php in the root folder of the website. I've checked the latest download of perch runway and there is no search master template in there either

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ideally you don't want to be working with files in the root of the website, you should use master pages.

Okay i've moved my search.php page over to a master template and removed the runway call as it should be done automatically.

Then I put

<?php include(str_replace('/', DIRECTORY_SEPARATOR, '../perch/templates/pages/search.php')); ?>

in the search.php in place of the file in the root of the site but when you search something it returns a blank page.

Should the action being called on the search form be different now the search page is a master page?

No pages should be placed at root when using Runway. No include should be created in root to replace the page you removed. In Runway all pages which have perch content should be in master templates and not be placed in root.

Okay i've got it working now, you guys were right. I created a new page and used the search.php master template and then referenced that in the search form action and all works now!

Thank you