1
brash
How to access existing Smarty Tags globally?
  • 2005/7/7 2:53

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


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>&nbsp;(<{$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>&nbsp;(<{$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}>
        <
class="highlight" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}> (<span style="color:#ff0000; font-weight: bold;"><{$block.new_messages}>span>)a>
      <{else}>
        <
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
IT Headquarters
Innovative IT Solutions

2
brash
Re: How to access existing Smarty Tags globally?
  • 2005/7/7 3:32

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Found this FAQ which will definately enable me to do what I want with my horizontal menu, and may even give me somewhere to start on my template issue.
IT Headquarters
Innovative IT Solutions

Login

Who's Online

318 user(s) are online (207 user(s) are browsing Support Forums)


Members: 0


Guests: 318


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits