Posts: 9
Threads: 0
Joined: Feb 2012
2013-05-03, 05:31:29
(This post was last modified: 2013-05-03, 05:38:58 by bandrzej.)
Agree with Carols - by using the slug as the unique ID only for pages, you are limiting the power of this CMS beyond 1st tier navigation - already feeling this pain in trying to keep slugs unique with 30+ pages and using 2nd and 3rd tier navigation.
In reality like all other CMSes, your page's unique ID is either an auto-incremented ID or GUID. GUID would be far easier to implement for an XML datastore using
PHP's uniqid function.
Doing such a change would require another XML file (e.g. pages.xml) to map the GUIDs to parents - or just literally use sitemap.xml. Would also help to speed up navigation generation and page load instead of scanning all the XML pages to build the nav.
Posts: 6,266
Threads: 181
Joined: Sep 2011
I really do not see the major issue here, ( aside from using a unique filestore like I already mentioned as the best solution. )
If you need 3 level, could you not handle this with a rewrite rule for 3 levels and convert to prefixed segmented slugs. level1_level2_slug.xml
Posts: 9
Threads: 0
Joined: Feb 2012
(2013-05-03, 06:12:58)shawn_a Wrote: I really do not see the major issue here, ( aside from using a unique filestore like I already mentioned as the best solution. )
If you need 3 level, could you not handle this with a rewrite rule for 3 levels and convert to prefixed segmented slugs. level1_level2_slug.xml
Agree on the unique filestore - you would need a recursive function for page lookups for the rewrite rule (get slug, does it have a parent? yes, get its slug, repeat...return the full url when done)
Thought over the level1_level2_slug.xml - you would likely avoid any unique conflicts. GUID is absolute avoidance. Pick you poison :-)
Posts: 6,266
Threads: 181
Joined: Sep 2011
I am talking about a current workaround, not an implementation.
We would not need to recurse for uid, we would have pagecache and a menu cache. uid would only be used internally and looked up for file retrieval. would have noting to do with slug.
Posts: 6,266
Threads: 181
Joined: Sep 2011
This thread needs to be condensed into a github issue, I think most of it probably won't amount to anything.
But is good reference material for how we will eventually implement this.