Need to fetch category record.

3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 10, 2010   (RSS)

By rconring - March 8, 2010

I have just created an animal adoption section on a website and all is working as expected except for one small problem.
I have used a category/subcategory menu on an introduction page on animal adoption from which, when a subcategory is selected, links to a list page of animals (animals.php) for adoption in that subcategory. This all works fine using the categroy number at the end of the url. animals.php?animal_category=2
When the listing page loads, I want to fetch some information from the category record to display at the top of the animal listing page, the breadcrumb, the category description and some other stuff.
I cannot figure out how to get the related info from the animal_categories record.
Here is the viewer code for the animals.php page

list($animal_categoriesRecords, $animal_categoriesMetaData) = getCategories(array(
'tableName' => 'animal_categories',
));

list($animalsRecords, $animalsMetaData) = getRecords(array(
'tableName' => 'animals',
'where' => 'hidden != 1',
));

Need to fetch the appropriate category record and display the info here.

Then display the listing here ...
<?php foreach ($animalsRecords as $record): ?>
display code .....
<?php endforeach ?>

I hope I have made myself clear.
Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987

Re: [chris] Need to fetch category record.

By rconring - March 10, 2010

Thanks a milloin, Chris!

That did the trick.

I have looked for documentation on the various functions for category lists and cannot seem to find any one document that fully explains all of the the functionality and implementation.

Fortunately, this is such a good forum, I got enough info to get the job done.

Thanks again and have a nice day, Chris!
Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987