schumiel
schumiel

Reputation: 51

TYPO3 typeNum with speaking url

The type is always specified as follows:

www.domain.com/?type=123456

However, I would like to pass this along with a speaking URL.

www.domain.com/123456

I assumed that was possible. But I couldn't find anything about routeEnhanced in the TYPO3 documentation.

My target is to use it to return a JSON.

My question, how do I get the "type" in a speaking URL?

Upvotes: 1

Views: 148

Answers (1)

Wolffc
Wolffc

Reputation: 1260

you would use the RouteEnhander of type PageType

in your case you would create a map of

        map:
            /: 0
            '123456': 123456

but i would argue that its better to map it to somthing meaningufll

        map:
            /: 0
            '/print.html': 123456

https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Routing/AdvancedRoutingConfiguration.html#routing-pagetype-decorator

Upvotes: 2

Related Questions