Ok, here’s my first go at suggesting a usability improvement ... go easy on me - and know that I offer my suggestion as a big fan.
I find that I always tend to use friendly URL’s with ’Use Friendly alias path’, ’Allow duplicate aliases’ and ’Automatically generate alias’ all turned ON.
Of course, this has the great benefit of allowing two Resources to share the same name since they are in different containers and so have a different URL path.
But when there are two resources with the same name
in the same container, I think it should then behave as if allow duplicate aliases were turned off.
So I find myself always having to hack /manager/processors/save_content.processor.php: approx line 69 with the following code:
// auto assign alias
if (!$alias && $automatic_alias) {
$alias = strtolower(stripAlias(trim($pagetitle)));
if(!$allow_duplicate_alias) {
if ($modx->db->getValue("SELECT count(id) FROM " . $tbl_site_content . " WHERE id<>$id AND alias='$alias'") != 0) {
$cnt = 1;
$tempAlias = $alias;
while ($modx->db->getValue("SELECT count(id) FROM " . $tbl_site_content . " WHERE id<>$id AND alias='$tempAlias'") != 0) {
$tempAlias = $alias;
$tempAlias .= $cnt;
$cnt++;
}
$alias = $tempAlias;
}
}
else {
if ($modx->db->getValue("SELECT count(id) FROM " . $tbl_site_content . " WHERE id<>'$id' AND alias='$alias' AND parent=$parent") != 0) {
$cnt = 1;
$tempAlias = $alias;
while ($modx->db->getValue("SELECT count(id) FROM " . $tbl_site_content . " WHERE id<>'$id' AND alias='$tempAlias' AND parent=$parent") != 0) {
$tempAlias = $alias;
$tempAlias .= $cnt;
$cnt++;
}
$alias = $tempAlias;
}
}
}