SSbits - Home page
Site by Carbon Crayon
Submit a Post >
  • TutorialsWeb 2.0 Mirrored Images

    1

    SSBreflections

    Ever wanted to create the so-called 'web 2.0' mirrored images as you can see on http://www.dio5.com/portfolio/, without having to manually rotate and proces the image? Then this one is for you.

    I have attached a fully working zip-package, but let's run through some of the code nonetheless.

    Continue reading...
  • TutorialsMaking a hierarchy aware templating system

    0

    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...
  • TutorialsUsing a Thickbox Modal Window with AJAX

    0

    Thickbox is a great javascript plugin to jQuery that you can use to create modal windows within SilverStripe pages.  You can de-clutter your interfaces and re-use small snippets of common functions when you add in AJAX.  Before we begin there is a little homework:

    Continue reading...
  • TutorialsAdding a CMS action

    9

    SSBcmsaction

    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...
  • TutorialsCreate a front end theme switcher

    2

    So you wanna make a demo site for your customers to show all your template skills in one site. A simple theme switcher can come in handy. It's quite easy to implement this. 

    First add two new functions to your Page_Controller class:

    Continue reading...
  • TutorialsAutofill MetaDescription and MetaKeywords on page save

    0

    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...
  • TutorialsCustomising the WYSYWIG editor (TinyMCE)

    6

    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...
  • TutorialsWorking with banners

    7

    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...
  • TutorialsCreating Previous and Next Buttons on a page

    12

    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...
  • TutorialsCustom Login Form with Group Based Redirection

    17

    In this tutorial we are going to create a system that allows the Admin to decide which (front-end) page a group of users are redirected to after login. This will be defined via a TreeDropdown for each group in the security section, and can also be set to send them to the admin area via a checkbox.

    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 njorndare
6 article image Ty Barho
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