Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
[HOW TO] Enable your modules for scribite in PN .8
  • Posted: 25.03.2007, 23:35
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    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:

    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
  • Posted: 25.03.2007, 23:47
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    2975
    Thanks AC!

    Very Clear! It would look even beter as a Wiki! ;)

    --
    David Pahl
    Zikula Support Team
  • Posted: 25.03.2007, 23:59
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    ;) 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
  • Posted: 10.04.2007, 10:54
     
    rank:
    Helper Helper
    registered:
     August 2003
    Status:
    offline
    last visit:
    15.11.08
    Posts:
    111
    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
  • Posted: 10.04.2007, 22:25
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    That will be very helpful! =)

    --
    Photography | PHP | Other
  • Posted: 10.04.2007, 22:28
     
    Wendell
    rank:
    Professional Professional
    registered:
     February 2004
    Status:
    offline
    last visit:
    01.11.08
    Posts:
    1037

    hilope

    That 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.

    --
    DWX Logo

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula