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.

eZ debug

Timing: Jan 18 2025 19:09:01
Script start
Timing: Jan 18 2025 19:09:01
Module start 'layout'
Timing: Jan 18 2025 19:09:01
Module start 'content'
Timing: Jan 18 2025 19:09:02
Module end 'content'
Timing: Jan 18 2025 19:09:02
Script end

Main resources:

Total runtime1.1004 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0241 589.5859152.6563
Module start 'layout' 0.02420.0036 742.242239.5078
Module start 'content' 0.02771.0713 781.7500547.8359
Module end 'content' 1.09900.0014 1,329.585912.0938
Script end 1.1004  1,341.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00730.6656160.0005
Check MTime0.00170.1540160.0001
Mysql Total
Database connection0.01131.024610.0113
Mysqli_queries1.010891.8535600.0168
Looping result0.00070.0653580.0000
Template Total1.011391.920.5057
Template load0.00200.179120.0010
Template processing1.009391.722820.5047
Template load and register function0.00020.020010.0002
states
state_id_array0.00410.370310.0041
state_identifier_array0.00260.235820.0013
Override
Cache load0.00160.1484270.0001
Sytem overhead
Fetch class attribute can translate value0.00100.093620.0005
Fetch class attribute name0.00170.152850.0003
XML
Image XML parsing0.00280.254820.0014
class_abstraction
Instantiating content class attribute0.00000.001350.0000
General
dbfile0.00600.5418170.0004
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs