1
bjarkep
How to put news on index page
  • 2004/8/11 14:19

  • bjarkep

  • Just popping in

  • Posts: 2

  • Since: 2004/8/11


This is probably very simple:

I would like to put the latest news posted to the news module appear on my mainpage.

How is this done? If it cannot be done, is there another news module outthere that can do the trick?

Thanks in advance

Bjarke Pedersen

2
esprague
Re: How to put news on index page
  • 2004/8/11 17:29

  • esprague

  • Just popping in

  • Posts: 8

  • Since: 2004/7/27


I would also like to know how to do this.

3
JohnCVermont
Re: How to put news on index page

If I understand your question correctly (I hope), all you should have to do is permit "anonymous users" access to the news "block".

Go to "System Admin." module
Click on "Groups"
Click on "edit" link for "Anonymous Users"
Look in the "Block Access Rights" section
Select "Recent Topics" or "Recent News" box (whichever is appropriate)

At least, that is what I have done.

What surprises me is that I replied to your question before the dozens of XoopGods! They answer these types of questions at fiberoptic speeds.


I hope my answer is mostly correct or at least helps you find your solution.

Cheers,

4
darapera
Re: How to put news on index page
  • 2004/8/11 18:41

  • darapera

  • Just popping in

  • Posts: 67

  • Since: 2003/7/22


Maybe you mean have the news and the description on the front page? Admin->Preference->Default Start Module -> News

5
bjarkep
Re: How to put news on index page
  • 2004/8/13 11:35

  • bjarkep

  • Just popping in

  • Posts: 2

  • Since: 2004/8/11


Dear darapera

This is almost what I want.... but...

The news block stretches all over the main block. I would like it to only take up space in the right-middle block. This is because I got other blocks I would like to show at the top of the mainpage.

I hope this is an easy task.

Again hanks for the help
Bjarke Pedersen

6
gooberlx
Re: How to put news on index page
  • 2004/8/14 22:13

  • gooberlx

  • Just popping in

  • Posts: 3

  • Since: 2004/8/14


I know exactly what he's talking about and I'd like to know too.

Basically I have "none" selected for the module start page, because then those news posts span the entire page at the bottom.

I'd like a selectable number of news posts to display (+ scoop text, not just title) that will be fitted into whichever block area I select.

So, for me, I'm trying to get the 2 most recent news posts to be placed as the first items (weight 0) in my center-left block area.

I have no idea how to accomplish this, and none of the existing blocks/modules seem to do this either.

7
jmass
Re: How to put news on index page
  • 2004/8/15 1:31

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


I think I know what you want to do. I asked a similar question. I wanted to have a custom layout on my front page, but include the dynamic last 5 news items.

At first I tried to write a custom block to display my HTML and pull the news items. This would have worked eventualy, but someone suggested a better way.

Modify the new News block template to include the look I wanted. It worked great.

JMass

8
gooberlx
Re: How to put news on index page
  • 2004/8/16 1:24

  • gooberlx

  • Just popping in

  • Posts: 3

  • Since: 2004/8/14


Done and Done...
SO here's what I did, for the curious:

I decided to just use the use/change the "Top News" block template. It now looks like this (basically I just stole selected parts of the formatting from the news_item.html template):
<{foreach item=news from=$block.stories}>
  <
div class="itemHead"><span class="itemTitle">
     <
a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.title}>a>
  span>div>
  <
div class="itemBody">
    <{
$story.imglink}>
    <
class="itemText"><{$news.text}>p>
  div>
  <
div class="itemFoot"><span class="itemPermaLink">
    <
a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>">Read More...a>
  span>div>
<{/foreach}>


And I also had to change the news_top.php to get the "Scoop" text into $news. Additions were these:
$sql "SELECT storyid, title, [b]hometext[/b], published, expired, counter FROM ".$xoopsDB->prefix("stories")."
WHERE published < "
.time()." AND published > 0
AND (expired = 0 OR expired > "
.time().")
ORDER BY "
.$options[0]." DESC";

... and ...

$news['text'] = str_replace("n"""$myrow['hometext']); [i]<--- text formatting good![/i]


I'm sure I could make it more fancy schmancy, but this works just fine for me.

Hope this helps someone.

9
petercoolz
Re: How to put news on index page
  • 2004/8/19 21:06

  • petercoolz

  • Just popping in

  • Posts: 4

  • Since: 2004/8/19


Thanks for the reply gooberlx, but that didn't work for me. It pulls up the title and the rest, as before, but doesn't seem to be able to get the hometext.

Perhaps you could paste in the entire files that you modified and I could just upload those to my site and test that out? I'd really like to get it working and appreciate your help.

10
tedsmith
Re: How to put news on index page
  • 2004/8/19 21:16

  • tedsmith

  • Home away from home

  • Posts: 1151

  • Since: 2004/6/2 1


In Admin\Blocks, select the 'Recent News' block and specify where on the page you want it (left pane, left middle or right of centre pain, or the right pane). Then set the order of it in the modules main page (the column titled 'weight' I think) and order them according to the three main areas of the page.

So for example, if you have two blocks in the left pane, three in the middle and one on the right, number each of them with seperate orderings. So the two on the left could be 1 and 2 of that area. Then you would have 1, 2 and 3 for the middle area, or 3, 2, 1 etc. Then just 1 for the single block in the right pane. In other words, each of the 'areas' of the page are ordered using their own set of numbering - if that makes sense?

Then, once you have your Recent News block where you want it, go to System Admin\News and choose the preferences option of the News module and display it as Topic, rather than Classic. By doing this, the latest news will be shown with most of its topic, and the other older news items will be just hyperlinked (I think!).

Does that help at all? Sorry if not.

Login

Who's Online

249 user(s) are online (204 user(s) are browsing Support Forums)


Members: 0


Guests: 249


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