xoops forums

bbgds

Just popping in
Posted on: 2004/10/29 20:18
bbgds
bbgds (Show more)
Just popping in
Posts: 93
Since: 2004/7/23
#21

Re:Are multiple news modules possible?

Kahumbu....

I got tired of waiting around for approval that will likely not come at all, and decided to start work on my own news site at http://nationalnewsregister.com

I don't have any content yet, except some that I snagged for testing purposes.

Anyway, I started to modify the Topics Block, but I haven't really gotten anywhere with it. Here is the code I have for the block so far....

----

<div align="center"><h4>World Events</h4></div>
<ul>
<{foreach item=news from=$block.stories}>
<li><a href="http://<{$xoops_url}>/modules/news/index.php?storytopic=2&storyid=<{$news.id}>"><{$news.title}></a> (<{$news.date}>)</li>
<li><a href="http://<{$xoops_url}>/modules/news/index.php?storytopic=2&storyid=<{$news.id}>"><{$news.title}></a> (<{$news.date}>)</li>
<li><a href="http://<{$xoops_url}>/modules/news/index.php?storytopic=2&storyid=<{$news.id}>"><{$news.title}></a> (<{$news.date}>)</li>
<li><a href="http://<{$xoops_url}>/modules/news/index.php?storytopic=2&storyid=<{$news.id}>"><{$news.title}></a> (<{$news.date}>)</li>
<li><a href="http://<{$xoops_url}>/modules/news/index.php?storytopic=2&storyid=<{$news.id}>"><{$news.title}></a> (<{$news.date}>)</li>
<{/foreach}>
</ul>

----

I'm only working with one category right now till I get it figured out. But the stories don't actually display. (I don't think I'm there yet on the code.) Any suggestions you could give me?

kahumbu

Documentation Writer
Posted on: 2004/11/9 20:21
kahumbu
kahumbu (Show more)
Documentation Writer
Posts: 277
Since: 2003/8/23
#22

Re:Are multiple news modules possible?

Hi bbgds,

Got your email. Here is the code in one of the blocks in my Topics Block module:

<div style="padding-bottom: 5px;">
<
a href="<{$xoops_url}>/modules/news/index.php?storytopic=2">News</a>&nbsp;|&nbsp;
<
a href="<{$xoops_url}>/modules/news/index.php?storytopic=13">PhilHealth</a></div>
<{foreach 
item=item from=$block.items}>
<
div style="padding-bottom: 3px;">ยป <a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$item.id}>" style="font-weight: normal;"><{$item.title}></a><!-- (<{$item.time}>) --></div>
<{/foreach}>


Basically, I hard-coded the name of Category into each block I am using. But you need to let the <{foreach}> do its own looping to get the news items displayed. I am not sure if the foreach you used and the Smarty tags in there are from the Topics Block module.

Here is a screenshot of my Block Settings:
Resized Image

Hope this helps.

bbgds

Just popping in
Posted on: 2004/11/15 1:29
bbgds
bbgds (Show more)
Just popping in
Posts: 93
Since: 2004/7/23
#23

Re:Are multiple news modules possible?

Okay, some wierdness now. I modified the topics block template, and entered a couple of test articles. But what it seems to have done is transfered the preview block from the topic page to the Front Page.

You can see it at http://nationalnewsregister.com

Also, how did you get the admin block options? Was that another script you wrote?

bbgds

Just popping in
Posted on: 2004/11/15 3:32
bbgds
bbgds (Show more)
Just popping in
Posts: 93
Since: 2004/7/23
#24

Re:Are multiple news modules possible?

Kahumbu...

Okay, fixed the problem with the preview blocks (my fault, I had a link in imenu configured wrong.)

But the block doesn't show the links to the individual articles. What else do I need to do here?