Forum

Thread tagged as: Question, Problem

filter perch_content_custom

Hi, I need help please. I require filter for real estate by mode: rent or sale, here is the function:

perch_content_custom('Properties', array(
    'template' => 'properties.html',
    'filter' => 'mode',
    'match' => 'contains',
    'value' => 'rent'

my template is:

<perch:content id="mode" type="select" label="mode" options="sale, rent" required="true" />

Thanks!

alex s

alex s 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

What problem are you experiencing? Your perch_content_custom function is not complete but I don't know if that is just a copy and paste error.

alex s

alex s 0 points

Thank you Rachel, The filter does not work and I assure you that is not a problem of copy and paste, I probably missing some parameter.

regards.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

The function in your original post is incomplete, so no it won't work. You are missing closing brackets. Is this how it is in your code?

If that is not how it is in your code then please let us know what is in your code, and what isn't working. Is it displaying all of the items, or none of the items? Are you getting an error? "Does not work" doesn't help me to help you.

To get help we need to see:

  • the accurate code
  • what you expected to happen
  • what actually is happening
alex s

alex s 0 points

No! 1.- my function is:

<?php perch_content_custom('Properties', array(
    'template' => 'properties.html',
    'filter' => 'mode',
    'match' => 'contains',
    'value' => 'rent'
));
?>

2.- show properties for rent 3.- shows nothing

Thanks Rachel.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Instead of

'match' => 'contains',

try

'match' => 'eq',