2013-03-19, 02:31:14
(2013-03-16, 05:44:55)Carlos Wrote: ...
This would allow having several pages with the same slug (at different folders):
slug = data/pages/slug.xml
folder/slug = data/pages/folder/slug.xml
folder/subfolder/slug = data/pages/folder/subfolder/slug.xml
...
My comments on this topic:
- each page needs a unique ID, otherwise managing/referencing pages becomes much more difficult - and it's a good practice, too.
- if each page's unique ID is also the file name - and you would need this for fast access - you don't need (and want) directories
- as GetSimple automatically adds a counter on page creation, if the slug already exists, this should be no problem for users
As long as the file name is the slug, there is no use to storing the slug as field in the XML, too.
I even think that the structure should be totally separate from the pages. If there was no need for backward compatibility, I'd remove parent and order from the page files and use instead a 'navigation.xml' file detailing the structure. You could even have multiple navigation files.
On another topic, loading the page cache should definitely be lazy - I would rather see multiple cache files for the various functions, like a navigation cache for the menu relevant fields. That way the performance would be nearly independent of the number of pages (on very large sites not all pages will be in the menu, but they would be linked from other pages).
Just my opinion to these topics :-)