NewsPro FAQ

NewsPro FAQ > Customisation >
How can I use icons to show different types of news items?

 

First, install the News Categories addon. Then, via the News Categories page, create a category for each type of news.

Using this method, the icons you use must all be in the same directory and must be named (category name).gif where (category name) is the name of one of the categories you just created.

After having created and named the icons properly, edit sub DoNewsHTML in ndisplay.pl. Use something like the following (customised for your own news style, though):

sub DoNewsHTML { 
# DO NOT REMOVE THIS LINE <BeginEdit>
$newshtml = qq~
<p><strong><font color="#ff0000">$newssubject</font>
</strong><small>Posted $newsdate by <a
href="mailto:$newsemail">$newsname</a>
~;
# Begin inserting icon.
if ($newscat) {
$newshtml .= qq~
<img src="$newscat.gif">
~;
}
# End inserting icon.
$newshtml .= qq~
</small><br>
$newstext
</p>
~;
# DO NOT REMOVE THIS LINE <EndEdit>
}

If your images are not in the same directory as your news page, edit the <img> tag above to reflect this.

You can't associate an icon with the default category.

 

Back to NewsPro FAQ