Forum

Thread tagged as: Problem

perch custom content start

I have following code:

<?php
include('perch/runtime.php');
perch_layout('global.header');
perch_content('Content');
perch_content_custom('Akcie', array(
    'page' => '/akcie-archiv.php',
    'template' => '/akcie-archiv/akcieSlider.html',
    'paginate' => false,
    'count' => 3,
));
perch_content_custom('Akcie', array(
    'page' => '/akcie-archiv.php',
    'template' => '/akcie-archiv/akciePlanovane.html',
    'paginate' => false,
    'count' => 4,
    'start' => 3,


));

PerchUtil::output_debug();

perch_layout('global.footer');
?>

firstly i showing first 3 articles in slider then need show 3 others articles with other template but start=3 not working and i showing two times same artices..

DEBUG MESSAGE:

Debug Message
SELECT * FROM perch2_pages WHERE pagePath='/akcie.php' LIMIT 1
Using template: /templates/pages/attributes/seo.html
SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/akcie.php' OR regionPage='*' ORDER BY regionPage DESC
SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Akcie' AND (regionPage='/akcie-archiv.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=17 AND idx.itemRev=17)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval ORDER BY sortval ASC LIMIT 0, 3
SELECT FOUND_ROWS() AS `count`
Using template: /templates/content//akcie-archiv/akcieSlider.html
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=17 AND idx.itemRev=17)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval ORDER BY sortval ASC LIMIT 0, 4
SELECT FOUND_ROWS() AS `count`
Using template: /templates/content//akcie-archiv/akciePlanovane.html
Pavol Krchnavy

Pavol Krchnavy 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

That does look like it should work, so it's likely to be a bug of some sort.

I've logged it and we'll take a look and see what's happening.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I've tracked this down, so it should be fixed in the next release.

In the meantime, you can get around your problem by removing the paginate option rather than setting it to false.

Sorry to say this still seems to be an issue (I am not using pagination).

Possibly not in perch_content_custom; but certainly in perch_blog_custom.