Open ste101 opened 5 years ago
A detailed description in your bug report... "I am not able to use these categories" is not a bug
Sorry for the short description. As I wrote it is not possible to use categories in the frontend out of the box.
It would be neccesarry to add some code if you have checked the option 'Enable categorization' like this:
diff -ru test.orig/Classes/Controller/TestController.php test/Classes/Controller/TestController.php
--- test.orig/Classes/Controller/TestController.php 2019-04-20 22:16:58.000000000 +0200
+++ test/Classes/Controller/TestController.php 2019-04-20 22:36:39.000000000 +0200
@@ -18,6 +18,14 @@
class TestController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
/**
+ * CategoryRepository
+ *
+ * @var \TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository
+ * @inject
+ */
+ protected $categoryRepository = null;
+
+ /**
* testRepository
*
* @var \SB\Test\Domain\Repository\TestRepository
diff -ru test.orig/Classes/Domain/Model/Test.php test/Classes/Domain/Model/Test.php
--- test.orig/Classes/Domain/Model/Test.php 2019-04-20 22:16:58.000000000 +0200
+++ test/Classes/Domain/Model/Test.php 2019-04-20 22:37:32.000000000 +0200
@@ -18,6 +18,14 @@
class Test extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
+ * categories
+ *
+ * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
+ * @lazy
+ */
+ protected $categories = null;
+
+ /**
* test
*
* @var string
@@ -25,6 +33,27 @@
protected $test = '';
/**
+ * Get categories
+ *
+ * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
+ */
+ public function getCategories()
+ {
+ return $this->categories;
+ }
+
+ /**
+ * Set categories
+ *
+ * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $categories
+ * @return void
+ */
+ public function setCategories($categories)
+ {
+ $this->categories = $categories;
+ }
+
+ /**
I tried to make a patch but I wasn't able to find the right places.
I'm not shure if it is neccesary to add a class mapping in ext_typoscript_setup.txt
like this:
config.tx_extbase {
persistence {
classes {
SAM\FtsProducts\Domain\Model\Category {
mapping {
recordType = 0
tableName = sys_category
}
}
}
}
}
With the option 'Enable categorization?' I can use categories in the backend but I am not able to use these categories in fluid out of the box.
What is missing?