Making Silverstripe Editor – TinyMCE Smaller

Silverstripe uses TinyMCE for its HTMLEditorField. By default, the editor is rendered relatively tall. But how do we change the height to make it smaller without having to alter Silverstripe core file? Silverstripe provides setRows() function to modify HTMLEditorField height. So you can make it smaller or bigger (if you think the default is not big enough). As usual, you can chain the function after ::create() like below: [crayon-660658e48bc95908002370/]  

Modifying Silverstripe 3 Member Lock Out

By default, Silverstripe gives 10 attempts for user to sign in. The easiest way to modify the lock out delay and number of attempt in Silverstripe 3 is through config.yml Go to mysite/_config/config.yml and add the following code: [crayon-660658e48d0c3120448284/] And voila, your silverstripe lock out system is updated without the need to update the Silverstripe’s core. If you ever need to access Member’s attribute regarding to lock out, you can use the following: (assuming $member is an instance of Member class) $member->LockedOutUntil

Continue Reading

Adding Description in Silverstripe CMS Fields

When building forms, there are times when we want to display helpful information regarding the field. There are a couple of ways to do this: by using LiteralField or using setDescription() in the field object. Silverstripe provides setDescription() function in a field object to help generating text underneath a field. This field can be chained with other function. So you can set the description on creation like below: [crayon-660658e48d5d9342152236/] Or when you adding a field to a tab: [crayon-660658e48d5e3613659170/]  

Continue Reading

Sliding Sidebar