1
i am having problems understanding totally how smarty works, but I have read the crash course at smarty's site. what I am trying to do is make a block that shows the News topics, currently there is a combobox/form based menu for topics. I want each topic to be printed out and clickable, Like the main menu is. So I started editing the news_block_topics.html template which currently has:
<div style="text-align: center;"><form name="newstopicform" action="<{$xoops_url}>/modules/news/index.php" method="get"><{$block.selectbox}>form>div>
from looking at other blocks I know what types of syntax I will need to use like a "foreach" statement for each topic in the news. Kinda like:
<ul>
<{foreach item=news from=$block.stories}>
<li><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.title}>a> (<{$news.hits}>)li>
<{/foreach}>
ul>
however, even when I copy this code into the news_block_topics.html file and run it, it doesn't work.
My confusion is mostl with accessing variables, I don't know what is accessible and also how a statement like
{foreach item=news from=$block.stories}
works. I need, general confusion for me, but I am trying to learn by getting this block working.
thanks,
Shawn