2016-01-31, 14:00:57
Really trying to understand this plugin as it seems perfect for my project. I'm looking to output some items to a page based on criteria and for the life of me cannot figure out how to filter the items on a custom field.
This is what i have so far for my code:
When i print i can see the array with my items in them but i can not get an output from that array. I know i'm just missing something silly as it works with i just init the category.
Some insight would be great on how i can use a filtered list of items.
This is what i have so far for my code:
Code:
<?php
$manager = new IManager();
$item = $manager->getItemClass();
// Initialize all the items of category 2
$item->init(2);
$myitems = $item->getItems("single=1");
print_r($myitems);
if($myitems->items)
{
foreach($myitems->items as $myitems)
{
echo'
<div class="row bottom-border">
<div class="c4"><strong>' .$myitems->name . '</strong><br />' .$myitems->fields->descr->value . '</div>
<div class="c2 text-center">$' .$myitems->fields->small->value . '</div>
<div class="c2 text-center">$' .$myitems->fields->medium->value . '</div>
<div class="c2 text-center">$' .$myitems->fields->large->value . '</div>
<div class="c2 text-center">$' .$myitems->fields->xlarge->value . '</div>
</div>
';
};
};
?>
Some insight would be great on how i can use a filtered list of items.
Keeping it simple means making progress!!