Forum

Thread tagged as: Question, Configuration, Runway

Categories in Runway

Hi,

I want to filter my collection by a category, i have the below as part of my collection template

<perch:categories id="service" label="Type of case study" set="service" required="true" />
<perch:content id="url_service" type="slug" for="service" urlify="true" />

And im using this as part of my url

<perch:content id="url_service" type="slug" urlify="true" />

I have also set my route us as follows

case-studies/[slug:service]/[slug:client]

Now this i think works fine apart from the slug in the url is out putting as

/case-studies/ra-d41d-cd98/test

and not the category title, i guess its stored as this but i need to request it in another way?

If i hard code my category into my url and hard on my page with

    perch_collection('Case Studies', [
        'filter' => 'url_client',
        'value' => perch_get('client'),
        'category' => 'service/ra-d41d-cd98',

    ]);

this all works.

any ideas.

thanks in advance.

Steve Forbes

Steve Forbes 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

This is wrong: ra-d41d-cd98

Can you show me your diagnostics report?

PERCH INFORMATION

Perch: 2.7.10
Production mode: Production (100)
Installed apps: content (2.7.10), assets (2.7.10), categories (2.7.10), perch_blog (4.5.4), collection_10 (2.7.10), perch_forms (1.8.2), perch_members (1.1)
DB driver: PDO
DB tables: perch2_backup_plans, perch2_backup_resources, perch2_backup_runs, perch2_blog_authors, perch2_blog_comments, perch2_blog_index, perch2_blog_posts, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_collection_index, perch2_collection_items, perch2_collection_revisions, perch2_collections, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_forms, perch2_forms_responses, perch2_members, perch2_members_forms, perch2_members_member_tags, perch2_members_sessions, perch2_members_tags, perch2_navigation, perch2_navigation_pages, perch2_page_routes, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 1
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_forms',
        'perch_blog',
        'perch_members',
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup
H1: 41885de45a8c2bb15eec6df54920c775
L1: 4b5e5ef6373497e96f9bbaa83a990b6e
headerColour: rgb(54,54,54)
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.7.8: done
headerScheme: dark
latest_version: 2.7.10
on_sale_version: 2.7.10
perch_blog_update: 5.0
perch_blog_post_url: /blog/post.php?s={postSlug}
update_2.7.10: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_SITEPATH: /var/www/vhosts/calico-uk.com/new.calico-uk.com
PERCH_SCHEDULE_SECRET: NRRN0bxaUgODlkDD
PERCH_DB_USERNAME: dbuser_runway
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: db_mars
PERCH_DB_PREFIX: perch2_
PERCH_EMAIL_FROM: dan@calico-uk.com
PERCH_EMAIL_FROM_NAME: Dan King
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/www/vhosts/calico-uk.com/new.calico-uk.com/perch
PERCH_CORE: /var/www/vhosts/calico-uk.com/new.calico-uk.com/perch/core
PERCH_RESFILEPATH: /var/www/vhosts/calico-uk.com/new.calico-uk.com/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_TZ: UTC
PERCH_DEBUG: 1
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_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /var/www/vhosts/calico-uk.com/new.calico-uk.com/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS

