[TYPO3-english] Categories list from sys_categories
Matt Clough
matt at lubs.leeds.ac.uk
Fri Apr 24 16:44:27 CEST 2015
Hi All,
I have created a simple staff profile system, where each member of staff can be categorized using the built in system categories using makeCategorizable()
Extract from model:
class Profile extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* Categories
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
* @lazy
*/
protected $categories = NULL;
/**
* Returns the categories
*
* @return \TYPO3\CMS\Extbase\Domain\Model\Category $categories
*/
public function getCategories() {
return $this->categories;
}
}
I don't have a separate model/repository for categories. The above seems to work fine.
What I would like to be able to do is create a menu of categories, but only show the categories used by the profiles and not categories with no associated profiles.
Is this possible, how could I do this?
Thanks
Matt
More information about the TYPO3-english
mailing list