Yanp_XH – a CMSimple_XH Plugin

Newspaper

YANP is the acronym for yet another news plugin. It facilitates semi-automatic handling of news of a CMSimple_XH website, that could be shown as newsbox and made available as RSS feed. Consider it an alternative to creating and maintaining newsboxes manually or using a fully automated solution, such as WhatsNew or RSS Feed. If you have further demands, consider using an advanced solution, such as News or Realblog_XH.

Please do read this manual before you encounter any problems!

Requirements

Yanp_XH is a plugin for CMSimple_XH. It requires a UTF-8 encoded version.

Installation

The installation is done as with many other CMSimple_XH plugins. See the CMSimple_XH wiki for further details.

  1. Backup the data on your server.
  2. Unzip the distribution on your computer.
  3. Upload the whole directory yanp/ to your server into CMSimple_XH's plugins directory.
  4. Set write permissions to the subdirectories config/, css/, languages/ and to the plugin's data folder.
  5. Switch to "Yanp" in the back-end to check if all requirements are fulfilled.

Settings

The plugin's configuration is done as with many other CMSimple_XH plugins in the website's back-end. Select "Plugins" → "Yanp".

You can change the default settings of Yanp_XH under "Config". Hints for the options will be displayed when hovering over the help icons with your mouse.

Localization is done under "Language". You can translate the character strings to your own language (if there is no appropriate language file available), or customize them according to your needs. Particularly have a look at the entries in the "Feed" and "News" section.

The look of Yanp_XH can be customized under "Stylesheet", or alternatively in your template's stylesheet, as the newsbox and the feed link are tied to that very closely.

Usage

Yanp_XH's news are related to CMSimple pages. Each page can have an entry in the news. To control this, just switch to the tab "News" above the editor. If you enter any text as description, the page will be added to the news. If you delete the description, the page will be removed from the news. The timestamp of the news is used for ordering these (latest news will be on top). The timestamp will be updated when you save the tab, but it will not be more recent than the timestamp of the last edit of the according page. So, if you've made a typo in the page and correct it later, the timestamp of the news won't be affected. On the other hand, if you change the news later, the timestamp won't be affected, as long as you don't save the page.

Displaying the newsbox

To display the newsbox you have to edit your template; replace an already existing newsbox() call with:

<?php echo yanp_newsbox()?>

or insert it, perhaps in addition to already existing newsbox() calls.

Furthermore it's possible to display the newsbox on a CMSimple page by inserting the plugin call:

{{{PLUGIN:yanp_newsbox();}}}

Making the RSS feed available

The RSS feed is made available to many modern browsers automatically, because a <link rel="alternate"> tag is inserted to the <head> of your website's pages by Yanp_XH. To additionally display the RSS icon with a link to the RSS feed, you have to insert

<?php echo yanp_feedlink()?>

into your template. This basically works like mailformlink(). If you want to display another feed icon, just put it into your template's images/ folder, and give it's filename as parameter:

<?php echo yanp_feedlink('filename.png')?>

Depending on your web server's configuration, the feed will be served as text/xml, what may cause problems with the UTF-8 encoding. So it should be served as application/rss+xml or application/xml. For Apache servers the solution is to put an according .htaccess file into the plugin's data folder, which is already done for the default data/ folder. An alternative might be setting the "feed extension" to "rss". But anyway, you should validate the RSS feed to be informed about possible problems.

Limitations

Under CMSimple_XH 1.6 - 1.6.2 when saving the News tab there is the spurious error message "Could not save content file". This is caused by a bug in CMSimple_XH and will be fixed with CMSimple_XH 1.6.3.

When the website can be requested with www and without it (e.g. www.example.com and example.com) without redirecting one to the other, the RSS feed may not link correctly back to itself. It is generally recommended that you establish a 301 redirect from www.example.com to example.com or vice versa.

License

Yanp_XH is licensed under GPLv3.

© 2011-2014 Christoph M. Becker

Danish translation © 2011-2012 Jens Maegard
Slovak translation © 2011-2012 Dr. Martin Sereday
Czech translation © 2012 Josef NÄ›mec

Credits

The plugin icon was designed by cemagraphics. This plugin uses feed icons from Perishable Press, and "free application icons" from Aha-Soft. Many thanks for publishing these icons as freeware.

Many thanks to the community at the CMSimple_XH forum for tips, suggestions and testing.

Last but not least many thanks to Peter Harteg, the "father" of CMSimple, and all developers of CMSimple_XH without whom this amazing CMS wouldn't exist.