We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Blog

Categories Not Showing in Sidebar

I'm currently experiencing something weird with Categories showing up in my sidebar. The categories showed up in the sidebar two days ago. Then yesterday morning they didn't show up. I started messing with my sidebar and they showed up again all day yesterday. This morning I opened my site and they are gone again. But I haven't changed any of the underlying code related to the sidebar. I utilize a similar code for my tags and they have continue to show up in the sidebar regardless.

In my sidebar I'm using the following code so the sidebar shows all categories regardless of what post I'm on.

<?php perch_blog_categories('category.html'); ?>

In my sidebar I'm using the following code for tags and it works perfectly everytime

<?php perch_blog_tags('tags.html'); ?> 

Here is the code in the category.html which is in my templates/blog folder


<perch:before><ul class="list-unstyled"></perch:before> <li><a href="archive.php?cat=<perch:category id="catSlug" />"><perch:category id="catTitle" /> </a></li> <perch:after></ul></perch:after>

When I view the source of the live code the section is blank.

Any help would be appreciated. I'm new to Perch and have gotten most things to work properly, but categories showing up then not showing up when I haven't touched the code is weird to me. I think I've looked at it to long at this point so another set of eyes might be helpful.

Matt Holovach

Matt Holovach 0 points

  • 4 years ago
Simon Clay

Simon Clay 127 points

Hi Matt,

You perhaps should use this to call the arguments correctly:

<?php
    perch_blog_categories(array(
        'template' => 'category.html',
    ));
?>
Simon Clay

Simon Clay 127 points

It might also be worth adding this to perch/config/config.php to stop Perch 'caching' Blog posts (remember to remove it when going live, to make perch more efficient).

define('PERCH_PRODUCTION_MODE', PERCH_DEVELOPMENT);

Simon thank you for your quick responses and thank you for correcting my syntax.

  • The perch production mode wasn't showing in my config file
  • I added the correct coding to the sidebar and still nothing is showing

Do you think that the problem is related to this post? http://forum.grabaperch.com/forum/04-19-2016-blog-categories-not-updating

Drew McLellan

Drew McLellan 2638 points
Perch Support

Could you post your diagnostics report?

Here it is

Perch: 2.8.29
Production mode: Production (100)
Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29), perch_blog (5.0), perch_comments (1.2), perch_backup (1.2)
DB driver: PDO
DB tables: perch2_blog_authors (1), perch2_blog_comments (2), perch2_blog_index (168), perch2_blog_posts (2), perch2_blog_posts_to_tags (6), perch2_blog_sections (1), perch2_blog_tags (6), perch2_blogs (1), perch2_categories (4), perch2_category_counts (0), perch2_category_sets (1), perch2_comments (0), perch2_comments_votes (0), perch2_content_index (0), perch2_content_items (0), perch2_content_regions (0), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (0), perch2_pages (1), perch2_resource_log (9), perch2_resource_tags (1), perch2_resources (16), perch2_resources_to_tags (2), perch2_scheduled_tasks (1), perch2_settings (26), perch2_user_passwords (0), perch2_user_privileges (37), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (1)
Users: 1
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_blog'
    );
Scheduled tasks for perch_comments: delete_spam_comments (1440 mins)
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup
H1: 1f5ff38967af9e8be8c53b0a8ca0436e
L1: d6cf89fb242d0bbc0a6f884de1540ee8
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.29: done
latest_version: 2.8.15
on_sale_version: 2.8.29
perch_blog_update: 5.0.1
perch_blog_post_url: /blog/{postSlug}
headerScheme: light
perch_blog_slug_format: {postTitle}-%m-%Y
perch_blog_max_spam_days: 60
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_blog_comment_notify: 0
logoPath: /_cms/resources/logo3.png
perch_comments_max_spam_days: 0
perch_blog_site_name: Colorado SEO Design
perch_backup_mysqldump_path:
perch_comments_akismet_key: e6f1feec8ab4
perch_blog_akismet_key: e6f1feec8ab4
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: colorado_matt
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: colorado_seoblog
PERCH_DB_PREFIX: perch2_
PERCH_TZ: America/Denver
PERCH_EMAIL_FROM: matt@coloradoseodesign.com
PERCH_EMAIL_FROM_NAME: Matt Holovach
PERCH_LOGINPATH: /_cms
PERCH_PATH: /home/coloradoseodesig/public_html/_cms
PERCH_CORE: /home/coloradoseodesig/public_html/_cms/core
PERCH_RESFILEPATH: /home/coloradoseodesig/public_html/_cms/resources
PERCH_RESPATH: /_cms/resources
PERCH_HTML5: 1
PERCH_SCHEDULE_SECRET: holovach
PERCH_RUNWAY:
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_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/coloradoseodesig/public_html/_cms/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_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS

