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

URL routing Enhance for TYPO3 9.5.x #28

Closed GhanshyamBhava closed 3 years ago

GhanshyamBhava commented 4 years ago

I have configured almost all the YAML configuration for the pretty URL and it working great. I tried to create a configuration for the filter, but its not working at all. Will you please add configuration for the same?

SicorDev commented 4 years ago

Hi, can we have a look at your YAML configuration, please?

GhanshyamBhava commented 4 years ago

I had URL below while clicking on the alpha charecter: tx_sicaddress_sicaddress%5Baction%5D=search&tx_sicaddress_sicaddress%5Bcontroller%5D=Address&cHash=2f3404b194ac91a81f9a4d2a95d61656

So according to this, I have added below YAML configuration:

SicAddressDetail:
         type: Extbase
         extension: SicAddress
         plugin: Sicaddress
         routes:
               - { routePath: '/', _controller: 'Address::search', _arguments: {'search': 'search'} }
        defaultController: 'Address::list'

If I pass routPath, this will lead to 404, Hope this helps you.

morange commented 4 years ago

Hello, i'm using sic_address with the filter a-z. That works great. I would like to use the TYPO3 URL routing for sic_address. Do you have an example for me?

kuchi62 commented 4 years ago

Hi, spend a lot of Time with this routing theme...without success. I get always Error 'Invalid Argument Name' if I use the Pagination.

Here is my last Version: routeEnhancers: SicAddress: type: Extbase extension: SicAddress plugin: sicaddress routes:

Best Regards.

SicorDev commented 4 years ago

We've been working on this and possibly found a solution for friendly A-Z links.

Step 1: Replace the A-Z links in your List Template with a Typolinik logic like this:

<f:comment><!-- check if single character or "all" option --></f:comment>
<f:if condition="{value.character} == {value.character -> f:format.crop(maxCharacters:1, append:'')}">
    <f:then>
        <f:link.action class="lifelink" action="search" arguments="{atoz:value.character}">{value.character}</f:link.action><span class="divoc">|</span>
    </f:then>
    <f:else>
        <f:link.page class="lifelink">{value.character}</f:link.page><span class="divoc">|</span>
    </f:else>
</f:if>

Step 2: Try this yaml snippet:

  SicAddress:
    type: Extbase
    extension: SicAddress
    plugin: sicaddress
    routes:
      -
        routePath: '/{atoz}'
        _controller: 'Address::search'
        _arguments:
          atoz: 'atoz'
    defaultController: 'Address::list'
    aspects:
      atoz:
        type: StaticRangeMapper
        start: 'A'
        end: 'Z'

Please let me know how this works for you. In case you're happy with this, I'm planing on providing a standardized A-Z partial, to ease the process in the future.

SicorDev commented 4 years ago

I just uploaded version 3.1.0 to TER, which contains a routing-ready A-Z partial which you can use in your templates.