[FEATURE] Add categories DataProcessor
With this DataProcessor we can get rid of the chunky categories TypoScript. Plus this one is easier to re-use.
Additionally to that I also re-formatted the output of the categories since we always thought that the comma-separated list is unnecessary if the data is already structured. The frontend always had to split the string into an array themselves (we never could use the string as is). This is why I also changes the output from comma-separated list to an array of objects in the following format:
"categories": [
{
"id": 3,
"title": "Test Category 1"
},
{
"id": 4,
"title": "Test Category 2"
},
{
"id": 7,
"title": "Test Category 3"
}
]
Example usage (get categories by relation record):
categories = JSON
categories {
dataProcessing {
10 = headless-categories
10 {
relation.fieldName = categories
as = categories
}
}
}
Example usage (get categories by comma-separated-list of category ids):
categories = JSON
categories {
dataProcessing {
10 = headless-categories
10 {
categoryIdList = 1,3,5
as = categories
}
}
}
Hi, please fix codestyle and tests and we can merge it then :)
Pull Request Test Coverage Report for Build 7250772858
- 0 of 0 changed or added relevant lines in 0 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage remained the same at 64.231%
| Totals | |
|---|---|
| Change from base Build 7196892465: | 0.0% |
| Covered Lines: | 835 |
| Relevant Lines: | 1300 |