1
Dear All,
I am trying to present web links ctaegories and sub-categories in a different way than the original. I would like to have a row with two columns for each web link category - the one on the left will have the name of the category and the column on the right will have the name of the sub-categories. For example, if you have two categories and the second one has two sub-categories, then I would like my display to be like the following:
Category 1 (4)
Category 2 (5) Sub-Category 1 (12)
Sub-Category 2 (12)
I wrote the following code for that:
<{if count($categories) gt 0}>
<hr />
<table border='0' cellspacing='5' cellpadding='0' align="center">
<tr>
<{foreach item=category from=$categories}>
<td valign="top">
<{if $category.image != ""}>
<a href="<{$xoops_url}>/modules/mylinks/viewcat.php?cid=<{$category.id}>"><img src="<{$category.image}>" height="50" border="0" alt="" />a>
<{/if}>
td>
<td valign="top" width="40%"><a href="<{$xoops_url}>/modules/mylinks/viewcat.php?cid=<{$category.id}>"><b><{$category.title}>b>a> (<{$category.totallink}>)<br />td>
<{if count($infercategories) gt 0}>
<{foreach item=subcat from=$infercategories}>
<td>
<a href="<{$xoops_url}>/modules/mylinks/viewcat.php?cid=<{$subcat.id}>"><b><{$subcat.title}>b>a> (<{$subcat.totallink}>)
td>
<{/foreach}>
<{/if}>
tr>
<tr>
<{/foreach}>
However, I have problems in getting the sub-categories to work - if I am not wrong infercategories is used by XOOPS to denote sub-categories, or am I wrong?
I look forward to hearing from you soon.
Thanks,
George