Hello,
I have two questions, is there a way to neither select INPUT or OUTPUT for PHP code and instead make it so the page is parsed all at the same time? I think most likely not so my second question is…
I’m having an issue trying to get dynamic information with EE code and storing it into a PHP array. Basically I have a string in {segment_3} and I’m using PHP to explode it into an array (they are values that are variable). Now I’m loop these values (to do all of them) and using each value to run an EE query with the subcategories plugin (this isn’t a plugin question). Then I need to store the values that the EE query gives me back to another PHP array.
So here is my code:
<?
//get count of total sub filters
$count = 0;
//put {segment_3} into an array1
$rootnodes = explode("|", "{segment_3}");
$checkboxes = array();
//loop exp:subcategories with each item in array1
$count = 0;
foreach ($rootnodes as $i)
{
{exp:subcategories count_entries_with_status="open" count_entries_from_weblogs="5" root_node="$i"}
//store into array2
$checkboxes[$count]['id'] = "{category_id}";
$checkboxes[$count]['name'] = "{category_name}";
$checkboxes[$count]['count'] = "{entries_count}";
{/exp:subcategories}
$count++;
}unset($i);
?>
So the {exp:subcategories…} takes the $i from the foreach loop. Then my $checkboxes array takes the {category_id} and other data from the {exp:subcategories…} output.
So you see how I need a mixed order for PHP and EE code.
Any ideas or something? Thanks
P.S. I’m not really clear if my questions should be in Tech Support or “How-to”, please advise because the forum descriptions aren’t clear.
