Tutorials - Big bits of code to help you do more
-
TutorialsLeaflet with SS3
19 November 2012 | | | Supports v3.0
Tweet
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... -
TutorialsCreating and deleting dataobjects from the front end
29 June 2012 | | | Supports v2.4
Tweet
One of my clients wanted a clear interface from which he could easily attach downloadable files to some pages of his site. Instead of using modelAdmin and granting him an access to Silverstripe admin panel, I chose to create a front-end page showing a simple upload form, a list of the files previously uploaded to the server, and a delete button for each of them.
Continue reading... -
TutorialsUse Markdown format with SilverStripe
6 May 2012 | | | Supports v2.4, v2.3
Tweet
If you are sick of fumbling with TinyMCE but still want a way to include editable HTML styled content fields in the CMS then Markdown may be the answer.
Continue reading... -
TutorialsDataObject as Pages: The Module
24 January 2012 | |
Tweet
It's been a while since we published the DataObject as Pages series of tutorials, which have proved to be particularly popular. At Aab Web we use those techniques regularly as a way to allow our clients to mange large amounts of flat content or content that is distributed in multiple places throughout a site. Although the final implementations in each project are often varied and bespoke, they all start with the basics outlined in those tutorials, so it made sense for us to build a starting point to work from (and include some more complex features at the same time). That starting point is this module, catchily entitled: DataObject as Pages.
Continue reading... -
TutorialsSetting and displaying custom messages in your site
31 October 2011 | | | Supports v2.4
Tweet
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... -
TutorialsAdding Custom Filterable Reports to ReportAdmin
7 October 2011 | | | Supports v2.4
Tweet
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... -
TutorialsSorting on a related DataObject in ModelAdmin
2 August 2011 | | | Supports v2.4
TweetSometimes, in ModelAdmin, we want to be able to have a different default sort.
Specifically, like in cases where a has_one is the preferred sorting. For example, we have a warehouse. In our DataObjects, we have the object "Lanes", has_many Products. And we have Products, has_one "Lanes". When we're browsing our Products in the admin, we want to have them default sorted by their Lane, not their name.
Just saying default_sort = 'Lanes'; sadly does not do the job. It'll give you reddish-screens and stuff. Which is not what we like.
Here's a (quite simple actually) solution.
Continue reading... -
TutorialsAdding an image to a blog post using Decorators and the SilverStripe Blog Module
31 May 2011 | | | Supports v2.4, v2.3
TweetThe Silverstripe blog module is great and its made its way into many of my Silverstripe sites. However, for most designers it is missing one vital aspect; an image field for each post. In this tutorial I'm going to show you how to quickly add an image to the blog module without editing any of it's files, allowing hassle free upgrading in future.
Continue reading... -
TutorialsCreate an AJAX Auto-Complete Member Search with SilverStripe and jQuery
10 May 2011 | | | Supports v2.4
Tweet
For ages now I have been meaning to figure out how to get an AJAX autocomplete field working with SilverStripe Objects. So when I found this great jQuery Autocomplete Plugin, I thought now would be a good time. As always SilverStripe provides all the tools necessary to complete the task without too much hassle.
Continue reading... -
TutorialsAdd a duplicate button to Model Admin
19 April 2011 | | | Supports v2.4
Tweet
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... -
TutorialsUsing Translatable to create a Simple Multilingual Site
9 April 2011 | | | Supports v2.4
Tweet
I recently had a request to build a multilingual site for an accountant who wanted to enter content in English, Romanian and Russian, and wanted their site visitors to be able to switch languages by clicking on the image of the country flag - and I was pleasantly surprised to learn how quick and easy it is to implement using Silverstripe's Translatable class.
Continue reading... -
TutorialsCustom sorting in the CMS SiteTree
14 February 2011 | | | Supports v2.4, v2.3
Tweet
Ever wanted to sort some parts of the SiteTree? Well now you can!
Continue reading... -
TutorialsUsing a nested controller for generic URL handling
1 February 2011 | | | Supports v2.4, v2.3
TweetIn this tutorial we'll be taking a look at SilverStripes nested controller concept and how you can use it in your own projects. Keep in mind though that this tutorial is probably for the more advanced users and for those who whish to learn abit more about how SilverStripe works. I will be referencing Controllers Instead of Pages by Ty Barho and the nested controller we'll be building will be for handling his scenario.
I have also taken the liberty of including a zip file which contains all the code examples from Tys tutorial + the new controller and the new URL rule for it.
Continue reading... -
TutorialsControllers Instead of Pages
25 January 2011 | | | Supports v2.4, v2.3
TweetSilverStripe is great for working with Pages in the CMS. But what if you need functionality without the need for content or all the "data fluff," like in Aram's tutorial about user registration and profile editing. Well, believe it or not, SilverStripe is a pretty solid MVC platform, even if you're working outside of the page data objects. It took me a while to understand how to implement true-ish MVC in SilverStripe, so I thought I'd take the opportunity to share.
Continue reading... -
TutorialsAdd flexible MetaTags control to Pages
15 January 2011 | | | Supports v2.4
TweetWhen you display DataObjects as if they are a single Page or use a Page Action to display a different view of the same Page, by default your MetaTags are the same as the tags you entered in the CMS.
One way to change the MetaTags dynamicly is to add a lot of template controls to display different MetaTags for each view, but you can get a lot more flexibility by overriding the SiteTree MetaTags function in your Page_Controller.
Continue reading...