SicorDev / sic_address

Public repository of the TYPO3 extension sic_address from
https://www.sicor-kdl.net/
GNU General Public License v3.0
3 stars 7 forks source link

Route Enhancer with URL to show details #53

Closed Hobokens closed 1 year ago

Hobokens commented 1 year ago

TYPO3 10.4.32, sic_address 3.2, tt_address 5.3

Hi,

I use sic_address in combination with tt_address. Now I try without success to extend the proposed route enhancer (#28) to get a nice URL for the show view

SicAddressPlugin:
    type: Extbase
    extension: SicAddress
    plugin: sicaddress
    routes:
      -
        routePath: '/{atoz}'
        _controller: 'Address::search'
        _arguments:
          atoz: atoz
      -
        routePath: '/{address_slug}'
        _controller: 'Address::show'
        _arguments:
          `address_slug:`  address

    defaultController: 'Address::list'
    aspects:
      atoz:
        type: StaticRangeMapper
        start: A
        end: Z
      address_slug:
        type: PersistedAliasMapper
        tableName: tt_address
        routeFieldName: slug

Right now the URL: https://www.my-domain.de/lehre?tx_sicaddress_sicaddress%5Baction%5D=show&tx_sicaddress_sicaddress%5Baddress%5D=227&tx_sicaddress_sicaddress%5Bcontroller%5D=Address&tx_sicaddress_sicaddress%5BlistPageUid%5D=39&cHash=f1c8ae54730cc48115a56ac1a5c057d0

is shortened to

https://www.my-domain.de/lehre/lastname-firstname?tx_sicaddress_sicaddress[listPageUid]=39&cHash=51754d0ae0593b16c0fca5bc02181427

How do I get rid of cHashand tx_sicaddress_sicaddress[listPageUid]=39?

Thanks for any help!

morange commented 1 year ago

Hej Hobokens, that are my route for sic_address:

`# SIC_ADDRESS SicAddress: type: Extbase extension: SicAddress plugin: sicaddress routes:

    routePath: '/page/{page}'
    _controller: 'Address::list'
    _arguments:
      page: '@widget_0/currentPage'
  -
    routePath: '/{atoz}'
    _controller: 'Address::search'
    _arguments:
      atoz: atoz
  -
    routePath: 'page/{page}/atoz/{atoz}'
    _controller: 'Address::search'
    _arguments:
      page: '@widget_0/currentPage'
      atoz: atoz
  -
    routePath: '/{sic_address_slug}'
    _controller: 'Address::show'
    _arguments:
      sic_address_slug: address
defaultController: 'Address::list'
defaults:
  page:                    '0'
requirements:
  page:                    '\d+'
  atoz: '[A-Za-z]|Alle'
aspects:
  sic_address_slug:
    type: PersistedPatternMapper
    tableName: tt_address
    routeFieldPattern: '^(?P<slug>.+)-(?P<uid>\d+)$'
    routeFieldResult: '{slug}-{uid}'
  atoz:
    type: StaticRangeMapper
    start: A
    end: Z
  page:
    type: StaticRangeMapper
    start: '1'
    end: '100'

SIC_ADDRESS END`

Best greetings

Hobokens commented 1 year ago

Hi @morange , Thanks a lot for your response. There was big discussion in slack, where I asked the same question some days before because I didn't expect an quick answer here.

https://typo3.slack.com/archives/C024TUMM7/p1671518240211929

My aim is to have an URL just with the lastname and surname without any added number for the listPageUid. Then I would have the same URL with sic_address as with tt_address. This is important to avoid confusion of the users.

SicorDev commented 1 year ago

Hello, did you manage to solve this?

SicorDev commented 1 year ago

Closed for now.