-
- 236 Posts
Hi there,
I'm hoping someone can help me out with this, I'm looking to get friendly urls working with the Gallery component.
My urls currently look like this:
/portfolios/?galAlbum=fashion
/portfolios/?galAlbum=events
Ideally I'd like to get them like this:
/portfolios/fashion/
/portfolios/events/
Also, I wondered if Gallery support for aliases would be a useful request? I'm currently pulling 'fashion' and 'events' from the album description.
Any help much appreciated.
Thanks
-
- 77 Posts
did you get this fixed?
I also need the same solution.
10x
-
- 236 Posts
Hi,
No I didn't figure anything out but I'm working on a gallery right now and need to implement this. I'll post back here and let you know how I get on.
Don't think that's natively supported by Gallery. You should be able to manually make the links as you want them (for example with your name or description - I'd advice using the "urlencode" output filter to sanitize it for URLs), and use something like this to properly point it to the page:
RewriteRule ^portfolios/([^/]+)/$ portfolios/?galAlbum=$1 [L,QSA]
(untested, but did something similar for a different use case)
Make sure you put that before the "friendly urls" part of the .htaccess file.
Rewrite rules don't change your URLs - they only map a certain request to somewhere else.
You'll need to create (hardcode) the links yourself in the Gallery template chunks.
For example:
<a href="/folios/[[+id]]/">[[+name]]</a>
The rewrite stuff will then map the /folios/2/ to folios.html?galAlbum=2, providing the Gallery snippets with the data it needs to display what you requested.
-
- 236 Posts
Oh wow, I can't believe I've just spent so long stumped on that, I've done that bit before too. Face to palm required. Thanks Mark, I'll post the solution when I've got it fully working.
Thanks for posting your solution!