show similar children links from Category Section at foot of page

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

Hi Chris,

Actually, I have just noticed that your code is working when there are other children:

e.g. http://www.melbournelaserclinic.com.au/skin-treatment.php?About-Acne-Skin-Care-Advice-3

But is not working (i.e. shows all categories and children) when the category has no children:

e.g. http://www.melbournelaserclinic.com.au/skin-treatment.php?Birthmarks-7

Page is attached below:
Attachments:

skin-treatment.php 6K

Hi Chris,

Yes, that worked a treat. Thanks very much.

There is one last thing I want to achieve here and that is remove the active item from the presented list.

So if the user has chosen "acne scarring", the related items would show all related items but not acne scarring itself ( as the user is already at that page).

Thanks in advance.

Re: [benedict] show similar children links from Category Section at foot of page

By Chris - February 9, 2010

Hi benedict,

To skip the current category when listing your related categories, add the line in red below:

<?php foreach ($relatedCategoryRecords as $record): ?>
<?php if ($record['num'] == $category['num']) { continue; } ?>


I hope this helps! Please let me know if you have any questions.
All the best,
Chris
Thanks mate - worked a treat.