PHP: 5.6.21
Zend: 2.6.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: 5.5.48-37.8
MySQL server: 5.5.48-37.8
Free disk space: 66.35 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, SPL, iconv, session, intl, json, mbstring, mcrypt, mssql, mysql, mysqli, odbc, standard, PDO, pdo_mysql, pdo_sqlite, Phar, posix, pspell, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, imagick, SourceGuardian, mhash, ionCube Loader, Zend Guard Loader
GD: Yes
ImageMagick: Yes
PHP max upload size: 64M
PHP max form post size: 64M
PHP memory limit: 256M
Total max uploadable file size: 64M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
DOCUMENT_ROOT: /home/coloradoseodesig/public_html
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,fr;q=0.6
HTTP_CONNECTION: close
HTTP_COOKIE: _ga=GA1.2.1889332262.1465143909; cmsa=1; PHPSESSID=62309367b1754e1a25fea5ffd4653346
HTTP_HOST: www.coloradoseodesign.com
HTTP_REFERER: http://www.coloradoseodesign.com/_cms/core/settings/diagnostics/
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36
HTTP_X_HTTP_PROTO: HTTP/1.1
HTTP_X_LOG_7812: 8.44.152.33
HTTP_X_REAL_IP: 8.44.152.33
PATH: /bin:/usr/bin
PHPRC: /home/coloradoseodesig
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 8.44.152.33
REMOTE_PORT: 47343
REQUEST_METHOD: GET
REQUEST_URI: /_cms/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home/coloradoseodesig/public_html/_cms/core/settings/diagnostics/index.php
SCRIPT_NAME: /_cms/core/settings/diagnostics/index.php
SERVER_ADDR: 50.87.153.154
SERVER_ADMIN: webmaster@coloradoseodesign.com
SERVER_NAME: www.coloradoseodesign.com
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SIGNATURE: <address>Apache Server at www.coloradoseodesign.com Port 80</address>
SERVER_SOFTWARE: Apache
UNIQUE_ID: V18b7DJXmGkAAKpRf08AAACN
PHP_SELF: /_cms/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1465850860.27
REQUEST_TIME: 1465850860
argc: 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

It looks like you're still in Production mode, so you'll still be getting those 10 minute category caches.

Did you try switching to Development mode like Simon suggested?

I'm obviously not understanding because the development code option above isn't showing in my config file? I'm sorry but I'm a newbie and still learning Perch.

I believe you are referring to this code: PERCH_PRODUCTION_MODE: 100 but I don't know how to change it?

Simon Clay

Simon Clay 127 points

Hi no probs, add this line to the bottom of the perch/config/config.php file.

define('PERCH_PRODUCTION_MODE', PERCH_DEVELOPMENT);

It may not solve the problem, but it will stop Perch form caching the Blog every 10 minutes, so you know where you stand.

Simon Thank you I have added that to the config file but the category still aren't showing up.

Drew had mentioned in a previous a forum question that this may be an issue with categories http://forum.grabaperch.com/forum/04-19-2016-blog-categories-not-updating . I'm wondering if that is the reason the categories aren't showing up? If the answer is yes that is the problem I can just comment the code out and when the issue is fixed I will just comment it back in.

My main issue is I want to confirm that it isn't something wrong with my code. The interesting thing is the categories show when I'm in an individual post and I call for the post categories option, but not when I'm calling for the generic all categories in my sidebar.

Simon Clay

Simon Clay 127 points

Hi Matt, does it work if you use this in your perch/templates/blog/category.html template? There were a few tags missed off in your code:

<perch:before><ul class="list-unstyled"></perch:before>
    <li>
        <a href="archive.php?cat=<perch:category id="catSlug" type="slug" for="catTitle" order="2" />">
            <perch:category id="catTitle" type="smarttext" label="Title" required="true" order="1" />
        </a>
    </li>
<perch:after></ul></perch:after>
Simon Clay

Simon Clay 127 points

Edit: I just updated the code above.

Simon,

Thanks again for your help and I updated the code to match but still struck out.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What problem are you now seeing?

Drew,

The problem is the same it hasn't changed I'm not able to pull up the categories listing on my index page or my posts page. When on the posts page I can get the individual categories for that post but not all of the categories used.

I was wondering if it was this issue http://forum.grabaperch.com/forum/04-19-2016-blog-categories-not-updating .

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, it could be that issue.

Okay cool then I will just comment out the code and wait for it to be fixed.

Do you have an ETA or a way to communicate your fix with me so I know when to go back in and try again?

Thanks and have a great day.