Forum
Related blog posts not working
I've being checking this post and It don't output anything at:
perch_blog_post_categories(perch_get('s'));
and it output Array()
at
print_r(perch_blog_post_categories(perch_get('s'), array('skip-template'=>true)));
Debug Message
[1] SELECT * FROM perch2_blog_posts WHERE postStatus='Published' AND postDateTime<='2016-02-28 10:37:00' AND postSlug='probandolo'
[22] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
[1] SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC
[1] SELECT * FROM perch2_blogs ORDER BY blogTitle ASC
Using template: /templates/blog/post.html
Using sub-template: /templates/blog/post-form.html
[1] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch2_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='_id' WHERE 1=1 AND ((idx.indexKey='postSlug' AND idx.indexValue='probandolo')) AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue ) as tbl WHERE (postStatus='Published' AND postDateTime<='2016-02-28 10:37:00' ) GROUP BY itemID, sortval ORDER BY sortval ASC LIMIT 0, 10
[1] SELECT FOUND_ROWS() AS `count`
[1] Using template: /templates/blog/slugblog.html
[3] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/viaje.php' OR regionPage='*' ORDER BY regionPage DESC
[1] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch2_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='_id' WHERE 1=1 AND ((idx.indexKey='postSlug' AND idx.indexValue='probandolo')) AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue ) as tbl WHERE (postStatus='Published' AND postDateTime<='2016-02-28 10:37:00' ) GROUP BY itemID, sortval ORDER BY sortval ASC LIMIT 0, 10
[1] SELECT FOUND_ROWS() AS `count`
[1] Using template: /templates/blog/post.html
[2] Using sub-template: /templates/blog/post-form.html
Fetching from cache: perch_blog_post_categories0de041f4abb7c49c3ee005bf9bbac8e3
Caching: perch_blog_post_categories0de041f4abb7c49c3ee005bf9bbac8e3
Fetching from cache: perch_blog_post_categories9d886013b1e484b3e7fbbda010cb4af4
Cache file not found: perch_blog_post_categories9d886013b1e484b3e7fbbda010cb4af4
[] Using template: /templates/blog/category.html
Summary information
Perch: 2.8.25, PHP: 5.4.4, MySQL: 5.5.25, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.8.25), assets (2.8.25), categories (2.8.25), perch_blog (5.0), perch_forms (1.8.3)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /Applications/MAMP/htdocs/eurovacaciones.es/perch
PERCH_CORE: /Applications/MAMP/htdocs/eurovacaciones.es/perch/core
PERCH_RESFILEPATH: /Applications/MAMP/htdocs/eurovacaciones.es/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 64M, Total max file upload: 32M
F1: dc1fef2ad0fcd9f943c02ebb43d85dbc
Resource folder writeable: Yes
HTTP_HOST: eurovacaciones:8888
DOCUMENT_ROOT: /Applications/MAMP/htdocs/eurovacaciones.es
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
What's the value of
s
on your query string?Drew, you mean in the url of a post?
Yes - you're using
perch_get('s')
.what do you want me to do Drew?
From the errors you showed me, there's clearly some sort of cache issue. So try disabling the cache, either in the options or by putting your site into development mode (which would be a good idea anyway, since you're developing).
Now I am running on development mode. Clean cache and this are Debug Message
related posts still not showing Drew... This are my categories on post.html
From that it doesn't look like you have any categories in the set
blog
. How many are there?I created two different sets outside blog. How can I use those sets instead of blog one?
What ID does your categories field have?
I use two kind of categories
Ok, in that case the built in Blog category functions aren't going to help you in the current version. You'll need to use the standard Categories app functions.
Sorry but I don't get it Drew. Can you explain me that?
Thanks for your time. Support is awesome
I don't have a solution for you, I'm afraid.
Then what it means...
I mean these: https://docs.grabaperch.com/docs/categories/page-functions/