Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Module for Silverstripe CMS with some useful classes including extensions to static publishing.
PHP JavaScript
branch: master

Added a bunch of stuff from another project - flashmessages, less sup…

…port, and some bugfixes (added some missed files)
latest commit 449751ad3f
@markguinn authored
Failed to load latest commit information.
code Added a bunch of stuff from another project - flashmessages, less sup…
css
javascript Added a bunch of stuff from another project - flashmessages, less sup…
templates Added a bunch of stuff from another project - flashmessages, less sup…
tests Bugfixes for Livepubhelper to get wrapping working more fully
thirdparty
README.md Bugfixes for Livepubhelper to get wrapping working more fully
_config.php initial project state

README.md

SSTools :: Extra Stuff For SilverStripe CMS

This is an ongoing collection of classes and components that I've used on different projects and wish were part of Sapphire.

Components

  • SMTP Mailer: drop-in for the default sapphire mailer that uses PHPMailer for authenticated SMTP instead of php's mail() function.
  • LivePub: some additional helper classes for injecting limited amounts of dynamic code into php files published using the built- in static publishing capabilities of SilverStripe. Allows you to do things like a shopping cart dashboard while still using static publishing.
  • CachedWidget: just make your widget extend this class instead of Widget and it's output will automatically be cached
  • UrlPagingDataObjectSet: works just like a normal dataobjectset but instead of using /blog?start=10 for paging, it uses URL segments like /blog/2.
  • SSTools: base namespace for utility functions
  • Forms/FieldTypes: additional form stuff. Some of it may be out of date with newer versions of SilverStripe. These are not very well tested at the minute, but some are useful for niche cases. Use at your own risk.

Installation: SMTP Mailer

Add to _config.php: $mailer = new SmtpMailer('mail.server.com', 'username', 'password'); Email::set_mailer($mailer);

Included in this class is also a ProcessedEmail class that can be dropped in for the standard Email class. It uses Emogrifier to automatically inline CSS styles (must be in a <style> tag)

Installation: LivePub

  1. Follow basic staticpublisher instructions at http://doc.silverstripe.org/staticpublisher NOTE: you have to use 'php' not 'html' caching. Also, note that it has only been tested with filesystempublisher
  2. Comment out or remove cache management stuff in cms/code/staticpublisher/CachedPHPPage.tmpl (only **CONTENT** is required) - NOTE that this is covered in the patches
  3. In cms/code/staticpublisher/FilesystemPublisher.php, apply the appropriate patch from the sstools/code/livepub/patches folder (or simply follow the instructions in the MANUAL.md file in the same folder)
  4. Wrap anything that you don't want cached (is_ajax, session, etc) using eval_php, exec_php, include_php, ViewableWrapper or controller hooks.
  5. If you want the default template hooks, add this to mysite/_config.php Object::add_extension("Page_Controller", "LivePubHelper_ControllerHooks");
Something went wrong with that request. Please try again.