| Topic: | [HOW TO] Enable your modules for scribite in PN .8 |
|---|---|
|
alarconcepts
Professional
Posts: 2723 Posted: |
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:
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: Code<textarea name="msg" cols="50" rows="20"></textarea> ...into something like this: Code<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"): Code// 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 |
|
AmmoDump
Team Member
Posts: 3024 Posted: |
Thanks AC! Very Clear! It would look even beter as a Wiki! ;) -- David Pahl Zikula Support Team |
|
alarconcepts
Professional
Posts: 2723 Posted: |
;) No problem. I didn't find an associated category in the Wiki and it also occurred to me that this method would probably be replaced in time, so I wasn't sure the Wiki was a good place for it over the Tips/Tricks forum. Well that, and I haven't much studied the Wiki formatting rules... :) -- Photography | PHP | Other |
|
hilope
Helper
Posts: 112 Posted: |
In the next days i will release a new version of scribite! for pn.8 (v1.3). That version will allow admins to add/remove/modify supported modules via scribite! administration. That will help a lot i think ;) -- scribite! - pimp your Zikula |
|
alarconcepts
Professional
Posts: 2723 Posted: |
That will be very helpful! =) -- Photography | PHP | Other |
|
Wendell
Professional
Posts: 1042 Posted: |
hilopeThat version will allow admins to add/remove/modify supported modules via scribite! administration. That will help a lot i think ;) That would be a welcome addition to an already awesome module. --
|