If you placed your uploads folder somewhere other than your site's root, make sure you change that here as well.ħ) Back on your form view, we need to tell our CLEditor to start using the file uploader. "/./uploads/" // path to the uploads folder "/uploads/" // URL for the uploads folder htaccess files set up.Ħ) In your controller action, you need to enable the file uploads (so that a user can't just access kcfinder from anywhere, and then set the upload paths like so: $_SESSION = false // enables the file browser in the admin The only option I had to change was to set _check4htaccess to false, but that was due to my personal server config and the way we have our. Don't worry about the uploadURL and uploadDir for now, we are going to set those using Yii so that they work correctly. You can read the kcfinder docs for more info on these. Make sure you set your permissions! If you get error messages later on, most likely you're either having a path issue or permissions issues.ĥ) Make any changes to kcfinder/config.php. My upload folder is located at sitefolder/uploads. I chose to create a new folder for this, in order to keep any uploads done by my clients separate from the other resources on the site. I put mine at sitefolder/kcfinder.Ĥ) Create a folder for your uploads, again, outside of protected. ![]() ( ) Extract and put it in the root folder outside of protected again. If you want to also allow images to be uploaded, make sure the basic editor is working, and then keep going.ģ) Download KCFinder. No weird extensions or anything like that. If all you wanted was the editor, then you're done! Simple as pie. Note the path on the javascript include should change if you installed somewhere else. textArea($ model, ' short_version', array(' id'=>' editor1')) ?> ![]() A quick example follows, the attribute of my model is called 'short_version': īecomes: baseUrl.'/ckeditor/ckeditor.js' ?>"> If you want to change the config options for buttons and such, do it in the config.js file.Ģ) Import the script file, give the textArea that you want to become an editor an id, and then initialize CKEditor on that textArea. I put mine in my root web folder for my site, so if sitefolder/protected is my protected path, I put mine at sitefolder/ckeditor. Here it is:ġ) Download the latest CKEditor ( ), unzip it, and move the contents to a folder OUTSIDE of your protected folder. All paths are relative, using Yii functions, so this will work no matter where you install. It will be used in a CActiveForm, without the use of any crazy weird widgets. Today I went through the process of adding CKEditor to one of my projects, and then integrating KCFinder as the image uploader. ![]() Learn how File Uploader works, to understand the philosophy we put as a base of the component, and to learn its features and capabilities.Hey guys, I'm hoping other people will find this helpful. Use the API that allows to invoke a component of your application with specified parameters. Just specify dimensions you want the images to fit. There are three templates for uploading files - as an image, as a preview and as a link to the file.Images can be renamed after uploading and before commit.File sets are uploaded as transactions to avoid partial uploading.Automatically makes backup copies of original images before editing. ![]() This one add-on encompasses functionality of these previously known add-ons:įile Uploader is a standalone product, it has its own SDK and does not need third-party file managers. Besides uploading, it offers the most critical features, such as relocation from an external website by URL, resizing of pictures and inserting them as a preview or a link. File Uploader is a versatile solution to upload files and images to the server and to embed them into the edited area.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |