Search

Hi,

Can anyone advise me on a good approach to ensuring a unique URL with handles? I have a site in which I lazily set the URLs to /section/$id/, but I'm in the process of upgrading it and I'd like to produce better URLs.

I'd like to have /section/$handle-$id/, but it looks like params can't be concatenated like this. Alternatively, I could use a unique handle alone, but I know there are duplicate titles, so the default handle won't work.

It looks like there's a unique text input extension, but it doesn't seem to be current. Also, it'd be good to avoid more extensions.

If anyone can tell me know they've dealt with this, that would be very helpful.

While I'm here :)

Assuming something like the above can be achieved, is there a good solution to redirecting the old URLs?

I've briefly tried out URL Router, but it looks like it can only work with params that are there in the original URL (i.e. it can redirect /a/$id/ to /b/$id/, but it can't get entry values to add in e.g. $handle).

Any thoughts would be welcome.

Thanks, Fish

You could use the Reflection field yo create the single value and then filter on this.

Some more thoughts are in this thread.

The unique text input still works

Thanks for the suggestions. I think a reflection field to concatenate the id and handle might be the easiest thing to do, so I'll give that a go.

If I do though, there's still the problem of redirecting the old section/$id URLs. Since the handle string isn't there to parse, I assume URL Router isn't going to work. I'm guessing this will need some custom approach to query the DB for the handle, but any suggestions would be appreciated.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details