TYPO3-Headless / headless

TYPO3 Headless JSON API providing content for PWA application (e.g. javaScript apps like nuxt-typo3)
https://t3headless.io
GNU General Public License v2.0
159 stars 60 forks source link

Menu content elements don't output rendered tt_content JSON #655

Closed schloram closed 9 months ago

schloram commented 1 year ago

Describe the bug The following Menu content elements return the plain data array for each content element in the menu object:

To Reproduce Steps to reproduce the behavior:

  1. Go to the Backend and add one of the above listed content elements to a page.
  2. Select the Categories/Pages to output content from.
  3. View the rendered JSON of the page.
  4. See that inside each object of the menu array the content fields are rendered as is without content rendering definition of tt_content.

Expected behavior Each content element JSON should be rendered as defined in tt_content.* with all sub-fields.

Screenshots If applicable, add screenshots to help explain your problem.

TYPO3 version and TYPO3 Headless version TYPO3: 12.4.6 Headless: 4.1.1

Additional context Add any other information related to the problem here.

Navdeep-Nitsan commented 11 months ago

Hey @schloram,

I'm facing this same issues so what i have done. I have just copy and pest the entire typoscript for the menu items and override in my extension

`tt_content.menu_categorized_content >
tt_content.menu_categorized_content =< lib.contentElementWithHeader
tt_content.menu_categorized_content {
    fields {
        content {
            fields {
                menu = TEXT
                menu {
                    dataProcessing {
                        10 = FriendsOfTYPO3\Headless\DataProcessing\DatabaseQueryProcessor
                        10 {
                            table = tt_content
                            selectFields = {#tt_content}.*
                            groupBy = uid
                            pidInList.data = leveluid : 0
                            recursive = 99
                            join {
                                data = field:selected_categories
                                wrap = {#sys_category_record_mm} ON uid = {#sys_category_record_mm}.{#uid_foreign} AND {#sys_category_record_mm}.{#uid_local} IN(|)
                            }

                            where {
                                data = field:category_field
                                wrap = {#tablenames}='tt_content' and {#fieldname}='|'
                            }

                            orderBy = tt_content.sorting
                            as = menu
                            dataProcessing {
                                10 = FriendsOfTYPO3\Headless\DataProcessing\FilesProcessor
                                10 {
                                    references.fieldName = image
                                    as = media
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}`

And just put one extra line above headless extension typoscript "tt_content.menu_categorized_content >"

and it's working fine.

it's working fine. But i'm not satisfied with this solutions according to headless it should be work without override typoscript.

Thanks

lukaszuznanski commented 9 months ago

Closing as should be solved by #655 by now. Please reopen if this issue is still a thing.