Resources

SilverStripe

SilverStripe CMS: A slight mind warp

Being a web designer/developer from Wellington, and given the ‘support local businesses’ attitude, I thought it was necessary to get my head around the Wellington-based SilverStripe Content Management System.

SilverStripe 2.4.7

Now that the brand-new SilverStrip 3.0.1 has been launched, most of us are keen to get our clients on the bandwagon and start developing with the flash new tools. However, if you have a more conservative client and want to stick with a highly stable release (2.4.7), then getting your hands on it can be rather difficult. So if you really don’t want to go 3.0.1 just yet, I have just the link for you.

Expandable CMS Widgets

Hide and show large widgets with this handy add-on.

Reserved functions from Controller and Model

If you are struggling to find out why your page’s static $db fields aren’t working, it may be due to the field name or function names.

SilverStripe White Screen Of Death

Debugging a SilverStripe website? Lose the impossible-to-debug ‘White Screen of Death’ with these codes:

Mambot through SilverStripe page content

Sometimes it is just not worthwhile creating a new page type just for one tiny piece of functionality. Or perhaps you want the in-page functionality protected from accidental client tanpering? Either way, you can run functionality quite easily from within the page content with this crafty search and replace.

Reset Admin Password

Locked yourself out of SilverStripe? Naturally, as the legitimate administrator you will have FTP access, so simply add this line to your /mysite/_config.php file to reset your 'admin' user password to 'password'.

Run function within article content

Sometimes you need to execute a function within a page article, and the easiest way is to write your functionality in your Controller (ie Page.php, Page_Controller class) and drop in a unique string within the article. In the demo below I have created a unique string '$DemoFunction' to write in my article content, which will be replaced by the content of the function DemoFunction();

Specify an UploadField's default folder

Instead of scrambling around the /assets folder trying to find the folder that contains your assets, set the default folder to start the search from with one sneaky line in your class:

Quickly Compile a SilverStripe website

When you're frequently building SilverStripe websites, you manage to create small efficiencies to make life a bit easier. To construct a SilverStripe website quickly, I have written a quick bash script that compiles the basic SilverStripe repositories into a install-ready git repository.