$(document).on('ready', function () { if ($('.field-ckfinder_file_chooser').length > 0) { CKFinder.config({connectorPath: '/ckfinder/connector'}); } });