SSbits - Home page
Site by Carbon Crayon
Submit a Post >
  • SnippetsRemove theme selector from SiteConfig

    6

    2.4 has introduced the SiteConfig, which by default allows the user to switch themes - if they exist.

    It's incredibly useful to have this functionality built-in now, but for those that only have one theme for a site, it's a bit of unnecessary clutter. Here is how to remove it by using a decorator

    Continue reading...
  • TutorialsDynamically Generating Dropdown Lists

    9

    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...
  • BlogWebsite of the Month: Vote Now!

    12

    SSBsiteofthemonth

    Well here it is guys, the first Vote of the new SSbits Site of the month! There were loads of entries so thank you to every one who entered, it was really tough to pick out 5 sites from all the great entries! If your site didn't make it this month, don't take it to heart, there will be plenty more months for you to enter. So here we have 5 sites, have look and pick your favourite!

    Continue reading...
  • SnippetsAdding Gravatars to your site

    6

    SSBgravatar

    Gravatar is a great service that allows you to pull in members profile photos directly from their Gravatar accounts. It's used right here on SSbits and it also part of the Forum module. It's also incredibly easy to integrate into your site! 

    Continue reading...
  • SnippetsGetting items from a has_many or many_many relation

    5

    Have you ever found yourself using DataObject::get() to fetch objects in a has_many so that you can filter/sort them easily?

    Well as it happens there is no need to do this thanks to a totally undocumented bit of code!

    Continue reading...
  • SnippetsA Data Object Manager Cheatsheet

    23

    We all love the DataObject Manager (DOM, not to be confused with the Document Object Model) as well as its creator UncleCheese of LeftAndMain.com. However one thing which has always frustrated me is having to look back through my code or even worse having to search the forums to find that function to set the upload folder, or create a filter for my DOM. So here within this page, lies a comprehensive list of all the things you can do with your DOM and File/ImageDOM. Viva la DOM!

    Continue reading...
  • TutorialsDataObjects as Pages - Part 1: Keeping it Simple

    78

    SSBdoaspagesp1

    In this two part tutorial, I am going to show you how to display DataObjects as if they were pages. This is often very useful for times when you have lots of items that don't warrant full site tree objects, but do need to be displayed on their own on the site. In this first part displaying Staff Members we are going to keep it simple, using a Data Object Manager to manage our Staff Members and referring to their ID in the URL. Later in part 2, we will see how to use ModelAdmin to manage a Search Engine friendly product catalogue.

    Continue reading...
  • BlogSSBits Re-Launches!

    17

    SSBssbitsrelaunch2

    It's here, the moment we've all been waiting for! Welcome to the new SSbits! Have a look around and make yourselves at home. Over the coming week I will be bringing you a new post every day, from a completely new Tutorial on using DataObjects as pages, to a Snippet on adding Gravatars to your site and an exciting new monthly contest. Read on to find out about the great new features and some exciting plans for the future!

    Continue reading...
  • SnippetsA _config.php Cheatsheet

    22

    SSBconfigcheatsheet

    If your anything like me, you've probably found yourself going through your previous sites looking for that line of code to put in your _config.php file. Well, now you nolonger need to, simply bookmark this page and return to it any time you need to add a line to your config! And if I've missed out anything leave a comment and I'll make sure it gets added :)

    Continue reading...
  • SnippetsCustomise Form Actions to use the <button> tag

    1

    By Default, SilverStripe uses the <input type="submit"> tag for it's form actions. However, sometimes you may want to use the <button> tag to give you a little more control over styling. This snippet shows you how, as well as giving you code to achieve the same thing in UserForms!

    Continue reading...
  • SnippetsSet the Redirect after a successful Member Login

    4

    The Member system that comes with SilverStripe offers substantial control over your site's authentication capabilities. It often requires the developer to build out or extend most common functionality to websites. This is great in that you are never "stuck" with the out-of-the-box offerings, but as any SS dev knows you end up with a little bag of Member tricks that gets used across many projects. Presented here is one that I use often.

    Continue reading...
  • TutorialsUsing Short Codes to embed a YouTube video

    32

    SSBshortcodes

    SilverStripe 2.4 has introduced shortcodes to the CMS editor. Simply, the CMS user can now add short BBCode style code to the editor area and it can then be replaced using a predefined function. For example [link id=23] could be replaced by the link to Page with an ID of 23. In fact that is exactly how internal links created in the links sidebar work in 2.4, preventing them from breaking when URLs change.

    Continue reading...
  • TutorialsWorking with Site Config

    20

    SSBsiteconfig

    One of the great new features of 2.4 is the introduction of a Site Config page. This allows you to put all of those fields which are not page related, such as The sites title, root access permissions and even the current theme. The SiteConfig class is simply a dataobject and so can easily be extended to include fields, relationships and functions which you can then access from anywhere in your site.

    Continue reading...
  • SnippetsAutomatically ?flush when in 'dev' mode

    4

    Often when doing development work on a website - and particularly the templates - it can be a pain having to remember to add ?flush to the end of the URL to make sure all of your changes have come through. I'm sure that all of us have had that "d'oh" moment when we have spent too much time wondering why our changes weren't working, only to find a simple flush fixed it.

    Continue reading...
  • BlogReview - The SilverStripe Book

    0

    SSBbookreview

    I’ve recently been working with Silverstripe, which was relatively new to me, so I got the book. This post is a review of the book “Silverstripe. The Complete Guide to CMS Development” by Ingo Schommer and Steven Broschart; I wanted to share my thoughts about this title.

    Continue reading...

Advertisement

Site of the Month

Find SSbits on

Top Contributers

Rank Avatar Name
1 article image Aram Balakjian
2 article image Daniel Hensby
3 article image Marcus Dalgren
4 article image Hamish Campbell
5 article image Ty Barho
6 article image njorndare
7 article image Martijn van Nieuwenhoven
8 article image Darren-Lee
9 article image Roman Schmid
10 article image Matt Clegg

View full leaderboard


Advertisement