I’ve had several projects in the past few months which have called for some limited content management capabilities. In cases like these, where only small sections of the site need to be handled by an administrator, it seems silly to build the entire site on top of existing CMS platforms like Joomla or Drupal. The problem is, if you build a small administration area, you’ll have to have some mechanism for specifying simple HTML content for the non-tech savvy.
A co-worker recommended FCKeditor, so I implemented it in a recent administration interface to control text for a few pages. So far it’s worked extremely well, and was a breeze to implement. Here’s a summary of my implementation:
- Downloaded, unzipped, and stored the FCKeditor files
- Created a custom editor style file (myeditorstyles.css), and put the site’s content styling rules in it so the editor would mimic the site’s style
- Created a custom configuration file (myconfig-default.js), which serves to remove a bunch of the unnecessary functionality, and reference the style:
FCKConfig.FontFormats = 'h1;h2;h3;p';
FCKConfig.ToolbarCanCollapse = false;
FCKConfig.EditorAreaCSS = '/lib/includes/FCKeditor/myeditorstyles.css';
FCKConfig.ToolbarSets["Default"] = [
['Save'],
['Undo','Redo'],
['Bold','Italic','Underline'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink'],
['FontFormat'],
['About', 'Source']
];
- Included the initialization files on the pages I put the editor:
<?php
include_once("[myeditorpath]/fckeditor.php") ;
?>
- Then referenced the editor where I wanted to add it in my code:
$oFCKeditor = new FCKeditor([myeditorid]);
$oFCKeditor->BasePath = '/[myeditorpath]/';
$oFCKeditor->Config["CustomConfigurationsPath"] = "/[myeditorpath]/myconfig-default.js";
$oFCKeditor->Height = '500';
$oFCKeditor->Create();
That’s it! There’s a ton of other customization options, help with implementation, and general resources in the documentation.
Other Options
I highly recommend FCKeditor, but if it doesn’t work for some reason you can always try TinyMCE or openwysiwyg. Both seem full-featured and easy to implement, and both have significant recent activity.
If you think content won’t require any additional HTML formatting, you could always just programmatically replace line breaks in text areas with HTML line breaks and vice versa. This would allow the administrator to use carriage returns to separate text, but would require some HTML knowledge for additional formatting.
Add to Any and AddThis are fantastic and easy to implement bookmarking and sharing buttons. Definitely a must have for anybody hoping to capitalize on traffic to any of the current popular social media sites. So… which one is better? And how do you implement them on your site?