Hi, All.
I'm trying to set up a site section that is divided into categories and subcategories. Here's the index page -
http://www.tomlinsonelitehockey.com/members/pw_videosList.php. It's not apparent from the live page, but "Hockey Canada Skills Review" is the top level, "Balance and Agility" is a subcategory of that, and all of the titles preceded by numbers are part of the subcategory "Balance and Agility".
I'd like the index page to show only the top level category - in this case, "Hockey Canada Skills Review" - which people would click on to see the list of subcategories. They would then click on their selected subcategory and go to another page that lists all of the items within it. So there would be an index of top level categories that links to an index of subcategories, which links to individual detail pages; e.g
http://www.tomlinsonelitehockey.com/members/pw_videosDetail.php?Hockey-Canada-Skills-Review-Balance-and-Agility-1.00-Intro-Balance-and-Agility-4.
Here's the relevant code I'm using on the index page. In the head of the document:
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/tomhoc/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
// load records
list($pw_videosRecords, $pw_videosMetaData) = getRecords(array(
'tableName' => 'pw_videos',
'perPage' => '20',
'loadUploads' => '0',
));
?>
And where the content is displayed:
<?php foreach ($pw_videosRecords as $record): ?>
<h4><a href="<?php echo $record['_link'] ?>"><?php echo $record['name'] ?></a> </h4>
<hr/>
<p>
<?php endforeach ?>
<?php if ($pw_videosMetaData['invalidPageNum']): ?>
<?php elseif (!$pw_videosRecords): ?>
<?php endif ?>
<!-- /STEP2: Display Records -->
<!-- STEP3: Display Page Links (Paste anywhere below "Load Record List") -->
<?php if ($pw_videosMetaData['prevPage']): ?>
<a href="<?php echo $pw_videosMetaData['prevPageLink'] ?>">« Previous</a>
<?php else: ?>
« Previous
<?php endif ?>
- Page <?php echo $pw_videosMetaData['page'] ?> of <?php echo $pw_videosMetaData['totalPages'] ?> -
<?php if ($pw_videosMetaData['nextPage']): ?>
<a href="<?php echo $pw_videosMetaData['nextPageLink'] ?>">Next »</a>
<?php else: ?>
Next »
<?php endif ?>
</p>
<!-- /STEP3: Display Page Links -->
Any help, please?
Nigel Gordijk
Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net