how to add a readme to a custom plugin so it displays below the form

Discussion in 'aMember Pro v.4' started by customcodegeek, Feb 19, 2012.

  1. customcodegeek

    customcodegeek Member

    Joined:
    Feb 10, 2012
    Messages:
    40
    Hi,
    I need to add some more instructions to a custom plugins configuration page like that shown in the paypal plugin config page but I can't seem to get it to work with a extends Am_Plugin class in my custom plugin.

    I tried adding a public function of getReadme() to the plugin but I can see that Am_Plugin has an empty readme.

    is there a way for me to add to below the plugin page. I tried the example in the wiki but that results in a page load of text saying
    SAMPLE PLUGIN WORKING! =
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    If you use onSetupForms hook in your plugin, add this to the bottom of the hook:
    PHP:
            if ($plugin_readme $this->getReadme())
            {
                
    $plugin_readme str_replace(
                    array(
    '%root_url%''%root_surl%''%root_dir%'), array(ROOT_URLROOT_SURLROOT_DIR), $plugin_readme);
                
    $form->addEpilog('<div class="info"><pre>' $plugin_readme '</pre></div>');
            }
    $event->addForm($form);
    Then define getReadme function.
  3. customcodegeek

    customcodegeek Member

    Joined:
    Feb 10, 2012
    Messages:
    40
    Thanks Alexander, the $this->addEpilog will be useful.

    I'll try that

Share This Page