Blog Posts

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-662edf078a68b862994296/]  

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-662edf078ab75505501919/] 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-662edf078ad5d273195649/] Or when you adding a field to a tab: [crayon-662edf078ad67436931905/]  

Continue Reading

Free Stock Photo Images Websites

Photography plays a lot of roles in web design. Good design with bad images is a no go situation. As a web developer, there are times when I need to use great photos to make my mockup looks alive or when building web templates. Thankfully, there are a good number of websites with fascinating stock photo popping up all over the web. And they’re free. About Licensing Many of these photographs are free from copyright restrictions or licensed under creative commons public

Continue Reading

Solving ACF Repeater issue for not saving after XX rows

When your ACF Repeater exceeds more than hundreds of rows, ACF Repeater will only save the data up to certain point and discard the rest of it. This issue is caused by PHP’s max_input_vars, max_input_nesting_level, post_max_size and max_input_time. To fix this issue, we just have to increase our PHP configuration to a higher level. By default PHP sets those variables to a certain point for security reason. So we’re about to breach that protocol because we need our site to work. Below is an

Continue Reading

Rotating iOS Photo Correctly using CodeIgniter’s Image_lib

I have an issue with iOS Photo recently not being displayed properly after uploading. After googling around, I’ve managed to found a workaround for this issue. Imagine this scenario: You have a working website with file uploader and then strange phenomenon happens when you upload a photo from iPhone in portrait. The photo is uploaded properly, but the orientation is landscape. What is the problem with iOS Photo? The problem was that image rotation was added to the photo as EXIF

Continue Reading

Sending Analytics Page View or Event in Contact Form 7

As mentioned in my other post about Google AdWords and Contact Form 7: Google AdWords Conversion Tracking in Contact Form 7, Contact Form 7 does not create a thank you page after form submission. But we still want to track it in Analytics. There are some ways to track form submission by using: Google Analytics – Event Google Analytics – Page Views Tracking using Google Analytics Event To do this, you have to go to the contact form and open Additional

Continue Reading

Setting Year Range Dropdown in jQuery UI Datepicker

jQuery UI - Datepicker

By default, jQuery UI Datepicker’s year dropdown shows only 10 years. It is alright if we are using Datepicker to select recent date, but what if user needs to go way back (like 50 years)? This will create a big inconvenience if we are using jQuery UI Datepicker for birthdate. The solution is to add yearRange option when initializing jQuery UI Datepicker. This will extend the amount of years generated on the dropdown. See the full snippet below: [crayon-662edf078b58b368599652/]  

Display Joomla Module inside K2 Component (com_k2)

The good thing about K2 is you can customize your layout according to your will. But what if you need to display some modules? Unfortunately K2 does not allow you to just use <jdoc:include> [crayon-662edf078b80e972884333/] Therefore, we have to go a different way by fetching module using JModuleHelper. The snippet below will allow K2 to display all modules that have popup-form position. The if statement is there to allow fail safe when there is no module [crayon-662edf078b817316734977/]   If you want

Continue Reading

Google AdWords Conversion Tracking in Contact Form 7

Track Conversion using Google Adwords and Contact Form 7

You’re using WordPress and Contact Form 7 and everything seems great. But one day, you need to track in Google AdWords how many people use the contact form to see the conversion rates. Unlike some contact form plugins, Contact Form 7 does not generate a thank you page after submitting the form. This will make it hard to embed Google AdWords Conversion Tracking Code. The good news is Contact Form 7 allows you to attach a function call after form

Continue Reading

Sliding Sidebar