Route Enhancer Configuration, when working with Extbase and Yoast

181 views Asked by At

Since I have created a route enhancer for single view entries of one of our typo3 extensions, the title and description fields are no longer being processed to the frontend. <title></title> consists only of the page title instead of the record title and <meta name="description" .../> is missing completely. If I remove the route enhancer SeminarSingleView, the links are ugly again, but the tags are filled correctly.

Typo3 9.5.14

Yoast 6.0.1

Here is the part from the config.yaml that deals with route enhancing:

routeEnhancers:
  PageTypeSuffix:
    type: PageType
    default : ''
    map:
      sitemap.xml: 1533906435
      yoast-snippetpreview.json: 1480321830
  SeminarSingleView:
    type: Extbase
    limitToPages: [62,142]
    namespace: the_namespace
    routes:
      - { routePath: '/{url_slug}', _controller: 'Product::show', _arguments: {'url_slug' : 'product'}  }
    defaultController: 'Product::show'
    aspects:
      url_slug:
        type: PersistedAliasMapper
        tableName: 'the_table'
        routeFieldName: 'speaking_url'

The route enhancer itself works like a charm. Is there anything missing that I do not see? I've read through these two:

https://wiki.sebkln.de/doku.php?id=typo3:yoast_seo

https://docs.typo3.org/p/yoast-seo-for-typo3/yoast_seo/6.0/en-us/Index.html

but could not find information that struck me as useful. Any ideas? I can and will obviously provide more information if needed. The line yoast-snippetpreview.json: 1480321830 is new and was part of my attempt to fix the problem. But it only fixed the preview in the backend. A problem no one had realized yet existed.

1

There are 1 answers

0
ChriK On BEST ANSWER

We were able to fix the problem at long last.

The culprit was some deprecated Typoscript in the extension's setup.ts, so the problem did hinge on the update from 8.7.x to 9.5.x.

[globalVar = GP:tx_extension_tablename|field > 0]

had to be replaced with

[request.getQueryParams()['tx_extension_tablename']['field'] > 0]

The change itself is documented here: https://www.nitsan.in/blog/all-you-need-to-know-about-typoscript-conditions-with-symfony-expression-language/#c2419