The scribite module, in all its power, doesn't work with every module out there without a little attention. To this end, I'm posting what worked for me and my understanding of why it works. Be it known that I'm not the developer of the module and will be unable to provide support for it beyond this short tutorial, and that any information contained herein is not intended to be a know-all guide.
All that said, install the scribite module as per the instructions. Via the scribite admin, configure it to work with (say) the Admin_Messages module, and then save the settings. Afterward, navigate to the admin side of your Admin_Messages module and attempt to create a new item. The goal here is not to fully create a new item, but simply to ensure that your scribite is working with your site properly; if you see the editor on your page, the module would seem to be working. If not, the rest of this post will quite possibly be useless to you, so go back through the install instructions (and then this paragraph again!) before proceeding.
In order to make a module work with scribite, several things need to happen:
- 1) HTML textarea tags within the module's templates need to have a unique id attribute.
- 2) The module in question will need to be added to the pnuserapi.php file of scribite.
- 3) The module in question will need to be enabled through the scribite admin.
For the first item, you must navigate through your module's templates and find any
HTML textarea tags. When you do, you must ensure that each has a unique id attribute. So, for example, if you were enabling scribite for a module called "Contact" then you might end up changing something like this:
<textarea name="msg" cols="50" rows="20"></textarea>
...into something like this:
<textarea id="contact_msg" name="msg" cols="50" rows="20"></textarea>
NOTE: The ID does not have to have the module name prefixed onto it, this is done shearly for clarity.
Once you add unique ids to all your textarea tags, you can "connect" scribite to your module in the following way:
1) Open /modules/scribite/pnuserapi.php and locate the scribite_userapi_getModConfig() function. Find the line that reads
return $modconfig;, and
before that line, insert the following (again, based on a module called "Contact"):
// Checks to see if module is installed.$modconfig['Contact']['installed'] = pnModAvailable
('Contact');
// Comma-separated array of affected textarea id's.$modconfig['Contact']['areas'] =
array('contact_msg');
// Comma-separated array of functions scribite shall be used in (in this module).// Note that the first element is blank; this will allow scribite to work when // there is no function in the URL (ie, a main() function).$modconfig['Contact']['funcs'] =
array('',
'compose');
Then, once you're done with that, navigate back over to the scribite admin and you should now see a checkbox for the "Contact" module (or whatever module you're working on.) Check the box and save the settings.
Now, when you navigate back to the module (still basing on the "Contact" example,) you should see the scribite editor in action when accessing the pages created through the the following functions:
Contact_user_main()
Contact_user_compose()
And I think that about sums it up...!
:)
--
Photography |
PHP |
Other