The News plugin implements a simple "Headlines" view, or summary, of a list of news
or a weblog.
One enters news as items of a bulleted list in a single topic, most recent first. If somewhere in the topic, the keyword
%NEWS% appears, then a new topic is created (by default of the name of the topic with
Headlines
appended) with the first line of the 5 more recent news.
Ending punctuation is removed from the headlines for a sleeker look.
Recommended usage is to INCLUDE this generated topic in some panel in a front page,
and put a "More..." link in it to the original
MyCompanyNews topic.
The
%NEWS%
variable can be set in an HTML comment:
<!-- %NEWS% -->
It needs a TWiki version of 01 Feb 2003 or better, or the 01 Dec 2001 version with the
TWiki:Codev/PluginHookOnSavePatch patch.
See
http://koala.ilog.fr/wiki/bin/view/Plugins/NewsPluginExampleInclusion
Syntax Rules
Add a
%NEWS%
variable in a news topic named
Xxx to generate a headline topic
named
XxxHeadlines.
To change the default, use the syntax
%NEWS{parameter="value" ...}%
syntax
with the following available parameters:
Parameter | Value |
count | The number of headlines to keep. Defaults to 5. |
prefix | This text will be prepended to the generated topic. Defaults to nothing. |
suffix | This text will be appended to the generated topic. Defaults to nothing. |
presep | Prepend each headline with this text. Defaults to <tab>*<space> |
postsep | Appends this text to each headline. Defaults to newline |
trim | If set to "no", trailings punctuation marks ( .,:; ) are note removed from headlines. defaults to "yes" |
Example:
%NEWS{presep="<li>" prefix="<ul>" suffix="</ul>"}%
Examples
Example: If the topic
MyCompanyNews contains:
%NEWS%
* News Plugin released - 18 Feb 2003.
The great news plugin has been debugged
* News Plugin devel started - 02 Jan 2003.
I think this is really needed,
I will try to keep it simple
Then on saving the topic
MyCompanyNewsHeadlines will contain:
* News Plugin released - 18 Feb 2003
* News Plugin devel started - 02 Jan 2003
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%
, i.e.
%INTERWIKIPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = %NEWS% generates a short headlines topic from a list of news
- Debug plugin: (See output in
data/debug.txt
)
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
- Download the ZIP file from the Plugin web (see below)
- Unzip
NewsPlugin.zip
in your twiki installation directory. Content:
File: | Description: |
data/TWiki/NewsPlugin.txt | Plugin topic |
data/TWiki/NewsPlugin.txt,v | Plugin topic repository |
lib/TWiki/Plugins/NewsPlugin.pm | Plugin Perl module |
- Test if the installation was successful:
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins
--
TWiki:Main/ColasNahaboo - 17 Feb 2003