1
votes

I have a small extension with a custom content element. Having a list and detail view.

Before i configured the route enhancers i had a url like this.
https://www.domain.de/index.php?id=9&tx_gfseminare_[uid]=1&tx_gfseminare_[action]=show&tx_gfseminare_[controller]=Standard
Here i could access the url parameters easily with

data = GP:tx_gfseminare_|uid

After the setup of the routeenhancer the url looks like following.
https://www.domain.de/personal-coaching/workshops/ipsum-dolor-sit-amet-consectetuer-adipiscing-elit-1

routeEnhancers:
  GfSeminare:
    type: Extbase
    extension: GfSeminare
    plugin: ''
    routes:
      - routePath: '{titel}'
        _controller: 'Standard::show'
        _arguments:
          titel: 'seminar'
    aspects:
      titel:
        type: PersistedAliasMapper
        tableName: 'tx_gfseminare_kurse'
        routeFieldName: 'tx_gfseminare_slug'

But i can not access the url-parameters anymore.

How can i access GET/POST-Parameters within typoscript?

Thanks in advance Niels

UPDATE:
I tried following with no result: GP:tx_myext_uid,GP:tx_myext_[uid],GP:tx_myext_seminar,GP:tx_myext_[seminar],GP:tx_myext_|seminar,GP:tx_myext_|[seminar],GP:tx_myext_|uid,GP:tx_myext|uid,GP:tx_myext|seminar. Also combination with or without tx_ and so on. I never get any output

UPDATE (27.01.2020):
If i set plugin: Show in the route enhancer i get an output if i browse a old beautified url like https://mydomain.de/personal-coaching/workshops/ipsum-dolor-sit-amet-consectetuer-adipiscing-elit-1 with GP:tx_gfseminare_|seminar.
But now the urls get not beautified! I get normal URLs with parameters https://mydomain.de/personal-coaching/workshops?tx_gfseminare_%5Baction%5D=show&tx_gfseminare_%5Bcontroller%5D=Standard&tx_gfseminare_%5Bseminar%5D=3&cHash=9fd0c7039c8cfc3bf14da57f45791fdb

In summary:

  • With "plugin: Show" -> result(browse an old beautified url) but no beautified urls anymore (normal parameters appended at url)
  • With "plugin: ''" -> beautified urls but no result anymore

Also tried plugin: Pi1 with no result.
I´m totally frustrated because with TYPO3 8.x this was a 5 minute thing. Now i tried many many hours with no result for such an easy thing. Also the manual describe many variants but no variant with an easy content element (where i have an reduced extension configuration). Maybe this is the problem. I don´t know. ATM i deactivated the route enhancer, have url with parameters but it works.
Hopefully anyone has an idea which works.

2
Same problem for me in a case to test and document new introduced routing. - jokumer
are you tried to do like this data = GP:tx_myext_uid or data = GP:tx_myext_[uid]? - TYPO3UA
I tried many variants. E.g. GP:tx_myext_uid,GP:tx_myext_[uid],GP:tx_myext_seminar,GP:tx_myext_[seminar],GP:tx_myext_|seminar,GP:tx_myext_|[seminar],GP:tx_myext_|uid,GP:tx_myext|uid,GP:tx_myext|seminar. Also combination with or without tx_ and so on. I never get any output. - ntiedt

2 Answers

0
votes

With your config, the uid will be in the GET-variable 'tx_myext_[seminar]'.

0
votes

I have tested this just for fun and I can access the GET parameters pretty easy from my custom extension in TYPO3 9.5.11 with this example code in the setup:

page.80 = TEXT
page.80.data = gp:tx_eventlist_show|event

page.90 = TEXT
page.90.data = gp:tx_eventlist_show|action

// Output for 'https://panama-traveller.com/events/show/panama-jazz-festival-5': 
// 5 show 

And here's my route enhancer setup:

EventsShowPlugin:
        type: Extbase
        extension: Eventlist
        plugin: Show
        routes:
          -
            routePath: '/{event_title}'
            _controller: 'Event::show'
            _arguments:
              event_title: event
        defaultController: 'Event::list'
        defaults:
            page: '0'
        requirements:
            page: '\d+'
            event_title: '^[a-zA-Z0-9].*$'
        aspects:
            event_title:
                type: PersistedPatternMapper
                tableName: tx_eventlist_domain_model_event
                routeFieldPattern: '^(?P<slug>.+)-(?P<uid>\d+)$'
                routeFieldResult: '{slug}-{uid}'