Hello Jason, thank you for your reply. For the moment I have only done what is explained on your tutorial (which I have pasted below) but what I need to achieve is in the following URL (in yellow my comments):
www.casahermes.com/new/cms.htm For the code I have as of now, as I said it's only the one from your example with the difference that I used "twolevel" instead of "onelevel" to see if it would show me only the subcategories but of course this didn't work :(
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/casahem/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($categoriesRecords, $selectedCategory) = getCategories(array( 'tableName' => 'categories', 'categoryFormat' => 'twolevel', ));
list($articlesRecords, $articlesMetaData) = getRecords(array(
'tableName' => 'articles',
));
?>
<h1>Categories</h1>
<ul>
<li><a href="?">(All Articles)</a></li>
<?php foreach ($categoriesRecords as $categoryRecord): ?>
<?php echo $categoryRecord['_listItemStart'] ?>
<?php if ($categoryRecord['_isSelected']): ?><b>
<?php endif ?>
<a href="?category=<?php echo $categoryRecord['num'] ?>">
<?php echo $categoryRecord['name'] ?></a>
<?php if ($categoryRecord['_isSelected']): ?></b>
<?php endif ?>
<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endforeach ?> </ul>
<!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
<h1>Articles - List Page Viewer</h1>
<?php foreach ($articlesRecords as $record): ?>
<a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a><br/>
<?php endforeach ?>
<?php if (!$articlesRecords): ?>
No records were found!<br/><br/>
<?php endif ?><!-- /STEP2: Display Records -->
Sven Sanchez
www.deguate.com