Limiting Site Studio WYSIWYG Object Dialogs
By Kyle Hatlestad on Sep 25, 2009
I recently got a question from someone that asked if it was possible to modify the WYSIWYG element form to limit the options available to contributors when adding tables. Specifically, they wanted the ability to take away cellpadding, cellspacing, border size, etc... so that they could control all of this through their own CSS.
In looking into it, there's no real OOTB way to do this. But I dug a little bit deeper and found out how this can be done. Basically, you'll need to edit the FCK editor's primary dialog files to make the changes. Now there is the quick & dirty way to do this...and there is the right way to do this.
The files that the editor uses are within the weblayout\resoureces\wcm\sitestudio directory. But you don't want to modify those because they are re-published from the Site Studio component every time the server is restarted. So if you want to do the quick & dirty method, you would go to the file:
[ucm home dir]\custom\SiteStudio\publish\resources\wcm\sitestudio\elements\shared\fck_table.html
and edit it there. When done, you would go to Administration -> Actions -> Publish Static Layout Files. Now the one in the weblayout directory would be replaced with the modified one.
The caveat with this method and why it's not the right way is because if you install a patch or updated version of Site Studio, it's going to wipe out your changes. So the proper way is to create a separate component that contains that modified file and gets published instead. Here are the basic steps to do so:
- Create a component and include a Static Table resource.
- Here is what the code in the table should look like:
- Create a publish path in your component that will mirror the weblayout path (\publish\resources\wcm\sitestudio\elements\shared)
- Copy the fck_table.html file from the Site Studio component and place it in the directory.
- Modify the HTML file with the changes needed.
- Enable the component and restart. The updated file should be published
- (Optional) If you plan on packaging up the component, be sure to include the publish directory as a ComponentExtra.