Category not working as intended

15 posts by 2 authors in: Forums > CMS Builder
Last Post: February 3, 2009   (RSS)

By misery217 - January 30, 2009

Okay, I have a page 6 Categories, and a multitude of products under each category. However, the products are showing up on the main category page:

http://209.62.14.161/products/furnlistList.php

I have Square End Table set up as a child in the CMS Admin, but what gives? Is it anything to do with the Summary entry being Empty?

Please Advise

Re: [misery217] Category not working as intended

By Dave - January 30, 2009

Hi Misery217,

Can you attach the viewer file you're using so we can see the code (furnlistList.php)?

Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Category not working as intended

By misery217 - January 30, 2009

Here ya go!

Re: [misery217] Category not working as intended

By Dave - January 30, 2009

The forum software is a little confusing. You need to click that "Upload attachment" before you click "Post". Otherwise it won't upload automatically. :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Category not working as intended

By misery217 - January 30, 2009

One more time
Attachments:

furnlistlist.php 29K

Re: [misery217] Category not working as intended

By Dave - January 30, 2009

Everything looks good in the code from what I can tell. What kind of section is it? A multi-record section or a category section?

Do you have a mockup of how you want the list page to look?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Category not working as intended

By misery217 - January 30, 2009

i have it set as a category Section. The mock-up would be

http://209.62.14.161/products/furnlistList.php

But with the Second Entry. The second entry should be under the first category (Tables). Should I just delete the second entry and re-enter it again? It does show in the Admin to be under Tables... Curious...

Re: [misery217] Category not working as intended

By Dave - January 30, 2009

The category sections work a little differently. Probably the simplest way to move forward from here would be to test for the field "depth" and if it's 1 then show the record as indented under the parent record. Like this:

<?php if ($record['depth'] == 1): ?>
... show indented record here ...
<?php endif ?>

Let me know if that will work for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [misery217] Category not working as intended

By Dave - February 2, 2009

You could try limiting the results with a where at the top:

list($furnlistRecords, $furnlistMetaData) = getRecords(array(
'tableName' => 'furnlist',
'where' => " depth = 0 ",
));


Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com