---+!! <nop>%TOPIC% <!-- Contributions to this TWiki plugin are appreciated. Please update the plugin page at http://twiki.org/cgi-bin/view/Plugins/NewsPlugin or provide feedback at http://twiki.org/cgi-bin/view/Plugins/NewsPluginDev. If you are a TWiki contributor please update the plugin in the SVN repository. --> <sticky><div style="float:right; background-color:#EBEEF0; margin:0 0 20px 20px; padding: 0 10px 0 10px;"> %TOC{title="Page contents"}% </div></sticky> %SHORTDESCRIPTION% ---++ Introduction The News plugin implements a simple "Headlines" view, or summary, of a list of news or a weblog. Add a =%<nop>NEWS%= variable in a news topic named *Xxx* to generate a headline topic named *Xxx<nop>Headlines*. ---++ Syntax Rules One enters news as items of a bulleted list in a single source topic, most recent first. If somewhere in the topic, the keyword ==%<nop>NEWS%== appears, then a new topic is created with the first line of the most recent news. Ending punctuation is removed from the headlines for a sleeker look. Recommended usage is to =%<nop>INCLUDE%= the generated topic in some panel in a front page, and put a "More..." link in it to the source topic. The =%<nop>NEWS%= variable can be set in an HTML comment to hide it in the source topic: =<!-- %<nop>NEWS% -->= To change the default, use the syntax =%<nop>NEWS{parameter="value" ...}%= syntax with the following available parameters: | *Parameter* | *Value* | | count | The number of headlines to keep. Defaults to 5. | | pattern | Gives a (partial) regular expression pattern to use to extract the news items. This pattern must occur at the beginning of a line in order to select a news item. The headline then becomes everything following the pattern until the end of the line. Defaults to =(\t| )\*\s= (i.e., a first-level bullet). \ <!-- Note that the pattern is given using the HTML entity for the vertical bar in order to avoid it being interpreted as a column marker in the table.--> | | postsep | Appends this text to each headline. Defaults to =newline= | | prefix | This text will be prepended to the generated topic. Defaults to nothing. | | presep | Prepend each headline with this text. Defaults to =<tab>*<space>= | | suffix | This text will be appended to the generated topic. Defaults to nothing. | | topic | Name of generated headlines topic. Defaults to the name of the source topic with =Headlines= appended to it. | | trim | If set to "no", trailings punctuation marks ( =.,:;= ) are not removed from headlines. Defaults to "yes" | ---++ Examples Example: Set the prefix, presep, and suffix to produce an HTML unordered (bullet) list: =%<nop>NEWS{presep="<li>" prefix="<ul>" suffix="</ul>"}%= Example: If the topic <tt>MyCompanyNews</tt> contains: <pre style='background:#ffffe0; border:solid; width=80%; border-width: thin;'> %<nop>NEWS% <nop>* NewsPlugin released - 18 Feb 2003. The great news plugin has been debugged <nop>* NewsPlugin devel started - 02 Jan 2003. I think this is really needed, I will try to keep it simple </pre> Then on saving the topic <tt>MyCompanyNewsHeadlines</tt> will contain: <pre style='background:#ffffe0; border:solid; width=80%; border-width: thin;''> <nop>* NewsPlugin released - 18 Feb 2003 <nop>* NewsPlugin devel started - 02 Jan 2003 </pre> Example: This is the same example above, except the news headlines are specified as level-2 headings: <pre style='background:#ffffe0; border:solid; width=80%; border-width: thin;'> %<nop>NEWS{pattern="---\+\+(!!)?"}% <nop>---++ NewsPlugin released - 18 Feb 2003. The great news plugin has been debugged <nop>---++ NewsPlugin devel started - 02 Jan 2003. I think this is really needed, I will try to keep it simple </pre> Then on saving the topic <tt>MyCompanyNewsHeadlines</tt> will contain: <pre style='background:#ffffe0; border:solid; width=80%; border-width: thin;''> <nop>* NewsPlugin released - 18 Feb 2003 <nop>* NewsPlugin devel started - 02 Jan 2003 </pre> ---++ Plugin Settings Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop><plugin>_<setting>%==, i.e. ==%<nop>INTERWIKIPLUGIN_SHORTDESCRIPTION%== * One line description, is shown in the %SYSTEMWEB%.TextFormattingRules topic: * Set SHORTDESCRIPTION = Generate a short headlines topic from a list of news * Debug plugin: (See output in =data/debug.txt=) * Set DEBUG = 0 ---++ 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 ==%TOPIC%.zip== in your twiki installation directory. Content: | *File:* | *Description:* | | ==data/TWiki/%TOPIC%.txt== | Plugin topic | | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module | | ==data/Sandbox/NewsPluginExample.txt== | Example news source topic | | ==data/Sandbox/NewsPluginExampleHeadlines.txt== | Example generated news headlines topic | | ==data/Sandbox/NewsPluginExampleInclusion.txt== | Example =%<nop>INCLUDE% usage of a generated headlines topic | * Test if the installation was successful: * see Sandbox.NewsPluginExample ---++ Plugin Info | Plugin Author: | TWiki:Main.ColasNahaboo | | Copyright: | © 2003-2006 TWiki:Main.ColasNahaboo <br /> © 2006-2010 TWiki:TWiki.TWikiContributor | | Plugin Version: | 2010-12-11 (V1.6) | | Change History: | <!-- versions below in reverse order --> | | 2010-12-11: | 1.6 TWikibug:Item6530: Doc improvements, changing TWIKIWEB to SYSTEMWEB -- TWiki:Main.PeterThoeny | | 07 Feb 2006 | 1.5 Add "pattern" parameter. | | 20 Feb 2003 | 1.4 trim option for removing ending punctuation: . , : ; | | 19 Feb 2003 | 1.3 small bugfix | | 17 Feb 2003 | 1.2 Initial version | | TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 | | CPAN Dependencies: | none | | Other Dependencies: | none | | Perl Version: | 5.005 | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | | [[TWiki:Plugins/Benchmark][Benchmarks]]: | %SYSTEMWEB%.GoodStyle 100%, %SYSTEMWEB%.FormattedSearch 99%, %TOPIC% 100% | | Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% | | Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev | | Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal | __Related Topics:__ %SYSTEMWEB%.TWikiPreferences, %SYSTEMWEB%.TWikiPlugins
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2010-12-12
-
TWikiContributor
Log In
or
Register
TWiki Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
QuerySearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
Main
Omega34
Sandbox
TWiki
Home
Site map
Main web
Omega34 web
Sandbox web
TWiki web
TWiki Web
User registration
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
QuerySearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
InterWikis
ManagingUsers
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Account
Log In
Register User
E
dit
A
ttach
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback
Note:
Please contribute updates to this topic on TWiki.org at
TWiki:TWiki.NewsPlugin
.