Thank you for such a detailed explanation. Anyway, I think it is too much for me, because of my lack of programming knowledge. I would wish to have more documentation about what your excellent application can do and how to do it.
The full code of the page is here:
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
require_once "/home/activefilings/public_html/cmsAdmin/lib/viewer_functions.php";
list($servicesRecords, $servicesMetaData) = getRecords(array(
'tableName' => 'services',
'perPage' => '10',
'loadUploads' => '0',
'allowSearch' => '0',
));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<style type="text/css">
body { font-family: arial; }
.instructions { border: 3px solid #000; background-color: #EEE; padding: 10px; text-align: left; margin: 25px}
</style>
</head>
<body>
<!-- INSTRUCTIONS -->
<div class="instructions">
<b>Sample List Viewer - Instructions:</b>
<ol>
<?php ?>
<li><b>Remove any fields you don't want displayed.</b> (Most list pages only have title and link fields.)</li>
<li>Rearrange remaining fields to suit your needs.</li>
<li>Copy and paste code into previously designed page (or add design to this page).</li>
</ol>
</div>
<!-- /INSTRUCTIONS -->
<!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
<h1>Services - List Page Viewer</h1>
<?php foreach ($servicesRecords as $record): ?>
Record Number: <?php echo $record['num'] ?><br/>
Parent Category: <?php echo $record['parentNum'] ?><br/>
Name: <?php echo $record['name'] ?><br/>
Content: <?php echo $record['content'] ?><br/>
Headline: <?php echo $record['headline'] ?><br/>
Keywords: <?php echo $record['keywords'] ?><br/>
Description: <?php echo $record['description'] ?><br/>
Order Here: <?php echo $record['order_here'] ?><br/>
Add: <?php echo $record['add'] ?><br/>
_link : <a href="<?php echo $record['_link'] ?>"><?php echo $record['_link'] ?></a><br/>
<hr/>
<?php endforeach ?>
<?php if ($servicesMetaData['invalidPageNum']): ?>
Results page '<?php echo $servicesMetaData['page']?>' not found, <a href="<?php echo $servicesMetaData['firstPageLink'] ?>">start over >></a>.<br/><br/>
<?php elseif (!$servicesRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
<!-- /STEP2: Display Records -->
<!-- STEP3: Display Page Links (Paste anywhere below "Load Record List") -->
<?php if ($servicesMetaData['prevPage']): ?>
<a href="<?php echo $servicesMetaData['prevPageLink'] ?>"><< prev</a>
<?php else: ?>
<< prev
<?php endif ?>
- page <?php echo $servicesMetaData['page'] ?> of <?php echo $servicesMetaData['totalPages'] ?> -
<?php if ($servicesMetaData['nextPage']): ?>
<a href="<?php echo $servicesMetaData['nextPageLink'] ?>">next >></a>
<?php else: ?>
next >>
<?php endif ?>
<!-- /STEP3: Display Page Links -->
</body>
</html>
This is the page we named Index.php and it should show only the main categories (services). This code shows everything, categories, and each service. I don't know where to put the code you wrote.
Thank you!