sNews 1.6 (previous version) > 3rd Party Integration and bridges

WYMeditor (open source web-based editor)

(1/3) > >>

patrice:
"WYMeditor is a web-based WYSIWYM XHTML editor.

WYMeditor's main concept is to leave details of the document's visual layout, and to concentrate on its structure and meaning, while trying to give the user as much comfort as possible (at least as WYSIWYG editors).

WYMeditor has been created to generate perfectly structured XHTML strict code, to conform to the W3C XHTML specifications and to facilitate further processing by modern applications..."

More information : http://www.wymeditor.org/en/
Demo : http://www.wymeditor.org/en/demo/

Step-by-step method to replace sNews default editor with WYMeditor

(the method is similar to the one explained in this post)

Download archive wymeditor-0.4.tar.gz

Unarchive the file and move directories 'jquery' and 'wymeditor' into 'sNews' root directory

All the following code modifications must be made into 'snews.php'.

Replace line 325
   
--- Code: ---if ($_SESSION[db('website').'Logged_In'] == token()) {js();}
--- End code ---
with
   
--- Code: ---if ($_SESSION[db('website').'Logged_In'] == token()) {js();
echo
' <link rel="stylesheet" type="text/css" media="screen" href="wymeditor/skins/default/screen.css" />
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript" src="wymeditor/jquery.wymeditor.js"></script>
<script type="text/javascript">
jQuery(function() {
jQuery(".wymeditor").wymeditor({
cssPath: "'.db('website').'wymeditor/skins/default/screen.css",
jQueryPath: "'.db('website').'jquery/jquery.js",
wymPath: "'.db('website').'wymeditor/jquery.wymeditor.js"
});
});
</script>';
}
--- End code ---
Replace line 1048

--- Code: --- case 'textarea': $output = '<p>'.$lbl.':<br /><textarea name="'.$name.'" rows="'.$rows.'" cols="'.$cols.'"'.$attribs.'>'.$value.'</textarea></p>'; break;
--- End code ---
with

--- Code: --- case 'textarea':
if ($_SESSION[db('website').'Logged_In'] == token()) {
$output = '<p>'.$lbl.':<br /><textarea class="wymeditor" name="'.$name.'" rows="'.$rows.'" cols="'.$cols.'"'.$attribs.'>'.$value.'</textarea></p>'; break;
} else {
$output = '<p>'.$lbl.':<br /><textarea name="'.$name.'" rows="'.$rows.'" cols="'.$cols.'"'.$attribs.'>'.$value.'</textarea></p>'; break;
}
break;
--- End code ---
Comment from line 1312

--- Code: ---/* echo '<p>';
--- End code ---
to line 1322

--- Code: --- echo '</p>';*/
--- End code ---
Replace line 1327

--- Code: --- echo html_input('fieldset', '', '', '', '', '', '', '', '', '', '', '', '', '', '<a title="'.l('customize').'" onclick="toggle(\'preview\')" style="cursor: pointer;">'.l('preview').'</a>');
--- End code ---
with

--- Code: --- if ($_SESSION[db('website').'Logged_In'] == token()) {
echo html_input('fieldset', '', '', '', '', '', '', '', '', '', '', '', '', '', '<a title="'.l('customize').'" class="wymupdate" onclick="toggle(\'preview\')" style="cursor: pointer;">'.l('preview').'</a>');
} else {
echo html_input('fieldset', '', '', '', '', '', '', '', '', '', '', '', '', '', '<a title="'.l('customize').'" onclick="toggle(\'preview\')" style="cursor: pointer;">'.l('preview').'</a>');
}
--- End code ---
Replace line 1393

--- Code: --- echo html_input('submit', $frm_task, $frm_task, $frm_submit, '', 'button', '', '', '', '', '', '', '', '', '');
--- End code ---
with

--- Code: --- echo html_input('submit', $frm_task, $frm_task, $frm_submit, '', 'wymupdate', '', '', '', '', '', '', '', '', '');
--- End code ---

That's all, everything should work perfectly! If you meet problems in integrating WYMeditor, feel free to post me a message. For other resquests concerning WYMeditor, please refer to the official site.
Note that I am just a Web developer that has no interest in WYMeditor. I have discovered this editor a few days ago (at the same time than sNews) and I have adopted it right away (like sNews). In my opinion, this is a very good Web-based editor since it produces very clean code compliant to the standards. Last but not least it is very well supported and the project seems very dynamic. Enjoy!
Patrice

Keyrocks:
Thanks for your contribution Patrice... and welcome to our sNews Project. I am sure other members will look forward to test-running your well detailed instructions. Please check back to this topic now and then... to assist anyone who may experience difficulties.  ;)

piXelatedEmpire:
Welcome aboard patrice!  This looks very nice - what a terrific first post! Cheers!

Patric Ahlqvist:
Karmalicious, indeed. that'll give "France Uh point", France one point. Welcome and enjoy, Patrice

patrice:
Thanks for your welcome, sNews is not only a great CMS but also a nice team!

Navigation

[0] Message Index

[#] Next page

Go to full version