2013-11-04, 00:11:40
I originally looked for a static html cms so I could add a cms to my site, when i found GS I realized how powerful it was and that it was totally worth redoing my sites in GS instead.
Although I am still using custom components to auto include some php pages that are not in GS.
( this required some finagling with the include paths due to the fact that including them from components changes the php working path )
for example this code could go in a content-bottom hook or a content filter
Basically if you hit up the slug "maps" (must exist ) it will include "dev_grapher.php"
You could use the error-404 hook also and do this without having to create the empty slugs, but then your menu would not have them.
Although I am still using custom components to auto include some php pages that are not in GS.
( this required some finagling with the include paths due to the fact that including them from components changes the php working path )
for example this code could go in a content-bottom hook or a content filter
Code:
<?php
GLOBAL $inSidebar;
if($inSidebar==true) return;
$includes = array('','maps','places','stats');
$pages = array('','dev_grapher.php','dev_zones.php','dev_resources.php','dev_about.php','dev_stats.php');
$slug = get_page_slug(false);
$pageidx = array_search($slug,$includes);
#echo $slug;
#echo $pageidx;
# _debugLog(get_defined_vars());
if(isset($pageidx) and $pageidx!=''){
# echo "<pre>including: ".$pages[$pageidx]."</pre>";
include('../'.$pages[$pageidx]);
}else {
require_once('../include.php');
}
?>
Basically if you hit up the slug "maps" (must exist ) it will include "dev_grapher.php"
You could use the error-404 hook also and do this without having to create the empty slugs, but then your menu would not have them.