[SOLVED] Convert Plugin URL to SEO URL


(Patric Eckhart) #1

Hey guys,

How can I convert an Plugin URL to an SEO friendly URL?

This:
albumlist.html?–flickr_photogallery-albumlist%5B%40package%5D=flickr.photogallery&–flickr_photogallery-albumlist%5B%40controller%5D=flickr&–flickr_photogallery-albumlist%5B%40action%5D=photosinline&–flickr_photogallery-albumlist%5B%40format%5D=html&–flickr_photogallery-albumlist%5BalbumId%5D=72157683441489642

should be:
albumlist/photos/72157683441489642

I’ve tried this but it does not work.


(Christian Schwahn) #2

Hi, can you give an example Routes.yaml you tried?


(Christian Schwahn) #3

if you are using NeosDemo Package i think it should be something like this:

## Add this part at top in Neos Configuration/Settings.yaml
#-
#  name: 'Neos.Demo'
#  uriPattern: '<ProductSubroutes>'
#  subRoutes:
#    'ProductSubroutes':
#      package: 'Neos.Demo'

## Add this part at your plugin Configuration/Settings.yaml
-
  name: 'Show Route'
  uriPattern: '{node}/photos/{--flickr_photogallery-albumlist.albumId}'
  defaults:
    '@package': 'TYPO3.Neos'
    '@controller': 'Frontend\Node'
    '@format': 'html'
    '@action': 'show'
    '--flickr_photogallery-albumlist':
      '@package': 'Neos.Demo'
      '@controller': 'Flickr'
      '@action': 'tagStream'
      '@format': 'html'

(Patric Eckhart) #4

Thank you Christian!

This is my Plugins Routes.yaml, but it does not work

-
name: 'Photos Route'
uriPattern: '{node}/photos/{--flickr_photogallery-albumlist.albumId}'
defaults:
  '@package': 'Flickr.Photogallery'
  '@controller': 'Frontend\Node'
  '@format': 'html'
  '@action': 'show'
  '--flickr_photogallery-albumlist':
    '@package': 'Flickr.Photogallery'
    '@controller': 'Flickr'
    '@action': 'albumList'
    '@format': 'html'

(Christian Schwahn) #5

As i can see on git package:

albumList does not get arguments like albumId.

Maybe you should change the action to the photos or photosInline action.


-
name: 'Photos Route'
uriPattern: '{node}/photos/{--flickr_photogallery-albumlist.albumId}'
defaults:
  '@package': 'Flickr.Photogallery'
  '@controller': 'Frontend\Node'
  '@format': 'html'
  '@action': 'show'
  '--flickr_photogallery-albumlist':
    '@package': 'Flickr.Photogallery'
    '@controller': 'Flickr'
    '@action': 'photos'
    '@format': 'html'


(Patric Eckhart) #6

I have changed, but it does not work :frowning:


(Christian Schwahn) #7

Seems so like this is because you dont use/need a model or repository but a plugin with Flickr connection. so this is not a normal case. you have to try out a little bit …

maybe you have to asign the actual albumId in the controller photoAction … or something like this


(Patric Eckhart) #8

Thank you Christian!

I’ve find a solution:

-
name: 'Photos Route'
uriPattern: '{node}/photos/{--flickr_photogallery-albumlist.albumId}'
defaults:
  '@package': 'Neos.Neos'
  '@controller': 'Frontend\Node'
  '@format': 'html'
  '@action': 'show'
  '--flickr_photogallery-albumlist':
    '@package': 'Flickr.Photogallery'
    '@controller': 'Flickr'
    '@action': 'photosInline'
    '@format': 'html'
routeParts:
  node:
    handler: Neos\Neos\Routing\FrontendNodeRoutePartHandler
appendExceedingArguments: 'true'

(Christian Schwahn) #9

Great Job!