Forum
Storing output as a variable
Hi, I need to do some logic an output that already has been processed by logic in the templates. I try to store it as a variable, but nothing is outputed. I know i can use the skip-template option, but that would not filter the content correctly. The output should be a simple string.
Here is the code:
$filteredlinkarray = perch_content_custom('Link Builder', array(
'filter'=>'campaign.url_id',
'match'=>'eq',
'value'=>$uniqueurl,
'raw' => 'true'
));
print_r($filteredlinkarray);
echo($filteredlinkarray);
If I am understanding the question correctly you need to add "true" as a third parameter.
There is also the ability to add a callback function - that's detailed in the docs: https://docs.grabaperch.com/docs/content/perch-content-custom/