headless icon indicating copy to clipboard operation
headless copied to clipboard

No categories in Standard CEs

Open bernhardberger opened this issue 2 years ago • 4 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior: Create a CE (doesn't seem to matter which, tried Images and File Links) and add Categories image

API doesn't output any categories, just an empty string. image

Expected behavior To get Categories in any form

TYPO3 version and TYPO3 Headless version TYPO3 12.4.8, EXT:headless 4.2.3

bernhardberger avatar Dec 16 '23 11:12 bernhardberger

@bernhardberger Where are your category records stored?

schloram avatar Dec 18 '23 11:12 schloram

Not on pid=0.

I figured it out that the TS select only gets categories from the root pid. Not sure if that's a good default tbh, especially for sites with multi tree.

bernhardberger avatar Dec 18 '23 11:12 bernhardberger

@bernhardberger Yes that is he issue here. Even though the TYPO3 Documentation has an example to get categories from root I don't think it's ideal since you might want to have different categories for different site roots.

In this case it would be better to use pidInList = leveluid : 0 with recursive imho. But since this would ignore the records from root (page uid 0) completely you would be better of overriding lib.contentElement.fields.categories with these changes yourself.

Another approach would be using pidInList = root with recursive to get every category from the root and below.

schloram avatar Dec 18 '23 12:12 schloram

I think it needs to be specified per project, but we can think of better default setting. @schloram approach with pidInList = root and recursive sounds good for starting point.

lukaszuznanski avatar Jan 03 '24 09:01 lukaszuznanski