1

When I get a CategoryGroup with the following

$category = craft()->categories->getGroupByHandle('productEnvironment');

I Just can't figure out how to get the categories inside this category.
Is-there any kind of relation/method ?

Thanks

Nicolas

1

I've found that it was not the best way to to it.
I used the following code and it cleared my problem.

$criteria = craft()->elements->getCriteria(ElementType::Category);
$criteria->group = 'productEnvironment';
$entries = $criteria->find();

foreach ($entries as $entry) {
    echo $entry->title . '<br>';
    echo $entry->mountingPreview[0] . '<br>'; // Dirty get the first assets
}

Hope this helps someone

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.