PHP: 5.4.13
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: 5.5.30
MySQL server: 5.5.30
Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, sockets, mbstring, tokenizer, xml, cgi-fcgi, curl, dom, fileinfo, gd, imap, json, ldap, exif, mcrypt, mysql, mysqli, odbc, PDO, pdo_mysql, PDO_ODBC, pdo_sqlite, Phar, snmp, sqlite3, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, mhash, ionCube Loader
GD: Yes
ImageMagick: No
PHP max upload size: 20M
PHP max form post size: 20M
PHP memory limit: 128M
Total max uploadable file size: 20M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
PATH: /sbin:/usr/sbin:/bin:/usr/bin
PP_CUSTOM_PHP_INI: /var/www/vhosts/system/new.calico-uk.com/etc/php.ini
PP_CUSTOM_PHP_CGI_INDEX: fastcgi
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.0
GATEWAY_INTERFACE: CGI/1.1
REMOTE_PORT: 49514
SCRIPT_FILENAME: /var/www/vhosts/calico-uk.com/new.calico-uk.com/perch/core/settings/diagnostics/index.php
SERVER_ADMIN: christian@calico-uk.com
DOCUMENT_ROOT: /var/www/vhosts/calico-uk.com/new.calico-uk.com
REMOTE_ADDR: 31.54.6.188
SERVER_PORT: 80
SERVER_ADDR: 205.186.137.39
SERVER_NAME: new.calico-uk.com
SERVER_SOFTWARE: Apache
SERVER_SIGNATURE: <address>Apache Server at new.calico-uk.com Port 80</address>
HTTP_COOKIE: __utma=16924331.123532273.1390828804.1393407972.1395412233.9; hb_95655=fv%3A1414421901%7Clv%3A1414421901%7Clf%3A0%7Cnv%3A1%7Cpu%3Ahttp%3A//new.calico-uk.com/%7Cdt%3A2014-10-27%7Cts%3A1414421901%7Cdv%3Acomputer%5E; hbv_95655=fv%3A1417621537%7Clv%3A1421499642%7Clf%3A45%7Cnv%3A350%7Cpu%3A/%7Cdt%3A2015-01-17%7Cdv%3Acomputer%7Cls%3A25; hbs_95655=; __unam=f9318fa-1478169f668-551e704f-39; cmssb=0; p_m=b28a76a958bb240351f9c98bfda5bd716c02e58c; _ga=GA1.2.123532273.1390828804; PHPSESSID=2rufdl02intdtfseo3k076nfo3; cmsa=1
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_REFERER: https://new.calico-uk.com/perch/core/settings/diagnostics/
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_CONNECTION: close
HTTP_X_ACCEL_INTERNAL: /internal-nginx-static-location
HTTP_X_FORWARDED_FOR: 31.54.6.188
HTTP_X_REAL_IP: 31.54.6.188
HTTP_HOST: new.calico-uk.com
FCGI_ROLE: RESPONDER
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1423835929.1743
REQUEST_TIME: 1423835929
Drew McLellan

Drew McLellan 2638 points
Perch Support

What's the name of your category?

For some reason the slug isn't being correctly generated on your server.

Odd, The set is Service and the cat is Corporate Identity

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are all your slugs doing the same thing?

yes all the category slugs.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is your hosting configurable? You don't have the Transliterator extension available in PHP at the moment. That's not required, but it may help in this situation.

I host with Mediatemple so i can take a look.

can you point me in the right direction of what i might do?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I've not used MediaTemple, so I'm not sure. Is there somewhere you can select optional PHP extensions?

I can look into this, i believe there is however. Is there anything else i should also check?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I can't think of anything that should cause this issue, to be honest.

Media Temple, have referenced this. any thoughts. I guess nobody else is seeing this issue?

media temple response:

If you are able to use the "Transliterator" as described on php.net: https://php.net/manual/en/class.transliterator.php

You should be able to just include the class into your current scripts and implement it that way.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, great, that's what we need.

can you point me in the right direction of what i should do? appreciate your out the country.

Drew McLellan

Drew McLellan 2638 points
Perch Support

If they've enabled the transliteration functions, do you now see it in the diagnostics report?

Ok, nope Transliteration functions: No

So you guys have already included the class in your scripts then i assume?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's an extension to PHP. Perch uses it if it's available on the server.

ok so i've manually gone about adding it, this seemed to go ok but i although i believe i have added it to the php.ini i did get this during install, see 4th line.

Build process completed successfully
Installing '/usr/lib64/php/modules/translit.so'
install ok: channel://pecl.php.net/translit-0.6.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=translit.so" to php.ini

i also created a phpinfo.php file which you can see here https://new.calico-uk.com/phpinfo.php and this lists translit as enabled.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, great. Is it showing up now?