Home - Your one stop SilverStripe learning resource
- Show all
- Site Tree
- Site of the Month
- Model Admin
- SilverStripe 3
SnippetsGet errors e-mailed to you
24 March 2009 | | | Supports v2.4Tweet
If your site is live it means you are probably not getting errors reported in the view, so it's handy to have them emailed to you so you can still debug and also be notified if something is up.
Add this line to your mysite/_config.php file and expect some mail!
SS_Log::add_writer(new SS_LogEmailWriter('firstname.lastname@example.org'), SS_Log::ERR);
21 September 2009 | |Tweet
Something that has been bothering me when building larger sites with SilverStripe is that I often find myself creating new classes not to add functionality, but to just get a new template.
You can set separate templates for different actions manually but that's not what I want in this case, I want different templates for the same action on the same class.
After thinking about this for awhile I came up with a two part solution and the first part is to make the template choosing aware of the Sitetree hierarchy.Continue reading...
11 September 2009 | | | Supports v2.3Tweet
28 July 2009 | | | Supports v2.4, v2.3Tweet
Most of my customers don't want to add meta info manually, so I add an onBeforeWrite() function to update the Meta Description field and count the keyword density of the content with a separate function and add these keywords to the Meta Keywords fields when a page is saved.
In my humble SEO opinion every page needs an unique Meta Description. Keywords seems to be less important for search engines, but why not add them automatically anyway! The function counts how many times each word exist in the Content, order the words by occurrence and glues the words to a comma separated string. In this function only words with more then 4 characters are counted, but you can adjust that if you like.Continue reading...
24 March 2008 | | | Supports v2.4, v2.3Tweet
A CSS framework is a set of pre-prepared style sheets that can be used as a starting point for any project. Using a framework allows you to skip all the tedious parts of getting the basics right and lets you start working on what makes your site different from the beginning.Continue reading...
2 August 2011 | | | Supports v2.4Tweet
Sometimes, 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...
27 April 2012 | |Tweet
It's been a while but SOTM if finally back. Enter your site for a chance to be in the final 5 vote off! Voting will begin on the 10th of May.Continue reading...
14 December 2010 | |Tweet
Here are Decembers top 5 sites for you to vote on your favourite! Vote on...Continue reading...
16 May 2012 | |Tweet
It's that time again, vote for your favourite SilverStripe site!
20 November 2010 | |Tweet
The Votes are in! And the winner of November's SSbits Site Of The Month is.....Continue reading...
4 July 2011 | |Tweet
The Votes are in! And the winner of July's SSbits Site Of The Month is.....Continue reading...
2 February 2012 | |Tweet
The Votes are in! And the winner of January's SSbits Site Of The Month is.....Continue reading...