url_alias - what if you need to change the name? Link rot?

Author Message

David Goddard

Tuesday 19 April 2005 7:20:31 am

Hi,

Firstly, I'm quite new to eZ publish, but so far I've been really impressed. Well in eZ crew!

One feature I'm a bit worried about is the url_alias. It is great to have friendly urls but:

* content editors might, for example, need to tweak the name of an article after it has been published - this will change the url and therefore break any links to the article from external sites (unless someone manually puts in some virtual url forwarding)

* some article names might be very long. This leads to fairly ugly and difficult to type urls.

Because of this I'm wondering about modifying existing classes so that they have an additional Text Line attribute along the lines of 'Title' which could hold the human readable title of an object, and use that attribute in content views, and reserve the Name attribute for the generation of urls. Content editors could then be allowed to change the title as needs be without changing the url, and they could also choose a sensible abbreviation of the title for use as the name and therefore in the url.

I'm aware this means rewriting some template code, replacing in Content Views:

{$node.name}

with

{$node.data_map.title.content}

What do people think? Would I be setting myself up for a fall later down the line?

Thanks for feedback / opinions

David

David Goddard

Tuesday 19 April 2005 7:34:22 am

Ah! Ignore the above. I suspect this is exactly why the Article class has the 'short title' attribute and the Folder class has the 'short name' class which are used first in the object name pattern.

Bård Farstad

Wednesday 20 April 2005 3:57:54 am

Hi David,

welcome to the eZ community!

The first part of your question regarding breaking links. If you change the name of an object then eZ publish will keep the old URL and forward this (using HTTP MOVED headers) so that e.g. google updates it's search index and users find the content, even after it has been removed.

The actual object name is what's deciding the URL alias, this can be configured in the class setup. As you mention the default article class already utilized this, as an option.

--bård

Documentation: http://ez.no/doc

David Goddard

Wednesday 20 April 2005 8:55:58 am

Cool - keeps track of an objects name and issues 301's if it changes! Brilliant!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.