close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Use Own Stylesheet in PowerCMS

Thread began 12/30/2009 1:10 pm by reneas.email303886 | Last modified 5/10/2011 8:30 am by reneas.email303886 | 7922 views | 27 replies

Jason ByrnesWebAssist

you do not need to install HTML Editor to get your style sheet into the toolbar, but you _do_ need to edit the code if you dont install it.

1) on the admin/contents_insert.php and admin/contents_update.php page, change the following code:

$CKEditor_config["toolbar"] = array(

array( 'Source','DocProps','-','Save','NewPage','Preview','-','Templates'),
array( 'Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'),
array( 'Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'),
array( 'Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'),
array( 'Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'),
array( 'FitWindow','-','About'),
array( 'Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'),
array( 'OrderedList','UnorderedList','-','Outdent','Indent'),
array( 'JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'),
array( 'Link','Unlink','Anchor'),
array( 'Style','FontFormat','FontName','FontSize'),
array( 'TextColor','BGColor'));


$CKEditor_config["toolbar"] = array(

array( 'Source','DocProps','-','Preview'),
array( 'Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker'),
array( 'Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'),
array( 'Image','Flash','Table','HorizontalRule','Smiley', 'SpecialChar','PageBreak'),
array( 'Bold','Italic','Underline','Strike','-','Subscript','Superscript'),
array( 'NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'),
array( 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'),
array( 'Link','Unlink','Anchor'),
array( 'Styles','Format','Font','FontSize'),
array( 'TextColor','BGColor'),
array( 'Maximize','ShowBlocks'));

2) in the admin/contents_insert.php and admin/contents_update.php page

chagne the following code:

$CKEditor->editor("ContentValue", $CKEditor_initialValue, $CKEditor_config);


$CKEditor_config["stylesCombo_stylesSet"] = "my_styles:style_lists/stylelist1.js";

$CKEditor->editor("ContentValue", $CKEditor_initialValue, $CKEditor_config);

3) in the admin/contents_insert.php and admin/contents_update.php page, add a reference to the style sheet, for example:
<link rel="stylesheet" type="text/css" href="../mycss.css"/>

4) Create a new folder in the webassist/ckeditor folder named "style_lists", inside that folder create a new js file named "stylelist1.js"

5) add the following code:


[    { name: "my red div",  element: "div",  ordered_list: [ "a:0" ],  attributes: { "class" : "myredclass" } },
    { name: "my blue div",  element: "div",  ordered_list: [ "a:0" ],  attributes: { "class" : "myblueclass" } },

this will add two items to the style list:
my red div
my blue div

selecting my red div will add a div around the selected text with a class of "myredclass"
<div class="myredclass">selected text</div>

you can add other items to the style list using the same format of:
Name - what will be displayed in the list
Element - the type of element it applies to
attributes - how the style is added to the tag.

more details on the addStylesSet can be found here.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...