I have a thirdparty component which stores its categories in #__categories
table.
-----+----------------+-----------------------+-----------------------+-----
... | extension | title | alias | ...
-----+----------------+-----------------------+-----------------------+-----
... | com_content | Uncategorised | uncategorised | ...
-----+----------------+-----------------------+-----------------------+-----
... | com_banners | Sample Data-Banners | sample-data-banners | ...
-----+----------------+-----------------------+-----------------------+-----
... | com_newsfeeds | Sample Data-Newsfeeds | sample-data-newsfeeds | ...
-----+----------------+-----------------------+-----------------------+-----
... | com_contact | Sample Data-Contact | sample-data-contact | ...
-----+----------------+-----------------------+-----------------------+-----
... | com_content | Joomla! | joomla | ...
-----+----------------+-----------------------+-----------------------+-----
... | com_thirdparty | ThirdParty Category | thridparty-category | ...
-----+----------------+-----------------------+-----------------------+-----
... | ... | ... | ... | ...
-----+----------------+-----------------------+-----------------------+-----
I can print categories from com_banners
or from other core components as below,
$categories = JCategories::getInstance('Banners');
$subCategories = $categories->get()->getChildren(true);
print_r($subCategories);
But it shows
"Fatal error: Class 'ThirdPartyCategories' not found in ...\libraries\legacy\categories\categories.php on line 152"
when trying to print the categories of another extension as below,
$categories = JCategories::getInstance('ThirdParty');
$subCategories = $categories->get()->getChildren(true);
print_r($subCategories);
What do I have to do with the legacy categories in joomla libraries ?
Note: The name
ThirdParty
is just a placeholder, could be any third party extension's name.
ThirdParty
the actual name of the component?