Onpub 1.3 Released

A new version of Onpub has been released.

Here's a list of fixes and enhancements:

  • Bundled YUI version has been upgraded to the latest release, version 3.5.0
  • Bundled CKEditor version has been upgraded to the latest release, version 3.6.3
  • Frontend will now automatically generate meta description tags for article pages. Thanks to B.K. for recommending this SEO related enhancement.
  • Sort By Date button in the management interface would break if an article title had double-quotes in it. This has been fixed.
  • Fixed OnpubArticles select query so that it now explicitly returns articles in the correct order as defined by the SAMaps table if no other order is defined by a QueryOptions object.
  • Made hard-coded "What's New" string customizable via the new OnpubFrontendCustom class. Hint: override the $labelUpdates field within the subclass constructor.
  • Fixed some frontend vertical spacing issues for sections pages with no articles and for article pages with no parent section.
  • The Onpub frontend include files have all been re-factored down in to one new PHP class called OnpubFrontend. No end-user changes are required as a result of these behind the scenes code changes. This latest version of the frontend code is backwards compatible with previous releases of Onpub, including the various auto-includes that are documented in the User Guide. This new structure allows the frontend to now be sub-classed and extended. Here's a quick example:

First create a new file called OnpubFrontendCustom.php within your onpub/local/ directory.

Within your OnpubFrontendCustom.php file paste in the following example code, save and reload the frontend in your browser:

<?php

class OnpubFrontendCustom extends OnpubFrontend {
  function __construct()
  {
    parent::__construct();
  }

  function footer() {
    parent::footer();

    en('<div><p>Here\'s some of my own footer content!</p></div>');
  }
}

?>

This class will automatically be loaded and constructed by the frontend index.php file and its display method will be called. Any methods you override in this class will result in modifications to the default frontend output for that specific output method. In the example above, the footer() method is extended to output some extra content at the bottom of each page of the frontend.

This new extendable class structure will be further documented and enhanced in upcoming User Guide additions and new releases.

As usual, this latest version can be downloaded here.

blog comments powered by Disqus