1
GSake
last news post in a block
  • 2005/1/16 18:22

  • GSake

  • Just popping in

  • Posts: 51

  • Since: 2004/5/30


is there a way to build a custom block for the news module in order to display only the last news post, like in news index.php,with "read more" link,icon, etc,etc. I mean not only the link like in latest posts block.

but the block should contain only the last post from every (or even better from a chosen) news category.

are there any suggestions for how to combine the existing block .html templates' code?

After managing the code, installing should be easy by just updating news module on admin menu after uploading the extra html temlate block file in /modules/news/templates/blocks/ dir.


the following is what i want to display.
I am missing the how to call in from the db part that should wrap this code

Quote:



<{$story.imglink}>

<{$story.text}>




<{$story.adminlink}> <{$story.morelink}>



2
irmtfan
Re: last news post in a block
  • 2005/1/16 19:15

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


you dont need acustom block. just install spotlight or super spot light module and you can show the latest or any other news in a block.
download spotlight version 2.1 from http://www.wf-projects.com

3
GSake
Re: last news post in a block
  • 2005/1/16 20:01

  • GSake

  • Just popping in

  • Posts: 51

  • Since: 2004/5/30


thanks a lot!!!!!

you saved me from lots of lost hours...

4
GSake
Re: last news post in a block
  • 2005/1/17 1:19

  • GSake

  • Just popping in

  • Posts: 51

  • Since: 2004/5/30


unfortunatelly the way spotlight presents things is awful... and it has some bug too...
also the template is really tough coded 4me to be edited quickly and safely!

isn't a code with some php functions to call a specific news post via id in a block??

I want to show only this part:



<{$story.imglink}>

<{$story.text}>




<{$story.adminlink}> <{$story.morelink}>



like I wrote before...
and perhaps the title!

thnks in advance and sorry for being annoying...

5
GSake
Re: last news post in a block
  • 2005/1/17 11:15

  • GSake

  • Just popping in

  • Posts: 51

  • Since: 2004/5/30


so, I found the solution!!

here's the rebuilt code for the news template of spotlight 2.1 after combining the original and the one from linuxgamers!

Quote:



<{if $block.storyid != "0"}>
<{$block.newstitle}>
<{else}>
<{$block.newstitle}>
<{/if}>


<{$block.lang_by}> <{$block.author}>



<{$block.newstitle}>

<{$block.hometext_news}>





<{if $block.lang_other_news !=""}>


<{foreach item=news from=$block.stories}>

<{$news.title}> (<{$news.hitsordate}>)



<{$news.hometext}>

 


<{/foreach}>

 

<{if $block.lang_ministats != ""}>

<{$block.lang_ministats}>  <{$block.ministats}>

<{/if}>

<{/if}>

Login

Who's Online

499 user(s) are online (60 user(s) are browsing Support Forums)


Members: 0


Guests: 499


more...

Donat-O-Meter

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

Latest GitHub Commits