Resources

Custom HTML in GridField

GridFields are great, but sometimes you need to jazz them up with your own HTML or images to make it more user-friendly. Especially when handling huge tables!

HTML Element ID's can't start with a number

I was recently building a jQuery-based slider for our upcoming website re-launch and needed to identify a series of elements numerically. Naturally I decided a number that auto-incremented would be ideal, so I build a testing stage to do just that.

Prevent text-selection of buttons

How can you make a text link with your nice new styles behave like a button, instead of a selectable inline link? CSS, again, as the answer!

Quick and Easy CSS Rounded Corners

If you’re even too lazy to visit http://border-radius.com, then use the code below for your beautiful CSS3 rounded corners. Remember if you want to round some corners and not others, just follow standard CSS shorthand (ie. 3px 3px 0px 0px).

Adding a CMS tooltip

TextField::create('MyText', 'My Text Label')
->setDescription('More <strong>detailed</strong> help')
->addExtraClass('cms-description-tooltip');

Add field to a many_many relationship

MyClass.php

Diagnose VirtualHost rules on Apache

When diagnosing problems with Apache and VirtualHosts, especially when using SSL on a shared IP address, it makes life a lot easier to be able to show all the calculated priorities and _default_ servers. Running this command will show all:

Access Controller function from Model

Got functionality that lives in the controller that you need to access from an object's Model? Let's say your function is called MyFunction, this is how it would play out:

Remove Add button from GridField

Sometimes you need to be able to edit and delete GridField records, but you don't want the big green "Add New Object" button at the top. Here's how you remove it:

Using TeamViewer and XBMC

TeamViewer (http://teamviewer.com) is an amazing tool, much like LogMeIn which allows you to remotely access your desktop. Occasionally I need remote desktop access to my media center computer, which is running Windows and XBMC. The unfortunate thing about the TeamViewer session is that once it is terminated, it leaves a sponsorship message on the remote machine (and your local).