Forum
perch_content_custom Not Displaying
Hi
I've coded 100's of perch_content_custom
but for some reason cannot for the life of me get this one to work.
I have a region on the home page called Success Stories
.
I want to bring that content onto another page so have...
perch_content_custom('Success Stories', [
'page'=>'/index.php',
'template'=>'success_stories_banner.html',
'sort'=>'success_stories_user_name',
'sort-order'=>'RAND',
'count'=>1
]);
...The perch_custom_content
isn't outputting anything from the success_stories_banner.html
template, nor are there any errors?
Any pointers would be much appreciated.
Diagnostic
Perch: 3.0.8, PHP: 7.0.15, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.8), assets (3.0.8), categories (3.0.8), perch_blog (5.6.1), perch_forms (1.9)
App runtimes: <?php $apps_list = [ 'perch_forms', 'perch_blog', ];
PERCH_LOGINPATH: /cms
PERCH_PATH: /home/supreme/433S5G0O/htdocs/cms
PERCH_CORE: /home/supreme/433S5G0O/htdocs/cms/core
PERCH_RESFILEPATH: /home/supreme/433S5G0O/htdocs/cms/resources
Image manipulation: GD Imagick
PHP limits: Max upload 128M, Max POST 128M, Memory: 256M, Total max file upload: 128M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
HTTP_HOST: supreme-windows.co.uk
DOCUMENT_ROOT: /home/supreme/433S5G0O/htdocs/
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Debug from front-end page...
Debug Message - Perch 3.0.8
[21] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
[1] SELECT * FROM perch3_pages WHERE pagePath='/windows-and-doors/timber-windows.php' LIMIT 1
Using template: /templates/pages/attributes/seo.html
Using template: /templates/pages/attributes/facebook.html
Using template: /templates/pages/attributes/twitter.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch3_pages WHERE pagePath='/windows-and-doors' OR pageSortPath='/windows-and-doors' LIMIT 1
[7] SELECT * FROM perch3_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-002%' AND pageDepth >=1 AND pageDepth<=2 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch3_pages WHERE pagePath='/windows-and-doors/timber-windows.php' LIMIT 1
[2] SELECT pageID FROM perch3_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
[6] Using template: /templates/navigation/item.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch3_pages WHERE pagePath='/glazed-living-area' OR pageSortPath='/glazed-living-area' LIMIT 1
[5] SELECT * FROM perch3_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-003%' AND pageDepth >=1 AND pageDepth<=2 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch3_pages WHERE pagePath='/windows-and-doors/timber-windows.php' LIMIT 1
[2] SELECT pageID FROM perch3_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
[4] Using template: /templates/navigation/item.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch3_pages WHERE pagePath='/sliding-and-bifold-doors' OR pageSortPath='/sliding-and-bifold-doors' LIMIT 1
[3] SELECT * FROM perch3_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-004%' AND pageDepth >=1 AND pageDepth<=2 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch3_pages WHERE pagePath='/windows-and-doors/timber-windows.php' LIMIT 1
[2] SELECT pageID FROM perch3_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
[2] Using template: /templates/navigation/item.html
[10] SELECT regionKey, regionHTML FROM perch3_content_regions WHERE regionPage='/windows-and-doors/timber-windows.php' OR regionPage='*' ORDER BY regionPage DESC
[1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch3_content_regions WHERE regionKey='Success Stories' AND (regionPage='/index.php' OR regionPage='*')
[nil] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch3_content_index idx JOIN perch3_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch3_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='success_stories_user_name' WHERE ((idx.regionID=13 AND idx.itemRev=20)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY RAND() LIMIT 0, 1
Using template: /templates/content/success_stories_banner.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch3_pages WHERE pagePath='/windows-and-doors' OR pageSortPath='/windows-and-doors' LIMIT 1
[7] SELECT * FROM perch3_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-002%' AND pageDepth >=1 AND pageDepth<=2 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch3_pages WHERE pagePath='/windows-and-doors/timber-windows.php' LIMIT 1
[2] SELECT pageID FROM perch3_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
[6] Using template: /templates/navigation/footer_nav.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch3_pages WHERE pagePath='/glazed-living-area' OR pageSortPath='/glazed-living-area' LIMIT 1
[5] SELECT * FROM perch3_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-003%' AND pageDepth >=1 AND pageDepth<=2 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch3_pages WHERE pagePath='/windows-and-doors/timber-windows.php' LIMIT 1
[2] SELECT pageID FROM perch3_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
[4] Using template: /templates/navigation/footer_nav.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch3_pages WHERE pagePath='/sliding-and-bifold-doors' OR pageSortPath='/sliding-and-bifold-doors' LIMIT 1
[3] SELECT * FROM perch3_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-004%' AND pageDepth >=1 AND pageDepth<=2 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch3_pages WHERE pagePath='/windows-and-doors/timber-windows.php' LIMIT 1
[2] SELECT pageID FROM perch3_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
[2] Using template: /templates/navigation/footer_nav.html
Ignore me - I was using a repeater.
Changed it to multi-region and hey presto!
Where's the coffee?