Hi all
I am developing a plugin to display links to others categories in a menu.
I have a custom field for each category with no formatting, where I enter the categories names of categories I want to link to separated by a comma.
In my template I explode the string to get the different names and pass the parameter to the plugin:
<?php
// check for related articles //
$Rel_Art ="{embed:Rel_Art}";
if($Rel_Art !="") {
$rel_art_array = explode (',', $Rel_Art);
for ($i = 0; $i <count($rel_art_array); $i++){
$relation = $rel_art_array[$i];
?>
{exp:cat_relations:get_relations relation='<?php echo $relation ?>' url='{site}index.php/'}
<?php
}
} ?>Then my function in the pi file queries the database to find a category that matches this parameter. But I don’t get any results. However if I hardcode the parameter value, it works, so the query is right.
The problem is in this relation parameter, but when echoing it also looks fine.
Is there anything I am missing on my php or any EE peculiarity here?
Thank you