Tutorials - Big bits of code to help you do more
7 January 2011 | | | Supports v2.4, v2.3Tweet
Sometimes you'll have to create websites for clients that are very demanding when it comes to image quality, say graphic designers or photographers. SilverStripe can be a showstopper here, since images are always being re-saved when you're using something like $SetHeight in your template. This can reduce image quality quite a lot, especially when using JPEG images.Continue reading...
19 April 2011 | | | Supports v2.4Tweet
Often you will want to add some extra features to your Model Admin interface. Luckily it's pretty straightforward when you know how! In this tutorial we are going to add a simple 'Duplicate' button for our managed Model.Continue reading...
TutorialsPaginating a filtered DataObjectSet
25 October 2010 | | | Supports v2.4Tweet
If you have ever tried to paginate a DataObjectSet that has been customised since fetching it from the database you will have descovered that it simply doesn't work. This short tutorial provides some great code to resolve this problem and paginate to your hearts content!Continue reading...
TutorialsCustom sorting in the CMS SiteTree
14 February 2011 | | | Supports v2.4, v2.3Tweet
Ever wanted to sort some parts of the SiteTree? Well now you can!Continue reading...
28 June 2009 | | | Supports v2.4, v2.3Tweet
When you have a number of pages which follow on from one another you may find that asking a user to return to an index or select the next item from a side menu each time they want to progress is cumbersome. In this situation having previous and next buttons at the bottom of a page becomes very useful. In this snippet we'll add these buttons and also a counter to show the current page we are on and the total number of pages.Continue reading...
TutorialsEmbed flash content using SWFObject
3 December 2009 | | | Supports v2.4, v2.3Tweet
There are numerous ways to embed flash content into your SilverStripe Website. A commonly used and very flexible method to embed flash is provided by the SWFObject script. In this snippet I'll show you how to create a custom FlashPage that will contain flash content, embedded using SWFObject.Continue reading...
13 October 2010 | | | Supports v2.4, v2.3Tweet
This post title may look familiar, but it has in fact been completely re-written with lots of new code! When using dropdown menus, you will often want to dynamically generate the options, usually to a list of DataObjects or Pages for the user to choose from. This tutorial explores the options at your disposal when it comes to creating dynamic dropdowns in the SilverStripe.Continue reading...
TutorialsAdding a CMS action
1 September 2009 | | | Supports v2.4, v2.3Tweet
If like me you cannot figure out how on earth to use the updateCMSActions() function in a decorator and you also can't get the getCMSActions() function to find your custom method inside the controller then here is a way to make it work, which will allow you to create custom actions and buttons to trigger those actions within the CMS.Continue reading...
7 October 2011 | | | Supports v2.4Tweet
With only the standard Broken Links Report, the report admin area in Silverstripe's CMS can feel a bit underused. In this tutorial I'm going to take a look at how you can add a custom report into the report admin section of the CMS which can make keeping track of a variety of statistics a little more straightforward.
To keep this simple I am going to give users the ability to assign a colour to each page on the site and then generate a report of any pages on the site that have been assigned a particular colour.Continue reading...
TutorialsUsing jQuery for form validation
13 November 2009 | |Tweet
31 October 2011 | | | Supports v2.4Tweet
There is a method on SilverStripe's Form class to set a success or error message when the form is submitted. That's cool... but sometimes you need to display a message that is not related to a form. I've created a couple of simple controller methods to enable setting and displaying of message banners anytime.Continue reading...
TutorialsWorking with banners
13 July 2009 | | | Supports v2.4, v2.3Tweet
Most of the sites I work on are for corporate/business clients and there is not typically a lot of fancy motion graphics going on. I do like to ensure there is some dynamic element going on, just to provide a bit of interest and one of the simplest ways to achieve this is by some variation of the random/rotating banners scenario. Of course this could equally apply to other parts of the page, not just banner graphics.Continue reading...
24 July 2009 | | | Supports v2.4, v2.3Tweet
The default install of SilverStripe contains an array of buttons for the TinyMCE HTML editor. However usually your client will need some extra functionality or you may want to keep things simple for them by removing some of the buttons. As of SilverStripe 2.3.2 this is very easy and can be achieved by adding some code to the _config.php file.Continue reading...
TutorialsLeaflet with SS3
19 November 2012 | | | Supports v3.0Tweet
Leaflet is a good open-source alternative to Google Maps. I followed the instructions given in the Leaflet quick start guide (http://leafletjs.com/examples/quick-start.html), with a few adaptations to Silverstripe CMS. No custom icon, no additional layer, no customized css, no fancy feature : only the basic options to plot several locations on an interactive map.Continue reading...
28 October 2010 | | | Supports v2.4Tweet
In this tutorial we are going to add a form to a sidebar that can be included on any page on a website. You will be able to set whether to show the Form on a particular page via checkbox in the CMS. The work is based on the Working with SiteConfig and Creating a Simple Contact Form tutorials.Continue reading...