Forum

Thread tagged as: Problem, Blog

Perch_blog_custom not outputting anything

Hi,

I'm using the following page code:

    <?php perch_blog_custom(array( 'count'=> 1, 'template' => 'post_in_list_front_page.html', 'category' => 'news', 'sort' => 'postDateTime', 'sort-order' => 'DESC' )); ?>

with the template:

<div class="latest-news">
    <h3>Latest News</h3>
    <h4>
        <a href="/blog/post.php?s=<perch:blog id='postSlug' type='text' />">
            <perch:blog id="postTitle" type="text" />
        </a>
    </h4>
</div>

and my diagnostic report is:

SUMMARY INFORMATION

Perch: 2.8.7, PHP: 5.6.7-1+deb.sury.org~utopic+1, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO Server OS: Linux, fpm-fcgi Installed apps: content (2.8.7), assets (2.8.7), categories (2.8.7), perch_blog (4.6), perch_forms (1.8.3), perch_gallery (2.8.6) App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_gallery/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_forms/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php'); ?> PERCH_LOGINPATH: /perch PERCH_PATH: /home/vagrant/Sites/dev.planetfurniture/perch PERCH_CORE: /home/vagrant/Sites/dev.planetfurniture/perch/core PERCH_RESFILEPATH: /home/vagrant/Sites/dev.planetfurniture/perch/resources Image manipulation: GD PHP limits: Max upload 100M, Max POST 8M, Memory: 512M, Total max file upload: 8M Resource folder writeable: Yes SCRIPT_NAME: /perch/core/settings/diagnostics/index.php REQUEST_URI: /perch/core/settings/diagnostics/ DOCUMENT_ROOT: /home/vagrant/Sites/dev.planetfurniture HTTP_HOST: planetfurniture.dev:8000

Adam Menczykowski

Adam Menczykowski 1 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

The first thing to do is ensure you are running the latest version of Perch.

If the problem still exists add debug to the page and let us know what it outputs.

Thanks Rachel,

I updated to latest version, then enabled debug after it still isn't outputting any data.

Debug Message
SELECT * FROM perch2_pages WHERE pagePath='/index.php' LIMIT 1
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
SELECT DISTINCT idx.itemID FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' AND (idx.indexKey='_category' AND idx.indexValue LIKE 'blog/news/%' OR idx.indexKey='_category' AND idx.indexValue='blog/news/')
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='postDateTime' AND idx.itemID IN (NULL) WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID ) as tbl WHERE (postStatus='Published' AND postDateTime<='2015-07-24 12:22:00' ) GROUP BY itemID ORDER BY sortval DESC LIMIT 0, 1
SELECT FOUND_ROWS() AS `count`
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Using template: /templates/blog/post_in_list_front_page.html
SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/index.php' OR regionPage='*' ORDER BY regionPage DESC
SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Social Icons' AND (regionPage='/index.php' OR regionPage='*')
SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=21 AND idx.itemRev=17)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID ORDER BY sortval ASC
Using template: /templates/content/social-links-svg.html
Drew McLellan

Drew McLellan 2638 points
Perch Support

Replace:

<perch:blog id='postSlug' type='text' />

with

<perch:blog id="postSlug" type="text" />

Seems that I hadn't update the App structure since 2.7, Namely the post.html file to contain the category select. Thanks for your advice.