Page 1 of 1

Duplicate page aliases

Posted: Sat Nov 17, 2007 3:39 am
by kermit
Dunno if this is on the map for 2.0 or not...

whether or not an alias is a 'duplicate' (and thus, not allowed) should consider the "full path" to the page instead of just the 'root' alias; i.e:

instead of this page..

/projects/2007/gallery/

having a $page_alias of just "gallery", it should have (something like) a $full_alias of...

projects/2007/gallery

and be able to co-exist with other pages with the same (root) $page_alias of "gallery"

this would allow URLs such as....

/projects/2008/gallery/
/projects/2007/gallery/
/projects/2006/gallery/

which are currently NOT possible... you have to get a little creatively redundanttm with your page aliases; right now it's like (just some simple examples; they get pretty long and convoluted on a couple sites i maintain):

/projects/2008/2008-gallery/
/projects/2007/2007-gallery/
/projects/2006/2006-gallery/

etc..

how to handle when hierarchy is not enabled? if dashes ("-") replace spaces in (root) aliases, the "/" could be represented by an underscore "_" (projects_2008_gallery.htm for example); and you prohibit the underscore in a page's (root) alias so that it can be reserved for this function instead (why one would use "_" instead of "-" in an alias anyway is beyond me; but the characters used to to replace spaces and separate levels could be configurable in config.php).. and when mod_rewrite isn't enabled, then it could be something like index.php?page=projects/2008/gallery (which is similar to how another CMS i work with handles hierarchy when mod_rewrite is not enabled).

Re: Duplicate page aliases

Posted: Sun Dec 02, 2007 6:01 am
by cubix
i think this is a great idea.

any idea of a workaround?

Re: Duplicate page aliases

Posted: Sun Dec 02, 2007 3:36 pm
by calguy1000
Much code in cms made simple relies on the page alias to be unique...  therefore, this won't work.

Re: Duplicate page aliases

Posted: Sun Dec 02, 2007 3:52 pm
by kermit
this is a significant limitation to the way things work now... to the point i've had to abandon cmsms on a couple sites because the site structure and content did not and could not work without being able to duplicate page aliases.. since 2.0 is a rewrite, why is this not being addressed? .. or rather, why hasn't it already been addressed? i can't be the only one that's run into a wall due to this limitation.

$page_alias needs to be unique.. ok, let's go the other way around then... give each page a $base_alias, and then $page_alias becomes the combination it plus the $base_alias of its parent, grandparent, etc. (e.g. $page_alias = 'grandparent/parent/base'. $page_alias remains "unique" -- although just having a unique content id should be adequate for 'uniqueness'

Re: Duplicate page aliases

Posted: Sun Dec 02, 2007 4:13 pm
by calguy1000
As this is an important issue for you, I suggest you dive into the code and start building a patch..... If you can come up with a reasonably working solution for the core, we can probably do something with the modules.