GetSimple generates URLs with a maximum of two levels. It would be nice it could have more, I'll submit an issue to the svn.
Meanwhile, if you're interested, I can post here a quick patch I've made (requires editing two core files), that makes GS support three levels in URLs.
(2012-11-09, 07:04:42)Carlos Wrote: [ -> ]GetSimple generates URLs with a maximum of two levels. It would be nice it could have more, I'll submit an issue to the svn.
Meanwhile, if you're interested, I can post here a quick patch I've made (requires editing two core files), that makes GS support three levels in URLs.
Thank you for your reply.
I would be glad if you could provide the patch.
Yeah I never understood the limit of 2 levels. Was this a fancy url limitation on the htaccess?
Dirty patch for GS 3.1.2.
(Disclaimer: use at your own risk; not officially supported; I don't know if it may have conflicts with some plugin; it will be undone if you upgrade GS)
Edit admin/inc/basic.php, around line 400 you'll find:
Code:
if ($parent != '') {
$parent = tsl($parent);
}
Remove all that and replace by:
Code:
global $pagesArray;
if ($pagesArray) {
foreach ($pagesArray as $page) {
if ($page['slug'] == $parent) {
if ($page['parent']=='') {
$parent = $parent.'/';
} else {
$parent = $page['parent'].'/'.$parent.'/';
}
break;
}
}
}
Now edit admin/edit.php, find this (line 131):
Code:
<div class="edit-nav" >
<?php
Just after that, and before the
if(isset($id)) { line, insert this:
Code:
getPagesXmlValues();
and around line 166, remove (or comment out) this:
Code:
getPagesXmlValues();
(So we've just moved up that sentence.) This is just to fix the "View" button when you edit a page.
PS This is a temporary workaround. Now I'm thinking about other ways to do it.
(2012-11-10, 00:38:12)shawn_a Wrote: [ -> ]Yeah I never understood the limit of 2 levels. Was this a fancy url limitation on the htaccess?
No, GS's .htaccess works ok with any number of levels.
It's the way links are generated (find_url). As GS doesn't store the site structure anywhere, you have to obtain the parent somewhere (I did it with global $pagesArray, but I don't like searching the array so many times...)
Thanks a lot Carlos.
Is it possible to create a plugin out of this in the future?
I hope GS supports multilevel urls in some future version.
Until then, I'll think about some other way to do this with a plugin. But almost for sure it will also require some small change to the core, though I'd like it to be easier and more efficient that the quick hack I posted.