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:
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:
Re: [benedict] show similar children links from Category Section at foot of page
By Chris - December 15, 2009
Hi Benedict,
After browsing through your site, I think I may have figured out what you want to achieve. I'm not sure if I have this right, so please let me know if not:
If a user is viewing a top-level category (e.g. "Facial Ageing"), you want to list its child categories as related. If a user is viewing a second-level category (e.g. "Cheek Enhancement"), you want to list the child categories of the parent category.
If that's true, replace the "rootCategoryNum" line with the following:
I hope this helps! Please let me know if you have any questions.
After browsing through your site, I think I may have figured out what you want to achieve. I'm not sure if I have this right, so please let me know if not:
If a user is viewing a top-level category (e.g. "Facial Ageing"), you want to list its child categories as related. If a user is viewing a second-level category (e.g. "Cheek Enhancement"), you want to list the child categories of the parent category.
If that's true, replace the "rootCategoryNum" line with the following:
'rootCategoryNum' => ( $category['parentNum'] ? $category['parentNum'] : $category['num'] ),
I hope this helps! Please let me know if you have any questions.
All the best,
Chris
Chris
By benedict - February 8, 2010
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.
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:
I hope this helps! Please let me know if you have any questions.
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
Chris