Forum

Thread tagged as: Question, Discussion, Forum
Drew McLellan

Drew McLellan 2638 points
Perch Support

That looks fine. Can you add debug to your page and let me know what it outputs?

alex s

alex s 0 points

on page filter.php:

DIAGNOSTICS:
SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Propiedades' AND (regionPage='/propiedades/filter.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='7' AND idx.itemRev='0')) AND ((idx.indexKey='modalidad-u-operacion' AND idx.indexValue='venta')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev
) as tbl GROUP BY itemID ORDER BY sortval ASC
Using template: /templates/content/lista.html
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Using template: /templates/forms/property_filter.html
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, that looks good. Do you have content you'd expect it to match?

alex s

alex s 0 points

a list of properties that match the search terms. Thanks Drew.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does the list display with no filters applied?

alex s

alex s 0 points

Hi Drew, displays the list of all properties.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you manually filter it successfully?

alex s

alex s 0 points

and how it could do so?.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Just add a filter to your code by hand.

alex s

alex s 0 points

Done, but not filtered anything.

<?php
perch_content_custom('Propiedades', array(
    'template' => 'lista.html',
    'page'  => '/propiedades/lista.php',
    'filter' => 'tipo-de-propiedad',
    'match' => 'eq',
        'value' => 'casa',
    'count'=>4
));
?>
Drew McLellan

Drew McLellan 2638 points
Perch Support

Which version of Perch are you using?

alex s

alex s 0 points

Perch 2.6.3

Drew McLellan

Drew McLellan 2638 points
Perch Support

That should be fine then.

Do you have items where tipo-de-propiedad is set to casa ?

alex s

alex s 0 points

I translate it to make it more clear: tipo-de-propiedad (type-of-property) is a Category, casa (house) is a set.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. How many items do you expect it to return?

alex s

alex s 0 points

two items.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm unsure how to help further.

alex s

alex s 0 points

I understand, I feel that we were almost there, thank you very much.