I’m working on this page on a client’s site (I’m calling this the “experimental page” in my description below). I’m trying to implement wysiwygPro editor in a stand alone entry form and I’m running into some errors that I don’t know how to solve (my php skills, which are required for implementing wysiwygPro, are rudimentary at best).
1. I’m also going to be asking the developer of wysiwygPro for his help, but he is not familiar with ExpressionEngine so I’m thinking it may take a combination of help from EE folks and him to ultimately solve the issues.
2. The page I’ve referenced above is experimental. Ultimately, what I’m trying to do is pull a stand alone entry form into the sidebar of the site so that people can post to one of 234 different weblogs from different parts of the site. I’ve been able to successfully implement that part of the project with a form which uses a dropdown menu of all the weblogs, XMLHttpRequest and url segments (to choose the correct weblog per the user’s choice from the dropdown menu) to pull in a stand alone entry form which will post to the user’s desired weblog.
3. This page has a working example of the stand alone entry form without wysiwygPro (you would have to click on the Tell Your Story header in the sidebar, but you would also have to be logged in as a member to access the stand alone entry form under that header - if you want to see it in action, let me know and I can PM a login and password). I’m calling this the “working example page” in my description below.
4. The basic template structure of both pages (the one with wysiwygPro and the one without it) looks something like this:
a. an index template (index_separate for the experimental page and index_separate_wowysiwygpro for the working example page) which lives in a template group called afghanistan. These are the basic templates for the pages.
b. a sidebar template (sidespot_expandable for the experimental page and sidespot_expandable_wowysiwygopro for the working example page) which I have embedded in the index template and which lives in a template group called sidespot.
c. a template for the stand alone entry form (submit for the experimental page and submit_wowysiwygpro for the working example page) which lives in a template group called site and which is loaded through XMLHttpRequest when the user selects an item from the drop down menu in the sidebar template.
5. Now I want to use wysiwygPro to add a text editor to the body and extended fields of the stand alone entry form. The directions for implementing wysiwygPro have two basic parts (there appears to be a lot more that you can do with it, but I want to at least get the basic editor working first before I start trying other stuff and I run into a roadblock immediately when trying to implement the basic editor):
a. Add a php include statement to your template. On the experimental page (in the index_separate template), I’ve added this code above the doctype in the index_separate template:
<?php
// include the WysiwygPro class
include_once("/wysiwygPro/wysiwygPro.class.php");
// start a session
session_start();
?>
b. Add php code to create the text area with the editor. I’ve added this code to the submit template to create the text area:
<?php
// create a new editor instance:
$editor = new wysiwygPro();
// configure the editor:
// give the editor a name
//(equivalent to the name attribute on a regular textarea):
$editor->name = 'field_id_2';
// set the content to be edited
//(equivalent to the value attribute on an input element or the content of a regular textarea):
$editor->value = '<p>some HTML code</p>';
// display the editor, the two paramaters set the width and height:
$editor->display('100%', '400');
?>
<!-- <textarea name="field_id_2" class="saeftextarea" rows="10" onclick="setFieldName(this.name)">
</textarea> -->
As you’ll see, I’ve left the original text area and commented it out - this will show you what the code was that successfully created the text area without the editor (in the submit_wowysiwygpro template).
6. If you look at the experimental page, you’ll see this error at the top of the page (on the experimental page, I’ve made the background color white so you can see the error; I’ve also put some line breaks in the errors below so that it won’t create scrollbars):
Warning: Unknown(/wysiwygPro/wysiwygPro.class.php):
failed to open stream: No such file or directory in
/home/missio/public_html/blog/system/core/core.functions.php(637) :
eval()'d code on line 4
Warning: (null)() [function.include]:
Failed opening '/wysiwygPro/wysiwygPro.class.php' for inclusion
(include_path='.:/usr/lib/php:/usr/local/lib/php') in
/home/missio/public_html/blog/system/core/core.functions.php(637) :
eval()'d code on line 4
and then if you were logged in and selected the Afghanistan option from the drop down menu in the sidebar, you would see this error (the exp:weblog:entry_form tag appears, :
{exp:weblog:entry_form weblog="afghanistan"
return="afghanistan/submitthankyou" preview="afghanistan/submit"}
--- snipping out some of the form labels ---
Fatal error: Cannot instantiate non-existent class:
wysiwygpro in /home/missio/public_html/blog/system/core/core.functions.php(637)
: eval()'d code on line 15
I realize that these issues are probably far outside the scope of normal EE support, so if it’s something you feel you can’t help me with, I’ll certainly understand.
Thanks,
Frank
