2010-09-28, 06:20:55
Here it is, I've removed all the Customfields code.
In my example I've created a page called "portfolio"
then created all the subpages with the parent set to "portfolio"
Just style the output to what you need.
Mike..
In my example I've created a page called "portfolio"
then created all the subpages with the parent set to "portfolio"
Just style the output to what you need.
Mike..
Code:
function getPortfolio(){
global $PRETTYURLS;
global $SITEURL;
$path = "data/pages";
$dir_handle = @opendir($path) or die("Unable to open $path");
$filenames = array();
while ($filename = readdir($dir_handle)) {
$filenames[] = $filename;
}
$pagesArray = array();
if (count($filenames) != 0) {
foreach ($filenames as $file) {
if ($file == "." || $file == ".." || is_dir("data/pages/".$file) || $file == ".htaccess" ) {
// not a page data file
} else {
$thisfile = @file_get_contents('data/pages/'.$file);
$data = simplexml_load_string($thisfile);
//change portfolio to your top page name....
if ($data->parent == 'portfolio' && $data->private!="Y") {
echo "<li>";
echo stripslashes(htmlspecialchars_decode($data->content, ENT_QUOTES));
echo "</li>";
}
}
}
}
}