1
Hi All,
In the process of modifying the MyDownloads index template and also trying to create a custom horizontal user menu, and have a few questions about Smarty tags that I can't seem to figure out.
1) MyDownloads
I'm trying to alter the MyDownloads index page so that I can seperate the category and sub category listings into something a bit easier to read. The orginal code in the template that governs this is;
<{foreach item=category from=$categories}>
<td valign="top" >
<{if $category.image != ""}>
<a href="<{$xoops_url}>/modules/mydownloads/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/mydownloads/viewcat.php?cid=<{$category.id}>"><b><{$category.title}>b>a> (<{$category.totaldownloads}>)<br /><{$category.subcategories}>td>
<{if $category.count is div by 3}>
tr><tr>
<{/if}>
<{/foreach}>
What I tried to do to seperate them was;
<{foreach item=category from=$categories}>
<td valign="top" width="40%" class="head"><a href="<{$xoops_url}>/modules/mydownloads/viewcat.php?cid=<{$category.id}>"><b><{$category.title}>b>a> (<{$category.totaldownloads}>)td>
tr>
<{foreach item=subcategories from=$category.subcategories}>
<tr>
<td valign="top" width="40%" class="<{cycle values="even,odd"}>"><{$category.subcategories}>td>
<{/foreach}>
<{/foreach}>
<{if $category.count is div by 2}>
tr><tr>
<{/if}>
It's close to working I think, but it seems that the <{foreach item=subcategories from=$category.subcategories}> is not actually applying the code in the for statement to each individual sub category. Basically what I want is a two colum view, with the main categories all using the head class at the top of each table, and then each sub category listed in an indivdual cell under that alternating between the odd and even classes. Any ideas of what my smarty tag syntax should be? How do I create smarty tags to seperate category and sub category properly?
My other question is regarding the user menu. I have created a horizontal user menu to go into the title bar of a theme, and it is all working as expected except for one thing. That is when a user gets message(s) and the number of waiting unread messages is display in the inbox menu item in the user menu. The code used to do this in the template is;
<{if $block.new_messages > 0}>
<a class="highlight" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}> (<span style="color:#ff0000; font-weight: bold;"><{$block.new_messages}>span>)a>
<{else}>
<a class="menuUser" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}>a>
<{/if}>
Putting this code in my horizontal menu does not work. How can I access these smarty tags from my horizontal menu in my theme?
Thanks